This example demonstrates how to use the ASPxGridLookup to select multiple values from a dropdown grid containing lookup items. The ASPxGridLookup is bound with the custom DataItem defined within the "LookUpDataItem" type (contains row field).
The embedded ASPxGridView component is pre-customized as the ASPxListBox:
- The ASPxGridView's Header is hidden;
- The ASPxGridView's Pager is used for splitting DataItems within multiple pages to improve the client-side performance.
The embedded ASPxGridView's sever-side "CustomJSProperties" event is attached by handling the ASPxGridLookup's Init event. To get a reference to the embedded ASPxGridView, use the ASPxGridLookup.GridView property.
The embedded ASPxGridView's client-side "SelectionChanged" event is attached by handling the ASPxGridLookup's Init event, via the ASPxGridLookup.GridView.ClientSideEvents.SelectionChanged property.
UPDATED:
Starting with version v2014 vol 1 (v14.1), the "Select All" functionality is available out of the box:
S173621: ASPxGridView - Add the built-in SelectAll CheckBox for Command Column
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.
OBSOLETE:
For the "Select All" functionality, instructions from the ASPxGridView - How to implement SelectRows and SelectAllRowsOnPage CheckBox features KB Article is used.
For the "partial selection" functionality, newly implemented ASPxCheckBox rendering (ASP.NET Check Box - New Render State For Multiple Controls (available now in v2011.1)) is used.
Question Comments
Added By: Neha Wahi at: 10/15/2015 1:52:54 AM
I cannot use grid lookup column as that column has comma separated values, and I want to show disticnt values for that column as a lookup. Also I want a type ahead functionality.
Added By: Nastya (DevExpress Support) at: 10/15/2015 4:49:44 AMHello,
To process your recent post more efficiently, I created a separate ticket on your behalf: T300697: ASPxGridLookup - How to show distinct values. This ticket is currently in our processing queue. Our team will address it as soon as we have any updates.