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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridGroupingControl - Focus changes to first column on start up

Thread ID:





47551 Aug 8,2006 09:55 AM UTC Aug 14,2006 08:39 AM UTC WinForms 8
Tags: GridControl
Clive Hill
Asked On August 8, 2006 09:55 AM UTC

I use GridGroupingControl, and have this control displayed in a Window that doesn''t show the whole grid. When I first load my application and click on a CheckBox column the first record column appears selected, and within TableControlCheckBoxClick when I do:

GridCurrentCell cc = _dataGrid.TableControl.CurrentCell;

the cc.ColIndex refers to the first data column rather than to the column I actually clicked on.

The same happens when I click on a ComboBox column which isn''t initially shown to the window (i.e. havwe to scroll right to view and then click). With a ComboBox that is initially viewable this doesn''t occur.

Any ideas?

I''m using

Administrator [Syncfusion]
Replied On August 8, 2006 10:45 AM UTC

Hi Vito,

You can use this code snippet to get the colIndex of the checkbox column when the checkbox is clicked.

private void grid_TableControlCheckBoxClick(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellClickEventArgs e)
Console.WriteLine("CheckBox Column Index:" + e.Inner.ColIndex);

//For ComboBox cell column Index when the Button is clicked

private void grid_TableControlCellButtonClicked(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCellButtonClickedEventArgs e)
Console.WriteLine( "combo column Index:" + e.Inner.ColIndex);

Let me know if this helps.

Clive Hill
Replied On August 8, 2006 12:24 PM UTC

It seems from what you say that I should avoid using TableControl.CurrentCell as this might not be set to the actual CurrentCell. In one of the ComboBox columns I need to get the Renderer as GridComboBoxCellRenderer so that I can do:


I was getting the Renderer from GridCurrentCell, by cc.Renderer, but if this isn''t safe, can you recommend a way to get this from parameters of TableControlCurrentCellCloseDropDown, i.e.


Administrator [Syncfusion]
Replied On August 9, 2006 11:27 AM UTC

Hi Vito,

If you set the property ActivateCurrentCellBehavior to ClickOnCell then the cell gets activated after clicking on it. To move the current cell in checkbox click/cellclick event , you need to use the CurrentCell.MoveTo method.


To get the currentcell renderer, you can use the e.TableControl.CurrentCell.Renderer property.

To get the particular cell renderer, you can use the GetCellRenderer method in Tablecontrol. Please find the code snippet below.

//For CheckBox click event.


Clive Hill
Replied On August 9, 2006 05:38 PM UTC

Thanks Haneef. Can you tell me where ActivateCurrentCellBehavior property is for a GridGroupingControl grid? I had a look through properties of various objects under GGC and can''t find this.

Administrator [Syncfusion]
Replied On August 10, 2006 04:15 AM UTC

Hi Vito,

Please find the ActivateCurrentCellBehavior property from TableModel.Options. Here is a code snippet.

//Default setting is ClickOnCell.
this.grid.TableModel.Options.ActivateCurrentCellBehavior = GridCellActivateAction.ClickOnCell;


Clive Hill
Replied On August 10, 2006 07:55 AM UTC

That seems to have worked - thanks Haneef

Clive Hill
Replied On August 10, 2006 03:13 PM UTC


The problem is fixed in every scenario I''ve tested except:

on start up of application, if a column with ComboBox is initially out of view, the user scrolls horizontally until it is in view and then clicks to change value.

When this occurs GridTableCellStyleInfoIdentity does not seem to be correctly inialized. I obtain this by:

GridTableCellStyleInfoIdentity style = _dataGrid.TableModel[comboBoxRowIndex, comboBoxColIndex].TableCellIdentity;

style doesn''t have DisplayElement.ParentRecord or Column defined.

I can get a reference to the current record doing:

rec = (Syncfusion.Grouping.Record)e.TableControl.Table.CurrentRecord;

instead, is there a way to get reference to the current column mapping name, without using style.Column.Name ?

I tried doing:

GridColumnDescriptor gcd = e.TableControl.Table.GetColumnDescriptorAt(comboBoxRowIndex, comboBoxColIndex);

but gcd is undefined.

Administrator [Syncfusion]
Replied On August 14, 2006 08:39 AM UTC

Hi Vito,

Please try the attached sample that works fine on my system which has "Essential Studio 4.2 +.Net FrameWork 1.1/2.0+windows XP" installed . Let us know if you face any other issues.

Here is a sample

Best Regards,


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

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