Why GCC can't be focused?
Dear All,
I have two control, Textbox with tabindex = 0, and GCC with tabindex = 1.
When I press Tab key from textbox, GCC was not focused. What setting that I missed ?
And what parameter that the selected row back color is gray when GCC lost focused ?
I've tried for a day.. can not find any soulution..
Thank you.
Best regards,
Hartono
SIGN IN To post a reply.
3 Replies
AR
Arulpriya Ramalingam
Syncfusion Team
September 14, 2017 08:57 AM UTC
Hi Hartono,
Thanks for your interest in Syncfusion products.
By default, the current cell and focus will be moved to next cell when the Tab key is pressed in GridGroupingControl. In order to move the focus to next control from the grid when Tab key is pressed, the WantTabKey property can be set to false.
Code example
|
//To disable tab key behavior within the grid
this.gridGroupingControl1.WantTabKey = false; |
The GotFocus event of GridTableControl can be used to identify that whether the grid got focus or not. Please make use of below code and sample,
Code example
|
//Event subscription
this.gridGroupingControl1.TableControl.GotFocus += GridGroupingControl1_GotFocus;
//Customizing the event
private void GridGroupingControl1_GotFocus(object sender, EventArgs e)
{
Console.WriteLine("Control got focus");
} |
Note
By default, the current cell border will be set to gray color when the control lost focus.
Regards,
Arulpriya
HA
Hartono
September 15, 2017 02:32 AM UTC
Thanks Arulpriya,
Here I attach the screen recording shows GGC could not be focused then previous control pressed tab key.
Generally, the first row should be highlighted when focused.
What parameter that I missed ?
Thank you.
Hartono
Attachment: ggc_93e8b5d2.zip
AR
Arulpriya Ramalingam
Syncfusion Team
September 15, 2017 12:13 PM UTC
Hi Hartono,
Thanks for your update.
We could understand your scenario. By default, while loading the grid the CurrentCell will be at (-1,-1) index. In order to move the current cell focus to first row, MoveTo() method of GridCurrentCell can be used in GotFocus event. Please make use of below code and sample,
Code example
|
//Event subscription
this.gridGroupingControl1.TableControl.GotFocus += GridGroupingControl1_GotFocus;
//Event Customization
private void GridGroupingControl1_GotFocus(object sender, EventArgs e)
{
if(this.gridGroupingControl1.TableControl.CurrentCell.RowIndex == -1)
{
int topRowIndex = this.gridGroupingControl1.TableControl.TopRowIndex;
//To move the currentCell to top record row
this.gridGroupingControl1.TableControl.CurrentCell.MoveTo(topRowIndex, 1);
}
} |
Please let us know if you have any other query.
Regards,
Arulpriya
SIGN IN To post a reply.
- 3 Replies
- 2 Participants
-
HA Hartono
- Sep 14, 2017 06:05 AM UTC
- Sep 15, 2017 12:13 PM UTC