RadGridView

6 posts, 0 answers
  1. Kishor
    Kishor avatar
    4 posts
    Member since:
    Apr 2019

    Posted 01 Apr Link to this post

    Hello

    I am Working on a radgridView

    My requirement is, i need to find which keyboard key is pressed in radGrideview CellEndEdit Event, Or

  2. Shanti v Shaji
    Shanti v Shaji avatar
    13 posts
    Member since:
    Jun 2016

    Posted 02 Apr in reply to Kishor Link to this post

    hi kishor , am also looking for this solution
  3. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3284 posts

    Posted 04 Apr Link to this post

    Hello,    

    RadGridView manages user mouse and keyboard input over its rows by GridRowBehavior. Depending on the row type, RadGridView introduces different behaviors. Additional information about the row behavior and how to plug into it is available in the following help article: https://docs.telerik.com/devtools/winforms/controls/gridview/rows/row-behaviors

    However, if you need to detect keyboard events while the editor in RadGridView is activated, please refer to the following article: https://docs.telerik.com/devtools/winforms/controls/gridview/editors/handling-editors'-events

    I hope this information helps. 

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  4. Kishor
    Kishor avatar
    4 posts
    Member since:
    Apr 2019

    Posted 05 Apr in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Thank you for your response,

     

    But My Actual requirement is , When i press Esc Key  in an editable RadGridview Cell , i need to show some message, but the problem is when i press Esc Key CellEditorInitialized event is not triggering and the Whole data in the Cell gets cleared and Cell goes to editmode false.

    Is there any other way to detect the Esc key press.

     

    Thanks in advance

     

     

     

  5. Dess | Tech Support Engineer, Sr.
    Admin
    Dess | Tech Support Engineer, Sr.  avatar
    3284 posts

    Posted 08 Apr Link to this post

    Hello, Kishor,  

    Pressing the Escape key will abort the edit operation and the changes will be rejected. It is desired behavior. You can plug into this behavior by creating a custom GridDataRowBehavior and overriding its ProcessEscapeKey method. You can find below a sample code snippet demonstrating how to show a message box after the default logic for processing the Escape key has already been executed. It is up to you whether the default logic will be performed and what exactly to performed according to the requirements that you have: 

    public RadForm1()
    {
        InitializeComponent();
         
        //register the custom row  behavior
        BaseGridBehavior gridBehavior = radGridView1.GridBehavior as BaseGridBehavior;
        gridBehavior.UnregisterBehavior(typeof(GridViewDataRowInfo));
        gridBehavior.RegisterBehavior(typeof(GridViewDataRowInfo), new CustomGridDataRowBehavior());
    }
     
    public class CustomGridDataRowBehavior : GridDataRowBehavior
    {
        protected override bool ProcessEscapeKey(KeyEventArgs keys)
        {
            //execute the basic logic
            bool result = base.ProcessEscapeKey(keys);
     
            RadMessageBox.Show("Escape key is pressed");
             
            return result;
        }
    }

    I hope this information helps.

    Regards,
    Dess | Tech Support Engineer, Sr.
    Progress Telerik
    Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
  6. Kishor
    Kishor avatar
    4 posts
    Member since:
    Apr 2019

    Posted 09 Apr in reply to Dess | Tech Support Engineer, Sr. Link to this post

    Thank you for response,

    Its Working Properly,

     

Back to Top