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.
Unfortunately, activation email could not send to your email. Please try again.

Why GCC can't be focused?

Thread ID:

Created:

Updated:

Platform:

Replies:

132651 Sep 14,2017 02:05 AM Sep 15,2017 08:13 AM Windows Forms 3
loading
Tags: GridGroupingControl
Hartono
Asked On September 14, 2017 02:05 AM

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

Arulpriya Ramalingam [Syncfusion]
Replied On September 14, 2017 04:57 AM

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   


Hartono
Replied On September 14, 2017 10:32 PM

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

Arulpriya Ramalingam [Syncfusion]
Replied On September 15, 2017 08:13 AM

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  


CONFIRMATION

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.

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.

;