This is a migrated thread and some comments may be shown as answers.

Virtual Grid - Issues when changing the cell editor

4 Answers 69 Views
VirtualGrid
This is a migrated thread and some comments may be shown as answers.
Saji
Top achievements
Rank 1
Saji asked on 06 Dec 2016, 09:21 PM

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

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 07 Dec 2016, 09:22 AM
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.
0
Saji
Top achievements
Rank 1
answered on 07 Dec 2016, 01:22 PM

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

0
Saji
Top achievements
Rank 1
answered on 07 Dec 2016, 03:34 PM
The image attached shows that I ran your sample project.
0
Dimitar
Telerik team
answered on 08 Dec 2016, 08:54 AM
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.
Tags
VirtualGrid
Asked by
Saji
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Saji
Top achievements
Rank 1
Share this question
or