I am using DataboundGrid in 126.96.36.199 VS.NET 2003/XP. While tabbing through all the fields in a form, if I enter a data bound grid that is empty, it is getting stuck.
1. Run the attached sample.
2. Hit tab key 4 times. This will put you in the grid. Now you are stuck in the grid and can not get out using keyboard.
3. If you click ''Add some data'' button and then tab twice, I don''t see the focus. But again hitting tab puts you in grid cell R1C1.
4. Click ''Clear data'' and hit tab. Notice that the focus is gone and you can not get out of grid using keyboard.
Any ideas on how to avoid this?
ADAdministrator Syncfusion Team June 3, 2004 08:42 AM
Initially, try setting:
this.gridDataBoundGrid1.WantTabKey = false;
Then when the datasource is populated with some rows, set it to:
this.gridDataBoundGrid1.WantTabKey = true;
ADAdministrator Syncfusion Team June 8, 2004 09:46 AM
It will be hard to know when the datasource is being set. Sometimes the user may delete all the rows in the grid. Sometimes the grid gets emptied out in a master-detail scenario.
I added ''Enter'' event handler to see if the grid has any data. If not, I am setting WantTabKey to false. So, toggling WantTabKey is kind of hard todo throughout the application.
Is there any other way?
ADAdministrator Syncfusion Team June 8, 2004 10:56 AM
You can try dynamcially setting it in an override of ProcessCmdKey when a tab comes in.