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

Covered Range and Activate

Hi,

we are using a GGC which is bound to a business object. I have a covered AddNewRecord row and I want to focus the whole row when I move the cursor to this row. With focus I mean the black thin border around the cell.

I have attached a sample where you can see the behavior. The grid has three columns. When you click in a cell of the last column and move the cursor to the AddNewRecord row (with the cursor keys) - The AddNewRecord row seems to be not getting active (black thin border). But it is. When you click in a cell of the first column and move to the AddNewRecord row (with the cursor key). Then the whole row gets active (thin black border). I want this behavior when I move to the AddNewRecord row from another column too.

How can I achieve this?

Cheers,
Markus

GridCoveredRangeProblem.zip

2 Replies

FG Franz Gsell July 26, 2007 11:27 AM UTC

Hi,

what I forgot to mention, I have another strange issue. With this attached sample you can see that when you click in the AddNewRecord row (in the last column) a new item is added. When you click in the AddNewRecord row (last column) again - the mouse click event doesn't get fired. What's wrong here.

This is just an addition to the issue mentioned one posting before. Perhaps you can help me with these two issues.

Cheers,
Markus

GridCoveredRangeProblem0.zip


SA Saravanan A Syncfusion Team July 27, 2007 06:01 PM UTC

Hi Markus,

Both the issues mentioned can be solved by specifying the Covered range in QueryCoveredRange event whenever it is fired for any of the cells in that covered range.

Here is the modified code snippet.

void gridGroupingControl1_QueryCoveredRange(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableQueryCoveredRangeEventArgs e)
{
if (e.RowIndex < e.Table.DisplayElements.Count)
{
Element el = e.Table.DisplayElements[e.RowIndex];
if (el.Kind == DisplayElementKind.AddNewRecord)
{
if (e.ColIndex >= 1 && e.ColIndex <= gridGroupingControl1.TableDescriptor.VisibleColumns.Count)
{
GridRangeInfo range = gridGroupingControl1.Table.GetElementRangeInfo(el);
int count = gridGroupingControl1.TableDescriptor.VisibleColumns.Count;
e.Range = GridRangeInfo.Cells(range.Top, 1, range.Bottom, count);
e.Handled = true;
}
}
}
}


Regards,
Saravanan

Loader.
Live Chat Icon For mobile
Up arrow icon