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

Cannot tab in an essential grid control.

Can some one help me with tabbing feature in grid control. I populate the grid programmatically and I have tried the following :
this.gridControl.Model.Options.WrapCellBehavior = GridWrapCellBehavior.WrapRow

But it does not work. Thanks in advance.

12 Replies

AD Administrator Syncfusion Team January 9, 2007 08:30 PM UTC

The property you listed should allow for tabbing between rows. Here is a little sample showing it working.

http://www.syncfusion.com/Support/user/uploads/WindowsApplication59_966f5f33.zip

Some things to check in your code include whether you have cell properties like style.Enabled = false; or grid.Enabled = false. If so, this will interfere with this tabbing behavior. Also, there are events that might affect this behavior like CurrentCellActivating, QueryNextCurrentcell, CurrentcellMoving, etc. If you can post a sample showing the problem, we can try to spot what is going wrong.


AD Administrator Syncfusion Team January 9, 2007 09:15 PM UTC

Thank you for the quick response. I have a combo boxes and a grid control on my form. The user selects from a combo box and the grid is populated with data to be edited. Some of the cells are read only. But that's all the property I set.

I initialize the grid with the following
// Set grid column headers
this.grdTarget[0, 1].Text = "Symbol";
this.grdTarget[0, 2].Text = "Spread Ratio";
this.grdTarget[0, 3].Text = "Order Ratio";


// set target grid row one, column 2 and 3 to default readonly values

this.grdTarget[1, 2].Text = "1";
this.grdTarget[1, 2].BackColor = Color.LightGray;
this.grdTarget[1, 2].ReadOnly = true;

this.grdTarget[1, 3].Text = "1";
this.grdTarget[1, 3].BackColor = Color.LightGray;
this.grdTarget[1, 3].ReadOnly = true;


this.grdTarget[2, 2].Text = "0";
this.grdTarget[2, 2].CellValueType = typeof(double);
this.grdTarget[2, 3].Text = "0";
this.grdTarget[2, 3].CellValueType = typeof(double);

this.grdTarget[3, 2].Text = "0";
this.grdTarget[3, 2].CellValueType = typeof(double);
this.grdTarget[3, 3].Text = "0";
this.grdTarget[3, 3].CellValueType = typeof(double);


//Allow tabbing in grid
this.grdTarget.Model.Options.WrapCellBehavior = GridWrapCellBehavior.WrapRow;

Not sure what I am missing. Is there a property at the grid level apart from TabStop that I need to set so it enables tabbing in the grid control? Thanks.

>Can some one help me with tabbing feature in grid control. I populate the grid programmatically and I have tried the following :
this.gridControl.Model.Options.WrapCellBehavior = GridWrapCellBehavior.WrapRow

But it does not work. Thanks in advance.


AD Administrator Syncfusion Team January 10, 2007 10:51 AM UTC

After selecting something in the combobox, are you setting the focus back to the grid? (ie, calling grid.Focus();). If not, the tab keys will not be going to the grid, but instead to the combobox.


AD Administrator Syncfusion Team January 10, 2007 02:42 PM UTC

The first time the form loads, user can tab directly to the grid to enter data. The form serves two purposes : Add/Edit. If they choose not to select anything from the combo box, they can enter data in the grid. In the scenario when the form loads and I try to tab to the grid, but I am unable to. I have tabstop property set to true and the tabindex set as well. Any help would be appreciated. Thanks.

>Can some one help me with tabbing feature in grid control. I populate the grid programmatically and I have tried the following :
this.gridControl.Model.Options.WrapCellBehavior = GridWrapCellBehavior.WrapRow

But it does not work. Thanks in advance.


AD Administrator Syncfusion Team January 10, 2007 03:14 PM UTC

So, your problem is tabbing TO the grid, not tabbing from cell to cell within the grid, correct?

And it only occurs when you first load the form, correct?

The WrapRow setting only affects the tabbing within the grid. It does not affect the tabbing to the grid.

Look real close at the top-left cell when you do the tabbing the first time. What might be happening is that this cell is getting focus when the grid gets focus from the first tabs. This is because no current cell has been set initially. So, in your form load, try setting

this.grid.ForceCurrentCellMoveTo = true;
this.grid.CurrentCell.MoveTo(1, 1);

This should make it so that when you tab into the grid the first time, you will see the focus in the grid go to cell 1,1 instead of 0,0.

If this does not explain what you are seeing, if you modify the above sample to show the problem you are having, we can debug it here.



AD Administrator Syncfusion Team January 10, 2007 03:38 PM UTC

Here's what I noticed. I cannot tab to the grid on the form, or once I manually go to a cell in the grid, I cannot move up or down using the arrows or tab from right to left. It's like this grid will not respond to any keyboard events. I can only click and enter data in the cells. I created a new test project and just dropped the grid and I can tab through it. I am not sure what property I may have changed for this behavior to occur in my project. Any ideas? I tried all the above and no luck..



AD Administrator Syncfusion Team January 10, 2007 04:24 PM UTC

Check the output window to see if you see any exceptions being thrown. If so, that might affect this behavior.

Are you handling any events like CurrentCellValidating that might be affecting whether or not you can leave the cell.

Do a search in your code for any property settings that might affect what keys the grid might accept? ( grid.WantKeys or grid.WantTabKey or ???)

What grid events are you handling? You could try commenting them out one at the time to see if any of your handlers are affecting this behavior.


AD Administrator Syncfusion Team January 11, 2007 10:09 PM UTC

Hi, thanks for the response. I had some time to look into this problem today and found out something interesting. If I set the rowHeader Property to False, I see that I can't tab in the grid control. Has anyone come across this or am I missing something? Any help will be appreciated.


AD Administrator Syncfusion Team January 12, 2007 02:50 PM UTC

Please can someone let me know how to solve the situation I mentioned earlier. Thanks.

>Can some one help me with tabbing feature in grid control. I populate the grid programmatically and I have tried the following :
this.gridControl.Model.Options.WrapCellBehavior = GridWrapCellBehavior.WrapRow

But it does not work. Thanks in advance.


AD Administrator Syncfusion Team January 13, 2007 08:37 PM UTC

To hide your row headers, use grid.Cols.Hidden[0] = true; to see if that allows the tabbing to work. Also, make sure your have a currentcell set.

If you can post a sample showing the problem, we can try to resolve it. I posted a sample in your other thread that shows the tabbing working in the situation you described.


CH chris replied to Administrator March 13, 2018 09:11 PM UTC

To hide your row headers, use grid.Cols.Hidden[0] = true; to see if that allows the tabbing to work. Also, make sure your have a currentcell set.

If you can post a sample showing the problem, we can try to resolve it. I posted a sample in your other thread that shows the tabbing working in the situation you described.

good report


SN Sindhu Nagarajan Syncfusion Team March 14, 2018 07:01 AM UTC

Hi Chris, 
  
Thanks for the update. 
Please let us know if need any assistance. 
  
Regards, 
Sindhu 


Loader.
Live Chat Icon For mobile
Up arrow icon