Virtual Grid - Issues when changing the cell editor

5 posts, 0 answers
  1. Saji
    Saji avatar
    13 posts
    Member since:
    Mar 2016

    Posted 06 Dec 2016 Link to this post

    Hello, We are licensed customer of Telerik. I am using telerik winforms library version 2016.3.1024.20. I am faced with a problem, as described below.

    In the Virtualgrid's EditorRequired event, for a particular cell, I changed the default editor to a new editor like below.

            private void Grid_EditorRequired(object sender, VirtualGridEditorRequiredEventArgs e)
            {
                switch (e.ColumnIndex)
                {
                    case 0:
                        {

                            VirtualGridTextBoxControlEditor editor = new VirtualGridTextBoxControlEditor();
                            editor.CharacterCasing = CharacterCasing.Upper;
                            e.Editor = editor;
                        }
                        break;
              }

         }

    What happens now is, when I click on the cell, the cell becomes editable, and I can type in it, but I cannot backspace on the cell to delete the characters entered. In addition to that I don't even get the CellValidating event. Besides, the KeyUp event on editor's element (RadTextBoxControlElement) is also not fired.

    Could you please help me out? This is urgent because I am running into a pre-Christmas release.

    Thank you,

    Saji Antony

  2. Dimitar
    Admin
    Dimitar avatar
    2658 posts

    Posted 07 Dec 2016 Link to this post

    Hi Saji,

    Thank you for writing.

    I was not able to reproduce the observed behavior on my end. For convenience, I prepared a small sample, based on the information that you provided so far and attached it to this thread. Could you please check it and let me know how it differs from your real setup? 

    Thank you in advance for your patience and cooperation. 

    Regards,
    Dimitar
    Telerik by Progress
    Telerik UI for WinForms is ready for Visual Studio 2017 RC! Learn more.
  3. Saji
    Saji avatar
    13 posts
    Member since:
    Mar 2016

    Posted 07 Dec 2016 in reply to Dimitar Link to this post

    Hi Dimitar, 

    Thank you for the quick response. I have the same problem while running your example code as well. I can't backspace in the textbox, Is this a known problem in version x.2040.20  ? I didn't test the keyup event, but I am certain, but by looking at the situation, it may also not be firing up.

    Thank you,

    Saji

  4. Saji
    Saji avatar
    13 posts
    Member since:
    Mar 2016

    Posted 07 Dec 2016 Link to this post

    The image attached shows that I ran your sample project.
  5. Dimitar
    Admin
    Dimitar avatar
    2658 posts

    Posted 08 Dec 2016 Link to this post

    Hello Saji,

    I was able to reproduce this issue, it appears that the events are handled in the VirtualGrid and are not forwarded to the editor. I have logged this issue in our Feedback Portal. I have added a vote for it on your behalf as well. You can track its progress, subscribe for status changes and add your comment to it here. I have also updated your Telerik Points.

    To workaround this you need to create a custom control and override the following methods:
    class MyGrid : RadVirtualGrid
    {
        protected override void OnKeyDown(KeyEventArgs e)
        {
            base.OnKeyDown(e);
     
            if (this.ActiveEditor is VirtualGridTextBoxControlEditor)
            {
                var editor = this.ActiveEditor as VirtualGridTextBoxControlEditor;
                var element =   editor.EditorElement as RadTextBoxControlElement;
                element.InputHandler.ProcessKeyDown(e);
            }
        }
        protected override void OnKeyUp(KeyEventArgs e)
        {
            base.OnKeyUp(e);
     
            if (this.ActiveEditor is VirtualGridTextBoxControlEditor)
            {
                var editor = this.ActiveEditor as VirtualGridTextBoxControlEditor;
                var element = editor.EditorElement as RadTextBoxControlElement;
                element.InputHandler.ProcessKeyUp(e);
            }
        }
    }

    Should you have any other questions do not hesitate to ask.

    Regards,
    Dimitar
    Telerik by Progress
    Telerik UI for WinForms is ready for Visual Studio 2017 RC! Learn more.
Back to Top