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
close icon

Row selection row problems

Hi, I'm having GDBG. first user makes a selection. and there is another button, which shuld de-select the current row. but still the arrow icon is in the grid. its not deselecting also. Also, how to get the all the selected rows? (multiple row selection). Many Thx for help Ram

1 Reply

AD Administrator Syncfusion Team April 24, 2003 02:38 PM UTC

The arrow icon in the row marks the Position property of the CurrencyManager for the grid's datasource. If you really want to remove it, one way would be to handle PrepareViewStyleInfo and set the celltype to the standard header type that does not provide this icon. You could have a property in your form that indicates whether to show the icon or not, an dthen set this property in your button handler. In prepareViewStyleInfo, you would check this property as one of your conditions.
private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)
{
	if(e.ColIndex == 0 && this.dontShowIcon)
	{
		e.Style.CellType = "Header";
	}
}
Are you using ListBoxSelectionMode? This mode in conjuction with the CurrencyManager.Position property could explain why the row will not 'unselect'. Here is a little loop that shows all row selections. If you are using other kinds of selections, there is more work to be done.
foreach(GridRangeInfo r in gridControl1.Selections.Ranges) 
for(int row = r.Top; row <= r.Bottom; row++)
	Console.WriteLine("hit on row " + row);

Loader.
Live Chat Icon For mobile
Up arrow icon