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
35
Easy to answer question on update batch and post back
posted

As a programmer who wears many hats I only get to work in the .net environment using the infragistics tools every blue moon. This is something I've known how to do once but can't figure out how to do it now. I'm using ultrawebgrid Version=7.1.20071.1050 and VS 2003 in clr 1.1. Anyway...

I'm using several ultrawebgrids already on a page and I only want them to update batch, not update after every row is added or modified. I've managed to do that. NOW I have to add another grid to a page and I want the same behavior but I can't seem to find how to keep it from doing a postback after every row is changed. I know this is simple but I somehow blocked on this.

Please help and thanks for your patience with some one out of the loop and behind the curve.

Parents
No Data
Reply
  • 2197
    posted

     Actually, after I typed this I realized that there are a few other details I left out. In any case, regardless of the type of updates that you want to do, you need to set some properties that tell the grid to allow updates, additions, and deletions in the first place. You can do this in code or in the designer. If you do it in code and you are data binding, it makes a lot of sense to use the InitializeLayout event. The properties you need to set are on the DisplayLayout object:

    e.Layout.AllowUpdateDefault = AllowUpdate.Yes;

    e.Layout.AllowAddNewDefault = AllowAddNew.Yes;

    e.Layout.AllowDeleteDefault = AllowDelete.Yes;

     In the InitializeLayout event, e.Layout is the same as typing this.UltraWebGrid1.DisplayLayout (or Me.UltraWebGrid1.DisplayLayout in VB). Additionally, you can set these properties on an individual band level for hierarchical grids:

    e.Layout.Bands[0].AllowAdd = AllowAddNew.Yes;

    e.Layout.Bands[0].AllowDelete = AllowDelete.Yes;

    e.Layout.Bands[0].AllowUpdate =  AllowUpdate.Yes;

    Once you set these properties, you then decide which events to handle; batch events or regular. The combination of the properties that allow the grid to update, add, or delete along with the specific events handled will determine its behavior. 

Children