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.
Unfortunately, activation email could not send to your email. Please try again.

Filter on gridGroupingControl

Thread ID:





35616 Oct 5,2005 07:36 AM Oct 6,2005 07:28 AM Windows Forms 6
Tags: GridControl
Prathima Venkobachar
Asked On October 5, 2005 07:36 AM

Hi, I am using gridGroupingControl. I have a checkbox column in the grid. I have a requirenment to show only checked records on click of a link. I am using a Filter expression this.gridGroupingControl.DataSource.DefaultView.RowFilter = "checkbox = true"; The probelm I am facing is If I had checked three records - when I apply filter it displays only first two records.It doesn''t display the last record. We don''t want to apply filter on grid Table Descriptor.We want to apply for the datasource bound to the grid. I feel as soon I check/uncheck it is not commiting it to the grid.When I move to the next row ,I get that record. I want changes to commit as soon as I check/uncheck. Thanks in advance, Prathima

Administrator [Syncfusion]
Replied On October 5, 2005 09:47 AM

Try handling the checkbox click event and end the edit there. private void gridGroupingControl1_TableControlCheckBoxClick(object sender, GridTableControlCellClickEventArgs e) { this.gridGroupingControl1.CurrencyManager.EndCurrentEdit(); }

Prathima Venkobachar
Replied On October 6, 2005 04:53 AM

Hi, This is not working. I still ger two rows,if I had selected 3 rows. Thanks, Prathima

Administrator [Syncfusion]
Replied On October 6, 2005 05:51 AM

How do I see the problem in this sample? (use the menu item to filter the Datatable.) http://www.syncfusion.com/Support/user/uploads/GGC_CheckBox_Filter_77a79512.zip

Prathima Venkobachar
Replied On October 6, 2005 05:53 AM

Hi, I was not able to reprodune the problem. I am facing one more problem. 1.I selected 3 records. 2.Click "Selected link".It displays 3 records. 3.I uncheck one record and click on the Show All link, I get "object reference not set to an instance". Pl find the attached sample. Thanks, Prathima GGC_CheckBox_2790.zip

Administrator [Syncfusion]
Replied On October 6, 2005 06:20 AM

You can avoid this problem by applying the changes directly to the datatable.
private void SyncfusionGridControl_TableControlCheckBoxClick(object sender, GridTableControlCellClickEventArgs e) {

	GridTableCellStyleInfo style = e.TableControl.GetTableViewStyleInfo(e.Inner.RowIndex, e.Inner.ColIndex);
	int index = e.TableControl.Table.FilteredRecords.IndexOf(style.TableCellIdentity.DisplayElement.GetRecord() as GridRecord);
	if(index > -1)
		this.dt.DefaultView[index]["Col0"] = ! (bool)this.dt.DefaultView[index]["Col0"];
		e.Inner.Cancel = true;

Prathima Venkobachar
Replied On October 6, 2005 07:28 AM

It works fine. Thanks a lot !! Prathima


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.

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.