We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Filtering DropDown type columns

Hello,

The DropDown  edit columns cannot be filtered by the text, only by the value. I use Menu Filter mode.

Thanks!

3 Replies

JK Jayaprakash Kamaraj Syncfusion Team March 4, 2016 05:32 AM UTC

Hi Jorge,

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.



JP Jorge Pampin March 4, 2016 09:11 AM UTC

Hello,

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!


JK Jayaprakash Kamaraj Syncfusion Team March 7, 2016 09:38 AM UTC

Hi Jorge,
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>
    </div>


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.

Loader.
Live Chat Icon For mobile
Up arrow icon