- Home
- Forum
- ASP.NET Web Forms
- Filtering DropDown type columns
Filtering DropDown type columns
The DropDown edit columns cannot be filtered by the text, only by the value. I use Menu Filter mode.
Thanks!
Please share the following and some more information to find the cause of the issue and provide a prompt solution
1. Are you using foreign key column?
2. Do you want to save dropdown text value while editing?
3. Attach a screenshot of the issue.
4. Do you want to filter the dropdown column based on text value?
5. A sample if possible, or a sample hosted link.
6. Client and server side codes of the sample.
Regards,
Jayaprakash K.
I want to filter the dropdown column based on text value. This is the code to load the columna data:
Column.EditType = Syncfusion.JavaScript.EditingType.Dropdown;
List<SAVECommon.Entidades.EntCosteFijoVariable> Datos = new
List<SAVECommon.Entidades.EntCosteFijoVariable>(); Column.DataSource = (IEnumerable)Datos;
Datos .Add(new SAVECommon.Entidades.EntCosteFijoVariable() {value='0', text = ''});
Datos .Add(new SAVECommon.Entidades.EntCosteFijoVariable() {value='1', text = 'Fijo'});
Datos .Add(new SAVECommon.Entidades.EntCosteFijoVariable() {value='2', text = 'Variable'});
Column.DataSource = (IEnumerable)Datos;
Column.DefaultValue = Datos[0].text;
Thanks!
Query: I want to filter the dropdown column based on text value
We suggest you to use foreign key column to filter the dropdown column based on the text value. Data field and text can be set using foreignKeyField and foreignKeyValue properties of columns. Please refer to the following code example, Help documentation and sample.
Code Example:
|
<ej:Grid ID="Grid1" AllowSorting="true" AllowPaging="True" AllowFiltering="True" AllowMultiSorting="false" runat="server"> <Columns> <ej:Column Field="OrderID" HeaderText="Order ID" IsPrimaryKey="true" TextAlign="Right" Width="90" /> <ej:Column Field="CustomerID" HeaderText="Customer ID" Width="100" /> <ej:Column Field="EmployeeID" HeaderText="Employee ID" ForeignKeyField="value" ForeignKeyValue="text" EditType="Dropdown" TextAlign="Right" Width="110" /> <ej:Column Field="Freight" HeaderText="Freight" TextAlign="Right" Width="90" Format="{0:C}" /> <ej:Column Field="OrderDate" HeaderText="Order Date" Width="100" TextAlign="Right" Format="{0:MM/dd/yyyy}" /> <ej:Column Field="ShipCity" HeaderText="Ship City" Width="100" /> </Columns> <PageSettings PageSize="15" /> <EditSettings AllowEditing="True" AllowAdding="True" AllowDeleting="True"></EditSettings> <ToolbarSettings ShowToolbar="True" ToolbarItems="add,edit,delete,update,cancel"></ToolbarSettings> <FilterSettings FilterType="Menu"></FilterSettings> </ej:Grid> |
Help Documentation: http://help.syncfusion.com/aspnetmvc/grid/columns?cs-save-lang=1&cs-lang=razor#foreign-key-column
Sample: http://www.syncfusion.com/downloads/support/forum/123277/ze/SyncfusionASPNETApplication13181113996
Regards,
Jayaprakash K.
- 3 Replies
- 2 Participants
-
JP Jorge Pampin
- Mar 3, 2016 08:40 AM UTC
- Mar 7, 2016 09:38 AM UTC