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

row and column selection

Hi, My zeroth column is hidden. I want to select the row when i clicked on the first 1st cell of the first row and change the color. I am not able to change the current color with is back. Also is there any method where if clicked on the column header whole column gets selected. On left click on the column header i am sorting the column and on right click i am displaying context menu

1 Reply

AD Administrator Syncfusion Team December 2, 2004 06:30 AM UTC

I assume you are using a grid with ListBoxSelectionMode set to something other than None. >> am not able to change the current color with is back. If you are seeing black when you select the row, then the most likely cause is that the grid.AllowSelections property does not have the AlphaBlend flag turned on. If this flag is turned on, then your selections should show as alpha-blended rectangles and not inverted cells (which are mostly black depending upon the original color). >>Also is there any method where if clicked on the column header whole column gets selected. On left click on the column header i am sorting the column and on right click i am displaying context menu So, you want to select the column when the user sorts it, is this correct? If so, try handling the CellClick event and explicitly selecting the column.
private void gridControl1_CellClick(object sender, GridCellClickEventArgs e)
{
	if(e.RowIndex == 0)
	{
		this.gridControl1.Selections.Add(GridRangeInfo.Col(e.ColIndex));
	}
}

Loader.
Live Chat Icon For mobile
Up arrow icon