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

Sort the data in Grid Control based on Display member.

Hi.
In my Grid i have a Combobox control in one column and it has some display member with 
OneNumber - Name (For e.x in my case VendorNumber - Vendor Name).
Now when i tried to sort on the column i have assigned the property of "sort" option with display member of the column. 
Could you help me in sorting the column with an another option other than 
"Display member and Value member".?

5 Replies

RB Ragamathulla B Syncfusion Team April 5, 2013 06:32 AM UTC

Hi Saikrishna,

Thank you for your interest in Syncfusion products.

Please refer to the following dashboard sample path which is helpful for your reference. In our grid control have not inbuilt support for sort but we have achieved by manually.

Grid Control:

{Installed path}\Syncfusion\EssentialStudio\{Version}\Windows\Grid.Windows\Samples\2.0\Grid Layout\Sorting Demo\CS

GridGroupingControl:

{Installed path}\Syncfusion\EssentialStudio\{Version}\Windows\Grid.Grouping.Windows\Samples\2.0\Filters and Expressions\Filter By DisplayMember Demo\CS

Let me know if you have any further concerns.

Regards,

Ragamathullah B.



SA Saikrishna April 10, 2013 01:32 AM UTC

Hi.
I found that I have to use currency manager to sort the column based on Display member. It will work only if the display member should also be a column in the gridDataBoundGrid control. (i.e it should get in the dataview from the currency manager list property).
In my case there are nearly 20-25 combo boxes are there in my grid. Now to sort on those columns I should manually add those 20-25 columns to the grid unnecessarily to sort based on the respective column.
Please let me know is there any possibility to get the both display member and value members in the dataview of the gridDataBoundGrid  control from the currency manager.
Or let me know another approach to sort the column without adding another column with display member of each column separately.



AS Athiram S Syncfusion Team April 15, 2013 09:02 AM UTC

Hi SaiKrishna,

Sorry for the delay in getting back to you.

You can achieve the sorting by using display member from the sample:

<Installed Location of EssentialStudio>\<Installed version>\Windows\GridDataBound.Windows\Samples\2.0\Sorting\Sort By DisplayMember Demo\

Please let me know if you have any concerns.

Regards,
Athiram S


SG Sergii Golik December 19, 2014 06:33 PM UTC

Hi,
Could you help to find similar decision for GridExcelFilter ?


MK Muthukumar Kalyanasundaram Syncfusion Team December 21, 2014 05:29 PM UTC

Hi Sergii,

 

Thanks for the update.

 

If you want to set the Excel filter in a grid, you can use the GridExcelFilter class and wire the grid. Please refer the below code,

 

Code:

private GridExcelFilter filter;

// form load

filter = new GridExcelFilter();

this.gridGroupingControl1.TopLevelGroupOptions.ShowFilterBar = true;

for (int i = 0; i < gridGroupingControl1.TableDescriptor.Columns.Count; i++)

{

gridGroupingControl1.TableDescriptor.Columns[i].AllowFilter = true;

}

filter.WireGrid(this.gridGroupingControl1);

 

Please let us know if you have any concern.

 

Regards,

Muthukumar K

 


Attachment: MyExcelFilter_de4e4c19.zip

Loader.
Live Chat Icon For mobile
Up arrow icon