Home Forums WinForms controls Xceed Grid for WinForms Double tab stop

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #15229 |

    I am building a grid dynamically. I needed to build a custom WinTextBox to do some special handling of amounts for our application. I extended the Xceed WinTextBox and add it dynamically to the grid. Everything works great, except that I need to hit tab twice to get out of the text box. I use the same control on a form outside of the grid and it works OK. I have also extended the grid to treat the Enter key as a Tab key as per one of your examples. This works OK, you don’t have to hit enter twice. I’ve tried disabling the Tab stop at various levels but can’t seem to get this to work. Any help/ideas would be appreciated. Here is the code I’m using to dynamically add the text box to the grid:

    WinAmountTextBox txtBoxControl = new WinAmountTextBox();
    WinAmountCellEditorManager amountManager = new WinAmountCellEditorManager(txtBoxControl, “Text”, true, true);
    column.CellEditorManager = amountManager;
    TextViewer amountViewer = new TextViewer(txtBoxControl);
    amountViewer.TextPadding = new Xceed.UI.Margins(1, 1, 1, 5);
    column.CellViewerManager = amountViewer;

    I needed to set the TextPadding because otherwise the text was overwriting the bottom grid line.

    Imported from legacy forums. Posted by Jerry (had 2797 views)

    User (Old forums)
    Member
    Post count: 23064

    It is difficult to say what could be the problem without your CellEditorManager and WinTextBox source code.

    You can contact <a href=”mailto:support@xceedsoft.com”>support</a> for this issue. We’ll see if we can help you further.

    Imported from legacy forums. Posted by André (had 192 views)

    User (Old forums)
    Member
    Post count: 23064

    OK, I’ll do that. Just a note, I have the same problem if I insert a WinTextBox into the grid.

    Imported from legacy forums. Posted by Jerry (had 233 views)

    User (Old forums)
    Member
    Post count: 23064

    I will not get into all the details explaining the problem, but basically, the Xceed.UI.ThemedControl.ConeControl method does not work well in this case, which is why we recommend using our own Clone method. So you need to change the CreateControl method in your derived class for the following :

    protected override Control CreateControl()
    {
    return ( this.TemplateControl as WinTextBox ).Clone() as Control;
    }

    If you derive from WinTextBox to create your WinAmountCellEditorManager and you have other things to clone, you will also need to override the Clone method and add what you need to do in it.

    Imported from legacy forums. Posted by André (had 3910 views)

Viewing 4 posts - 1 through 4 (of 4 total)
  • You must be logged in to reply to this topic.