aspnet-9075-components-grid-view-concepts-aspxgridlookup-selection-modes.md
The ASPxGridLookup has a data-processing feature adopted from the ASPxGridView that allows users to select multiple list items within a drop-down grid.
Specify the ASPxGridLookup.SelectionMode property to configure the selection behavior:
Note
true.Users can select items in the following ways:
By clicking items within a dropdown grid.
By clicking item check boxes within the dropdown grid.
By entering tags into the editor’s edit box.
ASPxGridView behavior varies based on the specified mode.
If the SelectionMode property is set to Single, you should utilize a focused row instead of a selected row. In this case, use the ASPxGridLookup.Value property on the server side and the GetValue / SetValue methods on the client side to get/set the focused row.
If the SelectionMode property is set to Multiple, you can use the following child ASPxGridView control members to access the selected items:
See the following Support Center example to learn more: How to use ASPxGridLookup in multiple selection mode as the ASPxGridView editor.
Note
In Multiple selection mode, incremental filtering is disabled.
The code sample below demonstrates how you can preselect some items in the ASPxGridLookup control by assigning the text of selected values to the ASPxGridLookup.Text property. Note that you should assign it according to the text format that you set in the ASPxGridLookup.TextFormatString property. The text of multiple selected rows is joined in the input using a special separator specified by the ASPxGridLookup.MultiTextSeparator property.
The image below shows the result.
<dx:ASPxGridLookup ID="gLookup" runat="server" DataSourceID="AccessDataSource1"
KeyFieldName="ProductID" TextFormatString="{1}" MultiTextSeparator=", "
ondatabound="gLookup_DataBound" SelectionMode="Multiple">
<Columns>
<dx:GridViewCommandColumn ShowSelectCheckbox="True" />
<dx:GridViewDataTextColumn FieldName="ProductID">
</dx:GridViewDataTextColumn>
<dx:GridViewDataTextColumn FieldName="ProductName">
</dx:GridViewDataTextColumn>
</Columns>
</dx:ASPxGridLookup>
protected void gLookup_DataBound(object sender, EventArgs e) {
gLookup.Text = "Chai, Chang, Ikura";
}
Protected Sub gLookup_DataBound(ByVal sender As Object, ByVal e As EventArgs)
gLookup.Text = "Chai, Chang, Ikura"
End Sub
See Also