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

programatic way to filter in grid control (databound and grid)

hi. i''m looking for a sample or description of how i can affect filtering on a grid programatically. what i have is a master data set from which i am building multiple grid views. i have a SQL like wizard that allows the user to customize the view at which point i will build the grid behind the scenes. user example: select col1, col2, col3 where col4 > 0 and col5 = ''ABC'' group by col1 here i want to instantiate a grouping grid hide/unhide certain columns, group by and filter programatically. thanks-

1 Reply

AD Administrator Syncfusion Team November 17, 2004 08:01 PM UTC

There is no grouping functionality n our GridDataBoundGrid. If you need grouping, you should use the GridGroupingControl. To group by a "State" column, use code like this.gridGroupingControl1.TableDescriptor.GroupedColumns.Add("State"); To see only certain columns, add only those columns to the Columns collections. this.gridGroupingControl1.TableDescriptor.Columns.Add("State"); this.gridGroupingControl1.TableDescriptor.Columns.Add("City"); To filter, use code like: this.gridGroupingControl1.TableDescriptor.RecordFilters.Add("City", FilterCompareOperator.Like, "B*");

Loader.
Live Chat Icon For mobile
Up arrow icon