Hi,
>>> 1) If I click on the empty area of the grid, the selection, if any, should be removed.
You can handle the Click event of the grid control and clear the selection using Model.Selection.Clear method when the empty area is clicked. Here is a code snippet
private void gridControl1_Click(object sender, EventArgs e)
{
GridControl grid = sender as GridControl;
Point pt = grid.PointToClient(MousePosition);
int row ,col;
grid.PointToRowCol(pt,out row,out col);
if( row > dt.Rows.Count || row == -1 || col == -1)
grid.Model.Selections.Clear(true);
}
>>>2) I want to always show an empty row at the end of the grid.
There is a property to control the display of the Empty rows in a grid. you can use below code to display empty rows in a grid
this.gridControl1.Model.Options.DisplayEmptyRows = true;
>>>3)The back color of the grid (even the empty area) should be set to 'SystemColors.Window'. The BackColor on the grid doesn't help as the color of the empty area is still 'Control' color.
Try setting the Properties.BackgroundColor to set the color of the area below the last row and right of last column inside the grid window.
this.gridControl1.Properties.BackgroundColor = Color.Red;
Please refer the attached sample for implementation.
VirtualGC.zipBest Regards,
Haneef