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

Filter on gridGroupingControl

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

6 Replies

AD Administrator Syncfusion Team October 5, 2005 01:47 PM UTC

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


PV Prathima Venkobachar October 6, 2005 08:53 AM UTC

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


AD Administrator Syncfusion Team October 6, 2005 09:51 AM UTC

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


PV Prathima Venkobachar October 6, 2005 09:53 AM UTC

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


AD Administrator Syncfusion Team October 6, 2005 10:20 AM UTC

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

	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;
	}
}


PV Prathima Venkobachar October 6, 2005 11:28 AM UTC

It works fine. Thanks a lot !! Prathima

Loader.
Live Chat Icon For mobile
Up arrow icon