Back to Devexpress

ASPxGridLookup.MultiTextSeparator Property

aspnet-devexpress-dot-web-dot-aspxgridlookup-fd97358b.md

latest5.0 KB
Original Source

ASPxGridLookup.MultiTextSeparator Property

Gets or sets a separator that is used within the editor’s input box to divide text that corresponds to multiple selected rows.

Namespace : DevExpress.Web

Assembly : DevExpress.Web.v25.2.dll

NuGet Package : DevExpress.Web

Declaration

csharp
[DefaultValue(";")]
public string MultiTextSeparator { get; set; }
vb
<DefaultValue(";")>
Public Property MultiTextSeparator As String

Property Value

TypeDefaultDescription
String";"

A string representing a separator.

|

Remarks

When multiple selection is used (the ASPxGridLookup.SelectionMode property is set to GridLookupSelectionMode.Multiple), the text of multiple selected rows are joined in the input, using a special separator defined by the MultiTextSeparator property.

See Selection Modes to learn more.

Example

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.

aspx
<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>
csharp
protected void gLookup_DataBound(object sender, EventArgs e) {
     gLookup.Text = "Chai, Chang, Ikura";
}
vb
Protected Sub gLookup_DataBound(ByVal sender As Object, ByVal e As EventArgs)
     gLookup.Text = "Chai, Chang, Ikura"
End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the MultiTextSeparator property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-how-to-display-an-enumeration-property-as-a-drop-down-box-with-check-boxes/CS/E689.Module.Web/Editors/ASPxEnumPropertyEditorEx.cs#L34

csharp
lookupEdit.KeyFieldName = LookupValueColumnName;
lookupEdit.MultiTextSeparator = ", ";
lookupEdit.AllowUserInput = false;

xaf-how-to-display-an-enumeration-property-as-a-drop-down-box-with-check-boxes/VB/E689.Module.Web/Editors/ASPxEnumPropertyEditorEx.vb#L33

vb
lookupEdit.KeyFieldName = LookupValueColumnName
lookupEdit.MultiTextSeparator = ", "
lookupEdit.AllowUserInput = False

See Also

TextFormatString

SelectionMode

Selection Modes

ASPxGridLookup

ASPxGridLookup Class

ASPxGridLookup Members

DevExpress.Web Namespace