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.
Syncfusion Feedback

Virtual Grid issues

Thread ID:

Created:

Updated:

Platform:

Replies:

54054 Dec 28,2006 02:12 PM UTC Dec 29,2006 04:49 AM UTC Windows Forms 1
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On December 28, 2006 02:12 PM UTC

I have three issues in case of readonly virtual grid:

1) If I click on the empty area of the grid, the selection, if any, should be removed.
2) I want to always show an empty row at the end of the grid.
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.

How do I fix the above issues? Thanks.

*Empty area refers to that part of the grid that is outside of all the cells.

Administrator [Syncfusion]
Replied On December 29, 2006 04:49 AM UTC

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.zip

Best Regards,
Haneef

CONFIRMATION

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.

Warning Icon 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.Close Icon

;