Friday, 20 July 2012

DevExpress ASPxGridView find row index in Row Deleting Event

To find the row index of the row being deleted in a devexpress grid view you can use the code below: note: the KeyValue field must be set on the grid for this to work, if there is no id on the datasource, I just returned a unique GUID to differentiate between records.

How to populate DevExpress GridView combobox header filter

You need to subscribe to the AutoFilterCellEditorInitialize event. Check the column name, and cast the control to set the datasource.

DevExpress GridView restore selected items after page changing

If you have a dev express grid with paging enabled the selected items get lost after the page is changed. Note: Its important to call PerformCallback() on the gridview when the header checkbox is checked, otherwise the server does not know about the selected items to restore after the grid is rebound. To fix this issue use the code below: Code Behind:

How to select all items on a page in a DevExpress gridview

If you want to add a checkbox to a DevExpress Grid view to select all items on a page it can be achecived with the following:
Note: in order for the CheckBox script to be able to access the gridview, the ClientInstanceName property must be set. Also, if you want the server side selection changed event to be fired, you will need to call PerformCallback on the grid to update the server.

Thursday, 12 July 2012

How to use the DevExpress combo box with large datasources

ASPX ASPX Code Behind NOTE: there are +1's on the begin and end indexes, without this, scrolling does not work when filtered. Nominal account class (with paging)