Quantcast
Channel: DevExpress Support Center (Examples)
Viewing all 7205 articles
Browse latest View live

How to implement check boxes with SelectRows and SelectAllRowsOnPage features in a grid's template

$
0
0

This example not only illustrates the ASPxClientGridView.SelectRows and ASPxClientGridView.SelectAllRowsOnPage, but also shows a way in which to implement these features with check boxes within a grid's templates.

Question Comments

Added By: Bradmartin41 at: 7/19/2013 1:41:22 PM    

This works wonderfully, except I have one issue. When first selecting the 'cbAll' checkbox in the header, all rows are selected, but the header checkbox deselects itself. Then I have to select all again, then deselect. Odd behavior.

Any ideas?

Added By: Gerardo Reyes 1 at: 8/14/2014 10:17:20 AM    

This example doesnt work properly when there are two grids in the same page and try to have the same functionality with checkboxes columns

Added By: Larry (DevExpress Support) at: 8/14/2014 10:40:58 AM    

Hello,

To process your recent post more efficiently, I created a separate ticket on your behalf: T140431: How to implement check boxes with SelectRows and SelectAllRowsOnPage features in a grid's template when using two or more grid's. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.


How to calculate a master property based on values from a details collection

$
0
0

See the How to: Calculate a Property Value Based on Values from a Detail Collection help topic for more information.

See Also:
XPO Best Practices
How to display details collections with descendant classes filtered by object type in a DetailView

Question Comments

Added By: Robert Fuchs at: 1/28/2013 9:01:23 AM    

Not using XAF web, just to let you know that there are warnings in 12.2.5:

Warning     1     Could not resolve this reference. Could not locate the assembly "DevExpress.Web.ASPxEditors.v12.2". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.     WinWebSolution.Web
Warning     2     Could not resolve this reference. Could not locate the assembly "DevExpress.Web.ASPxGridView.v12.2". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.     WinWebSolution.Web
Warning     3     The referenced component 'DevExpress.Web.ASPxEditors.v12.2' could not be found.      WinWebSolution.Web
Warning     4     The referenced component 'DevExpress.Web.ASPxGridView.v12.2' could not be found.      WinWebSolution.Web

Added By: Martin D. at: 6/15/2014 4:22:52 AM    

Hi,

I think this sample needs to be reviewed !
There's a problem with it. If You'd put a breakpoint in Product (line 44 or line 54) - the UpdateTotals.. method - get executed when I click "Reload" in the ListView.

Basically - if I have N+1 records in the ListView, and click refresh, it would go and fetch the details for all child records, and recalculate the "Total" on the master record. Though it should NOT.

That kinda the point of having it persistent right ? So it would get recalculated only when one updates the Details collection !

Added By: Dennis (DevExpress Support) at: 6/16/2014 8:32:42 AM    @Martin: Thanks, I will answer you in E305 sample - is recalculating "header" values on Reload - though it should not  on this.Added By: Arjan van Dijk at: 8/14/2014 2:37:30 PM    

Can you please give me an example using domain components?
Thx

ASPxDocumentViewer - How to implement custom toolbar

GridView - Batch Editing - How to cancel editing or disable the editor conditionally

$
0
0

This example demonstrates how to cancel editing or disable the editor conditionally for the grid when batch editing is in use. It is possible to execute your logic either on the client or server side for a complex business model.
Then, handle the grid's client-side BatchEditStartEditing event to either cancel the edit operation using the e.cancel property:

[JScript]
if(condition) e.cancel = true;

 or disable the editor by obtaining its client instance:

[JScript]
var editor = s.GetEditor(e.focusedColumn.fieldName); editor.SetEnabled(condition);

 The custom server-side logic can be executed in the CustomJSProperties event handler:

[C#]
settings.CustomJSProperties+=(s,e)=>{varclientData=newDictionary<int,object>();vargrid=sasMVCxGridView;for(inti= 0;i<grid.VisibleRowCount;i++){varrowValues=grid.GetRowValues(i,newstring[]{"ID","ServerSideExample"})asobject[];varkey=Convert.ToInt32(rowValues[0]);if(key% 2 != 0)clientData.Add(key,"ServerSideExample");}e.Properties["cp_cellsToDisable"]=clientData;};


See Also:

ASPxGridView - Batch Editing - How to cancel editing or disable the editor conditionally

How to obtain a dashboard item's client data in the WinForms Viewer

$
0
0

The following example demonstrates how to obtain client data corresponding to a particular visual element using DashboardViewer's API.
In this example, the DashboardViewer.DashboardItemClick event is handled to obtain client data for the Card dashboard item and display this data in a Chart control. We obtain axis points placed on the "Sparkline" axis for the clicked card, determine corresponding actual/target values, and save these values to a data table. This table is used as a data source for the Chart control. 
Note that you can apply master filtering by year in the Pie dashboard item. The chart will display client data according to the selected year.

How to configure dxPivot

OBSOLETE - How to create an Advanced Selection CheckBox at runtime

$
0
0

UPDATED:

Starting with version v2014 vol 1 (v14.1), this functionality is available out of the box. Simply set the GridViewCommandColumn.SelectAllCheckboxMode property to GridViewSelectAllCheckBoxMode.AllPages to activate it. Please refer to the ASP.NET: GridView Select All Rows Updated blog post and the Select All Rows demo for more information.

If you have version v14.1+ available, consider using the built-in functionality instead of the approach detailed below.
If you need further clarification, create a new ticket in our Support Center.

This sample demonstrates how to create an advanced selection checkbox at runtime. To implement this, I have created a new class (CommandColumnHeaderTemplate). This class implements the ITemplate interface and contains the code to create the CheckBox shown in the CommandColumn's header.

How to customize the New Report Wizard (introduced in the 2014 vol.1 release)) in the End-User Designer

$
0
0

This sample illustrates how to customize the wizard in the End-User Designer.


How to display a line when the DXGrid doesn't include any record

$
0
0

This sample shows how to display a message in the grid if there are no visible rows.

Question Comments

Added By: Sam Wheat at: 6/9/2013 5:48:12 PM    

Is this included in the base product?

If no, why not?

Added By: Goran_ at: 11/15/2013 4:29:46 AM    

Hi,

I also think that empty template should be available DxGrid, DxChart, and other "items controls".

The title of this example is not correct. This code does is not related to DxGrid, but to TableView, since it does not not work for CardView. Why there is no rowPresenterGrid element in CardView (haven't looked into other views)?

Regards,
Goran

Added By: Richard Barrow at: 8/15/2014 9:04:26 AM    

Broken for 14.1. You need to change

container.Children.Add(emptyGridContentresenter);

to

Grid.SetRow(emptyGridContentresenter, 1);
container.Children.Add(emptyGridContentresenter);

As the GridView template has changed.

GridView - How to implement copy functionality in Batch Edit mode

$
0
0
This example demonstrates how to add copied values to a new row on a custom command button click using a new client-side API implemented in the following threads:
ASPxGridView - Batch Edit mode - Provide a client-side API to obtain/modify cell values without entering edit mode 
ASPxGridView - Batch Edit mode - Provide client-side events that allow responding to entering and leaving the edit mode

WebForms version:
T114985: ASPxGridView - How to implement copy functionality in Batch Edit mode
Question Comments

Added By: Mitra Ebrahimi at: 8/16/2014 9:53:06 PM    

thanks for your fast answering but my problem is totally different.
when I add these gridview which has got batch editing mode in the main pane of a splitter.
my edit or delete or new button in gridview do not work any more.

How to construct an appointment editing form with custom fields

How to automatically update the SpinEdit value when the user moves the mouse holding down the left mouse button

$
0
0

This example demonstrates how to implement the feature, when the value of the SpinEdit is automatically decreased or increased based on the cursor position, when the user moves the mouse holding down the left mouse button.

Question Comments

Added By: Sharon Goodman at: 8/18/2014 3:02:27 AM    

Dear support, could you update the example with a sample code?

Thank you.

Added By: Jannet (DevExpress Support) at: 8/18/2014 3:12:32 AM    Hello Sharon,
I've updated this example. Please check whether or not code is visible and let me know your results.

How To: Implement Many-to-many Relations Editing

$
0
0

This example shows how to implement many-to-many relations editing in an application generated with the DevExpress Scaffolding Wizard.


The resulting application supports adding multiple Course objects to the Student.CoursesAttending detail collection and vice versa.

How to group tree list columns in bands in the same manner as in AdvancedGridView

$
0
0

NOTE: This example illustrates an approach to showing bands in a general way. This approach is not adapted by different TreeList features and printing/exporting. It cannot be easily extended to support different scenarios and features. So, if you need a full-functional solution, please wait when this feature is available out of the box. 



This example demonstrates how to create a custom tree list with the capability to create bands in the same manner as in AdvancedGridView.
Note that this is not a full implementation of bands in TreeList but just an example of how it can be done. Some features like Drag&Drop of bands and Column Chooser are disabled because of differences in TreeList layout calculation algorithm which does not support bands.
A request to implement this feature out of the box is already registered in our Support Center: TreeList - Implement bands in a manner similar to the one provided in AdvBandedGridView. You can subscribe to email notifications by adding this page to your favorites.

Question Comments

Added By: Afrizal Chen at: 6/4/2012 1:40:17 AM    

I set the left most column in this example to be "FixedLeft", the column is still overriden by the next columns when left-scrolled . Please help.

Added By: Afrizal Chen at: 6/26/2012 11:38:38 PM    

I wanted to override the PrintInfo just like "http://www.devexpress.com/Support/Center/p/E2667.aspx" but the TreeList class doesn't have the override method like "CreatePrintInfoInstance()"

Added By: (no info) at: 4/4/2013 10:22:57 AM    

Is this not possible with v2011 2.8?

Added By: Vasily (DevExpress Support) at: 4/4/2013 10:47:52 AM    

Hi David,

I have extracted your question to a separate ticket created on your behalf: Q373313 (How to group tree list columns in bands in the same manner as in AdvancedGridView).

Added By: anh lam at: 5/28/2013 9:12:32 PM    

in this demo if a column is not belong to any band, it's will not display on treelist at runtime. How can i do to slove this issue ?

How to: Add a button to a Form using Custom View Item


How to: Create a Custom Control Detail Item

How to use PieChartDataAdapter to add pie charts to a map

$
0
0

The PieChartDataAdapter class is intended to automatically generate pie charts from a data source. The following code demonstrates how to use PieChartDataAdapter to add pie chart items to a map.

How to implement a distributed object layer service working via WCF

$
0
0

Scenario

In this example we will implement a distributed object layer service (IObjectLayer/ISerializableObjectLayer) working via WCF. A distributed services layer relies on lower layers, but hides the details of these layers from upper layers that contain the application and business logic layers. This arrangement allows the application developer to work at a higher level of abstraction layers.

Steps to implement:

1. Create a new Class Library project and add a Customer class via the DevExpress v1X.X ORM Persistent Object item template. You can see the source code of this class in the Customer.xx file.

2. Create a new WCF Service Application project and remove files with auto-generated interfaces for the service.

3. Add reference to the newly created class library.

4. Modify the Service class as shown in the Service.xx file to create a data provider and data layer.

5. Modify binding properties as shown in the example's web.config file. At this stage, the service part is ready to work and we need to implement a client to consume data from our data store service (for demonstration purposes, we will create a Console Application).

6. Add a Console Application into solution and add reference to the newly created class library.

7. Modify the Main method in the same manner as the Program.xx file to connect to our service using the web.config configuration.

8. The final step is to add the App.config file to our client application and modify it as shown in the example's App.config file.

If you run the client application, you will see the following output:

Important notes:
Please note that the port number in the connection string may be different. You can check it in the properties of the service project in the Solution Explorer:

 

See also:
Transferring Data via WCF Services
How to use XPO with a Web Service
How to serialize your XPO
How to connect to a remote data service instead of using a direct database connection

How to implement Tree View Style including the paint style and the capability to collapse node by double-clicking its connection line

How to configure dxPieChart

Viewing all 7205 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>