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
90
Insert via UltraGrid?
posted

Hello every1 im new to this forum and this is my first time using the ultrgrid and im loving it,

the thing is i want the user to be able to insert using the ultra grid so i have a new button

and a save button, the ultragrid is bound to a datable btw

Here is the code of the new button:

private void NuevoB_Click(object sender, EventArgs e)
        {
          
            this.oDataTable.Rows.Add();
            
            
            for (int i = 0; i < this.ultraGrid1.Rows.Count - 1; i++)
                this.ultraGrid1.Rows[i].Selected = false;
            
            ultraGrid1.Rows[this.ultraGrid1.Rows.Count - 1].Selected = true;

            ultraGrid1.DisplayLayout.Override.AllowUpdate = DefaultableBoolean.True;
            
            for (int i = 0; i < this.ultraGrid1.Rows.Count -1; i++ )
                this.ultraGrid1.Rows[i].Activation = Activation.NoEdit;

     }

 

and my save button:

private void GrabarB_Click(object sender, EventArgs e)
        {
                        insertaVP();
        }

the function insertaVP() take the values of the new row that the user type and insert then on the data base

just fine except the value of the last columm where the user left the cursor at the moment he click

the save button, i notice that in order to save all the values the user got to click anywhere else in

the grid and then click the save button, that way it will save all of the values the user type.

Does anyone know how to solve this? i have tried setting the focus on other components before calling

the insertaVP() function but its still the same 

Parents
No Data
Reply
  • 90
    posted

    thank you very much for you help this has solved my problem now its works just fine :)

Children
No Data