Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
530
AllowAddNew behavior
posted

I've been playing around with the AllowAddNew enumerations and can't quite find one that works like I want.  I simply want a template row that the user can type into.  After tabbing off of the last column, I want the row to be added to the grid and the cursor to be sitting in the first column of the template row, waiting for more input. 

The TemplateOnTopWithTabRepeat comes close, but when I type my first character into the template row it creates a blank row in the grid and the data entry happens there.  Why can't the data entry just happen in the template row itself without creating this second row?  Is there a property that would influence this behavior?

  • 30
    Offline posted

    I found a workaround that may help:

    If you use FixedAddRowOnTop instead of TemplateOnTopWithTabRepeat, you can create the behavior you want by checking for the Tab key on the last column of your grid.  Here's an example:

    private void ultraGrid1_KeyPress(object sender, KeyPressEventArgs e)

    {

    if ( e.KeyChar == (char)Keys.Tab

    && this.ultraGrid1.ActiveCell == this.ultraGrid1.ActiveCell.Row.Cells["LastColumnKeyHere"]

    && this.ultraGrid1.ActiveCell.Row.IsAddRow == true )

    {

    this.ultraGrid1.ActiveCell.Band.AddNew();

    }

    }

     This seems to work for me and hope it helps you.

     Chris

  • 30
    Offline posted

    I'm having the same trouble.  As soon as the Cell is activated in the template row, I want an UltraDropDown control to drop down so the user can begin typing in letters to use the AutoEdit feature of the UDD.  I'm attaching an UDD control to the ValueList of my first column in the grid. But as soon as I type in the first letter, a blank row is added to the grid just below the template and the template drop down list is now covering the new rowl  So I have to close the drop down from the template row and then click the drop down on the cell below in the newly added row (currently the IsAdd row).

     

  • 530
    Offline posted

    Nobody?  Surely I'm not the only one who is looking for this type of behavior.