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
490
Ultrawebgrid - Disable Automatic Update
posted


I am Ultrawebgrid control which is associated with a SQL datasource for displaying and inserting data. Currently the newly the newly added rows to the webgrid are saved automatically in the database on postback(i.e of click of a button). How I disable this automatically saving of data.

I need to have more control over the timing database updation.

Thanks,
Rajiv

Parents
  • 28464
    posted

    Hello,

    In a typical asp:sqldatasource control you can autogenerate the SELECT, UPDATE, DELETE and INSERT statements for the respective table using the asp:sqldatasource wizard. In this case I believe the easiest way to proceed would be to just delete the auto-generate INSERT statement and proceed with your custom code in the AddRow event of the grid.

    Alternatively, you can just hook the AddRow event and set the eventArgs.Cancel property to true so that the event is cancelled and then add your custom code, e.g.

    protected void UltraWebGrid1_AddRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e)
        {
            e.Cancel = true;
            // custom code here
        }

    Also, I recommend reading this excellent blog post by Tony Lombardo on databinding and automatic updates here:

    http://blogs.infragistics.com/blogs/tony_lombardo/archive/2008/01/29/demystifying-infragistics-webgrid-databinding.aspx

    It provides many clues and insights on how databinding / autoupdates works and how they can be customized.

    HTH,

Reply Children