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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Assign value on filter record

Thread ID:





125009 Jul 14,2016 09:54 AM UTC Jul 19,2016 06:27 AM UTC WinForms 3
Tags: GridGroupingControl
Michael K
Asked On July 14, 2016 09:54 AM UTC

Hi All :

Good day, today, I have write a code for GridGroupControl as below:

GridDynamicFilter GridDfilter = new GridDynamicFilter();

gcAcSelect.TableDescriptor.Columns["ac_Select"].MappingName = "Chk";
                gcAcSelect.TableDescriptor.Columns["ac_Select"].Appearance.AnyRecordFieldCell.CheckBoxOptions.CheckedValue = "1";
                gcAcSelect.TableDescriptor.Columns["ac_Select"].Appearance.AnyRecordFieldCell.CheckBoxOptions.UncheckedValue = "0";
                gcAcSelect.TableDescriptor.Columns["ac_pNum"].MappingName = "ProductNum";
                gcAcSelect.TableDescriptor.Columns["ac_pNum"].AllowFilter = true;
                gcAcSelect.TableDescriptor.Columns["ac_pName"].MappingName = "ProductName";
                gcAcSelect.TableDescriptor.Columns["ac_pName"].AllowFilter = true;

Above code that will show filter bar on Grid Grouping Control, then I create the 2 button which name "select all" and "clear all"
When user click select all, all filtered record will be check
The code as below
private void cmdAcAll_Click(object sender, EventArgs e)
            foreach (Record rec in gcAcSelect.TableControl.Table.Records)
                rec.SetValue("Chk", 1);

My problem is, when user click the select all button, the  unfiltered record are also be checked (i.e. Chk value = 1), how can prevent it ?

Pls advice



Piruthiviraj Malaimelraj [Syncfusion]
Replied On July 18, 2016 07:01 AM UTC

Hi Michael, 

Thanks for using Syncfusion products. 

We had analyzed your sample code. It seems that , you have used Table.Records collection to achieve your scenario. The Records collection will maintain the whole records of grid table (i.e. Filtered and unfiltered records). To achieve your scenario, FilteredRecords property of TableControl can be used. Because FilterRecords property will maintain the all the filtered records. Please make use of the below code. 

Code snippet 

private void button1_Click(object sender, EventArgs e) 
    foreach (Record rec in gridGroupingControl1.TableControl.Table.FilteredRecords
        rec.SetValue("CategoryID", 1); 

Sample link 


Michael K
Replied On July 18, 2016 08:41 AM UTC

Dear Piruthiviraj:

Your message well note with thanks


Piruthiviraj Malaimelraj [Syncfusion]
Replied On July 19, 2016 06:27 AM UTC

Hi Michael, 

Thanks for your update. 

Please let us know if you need any further assistance. 



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon