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
60
UltraWebGrid - losing data on postback
posted

Hi,

I need to save data in the grid when the user modifies and clicks on an asp button. But, the grid doesnot persist data when coming into the click event - it is losing its state on postback. Please assist me on how I can achieve the functionality.

My Grid:

<igtbl:UltraWebGrid ID="grdResults" EnableViewState="true" runat="server" OnUpdateRowBatch="grdResults_UpdateRowBatch"
                    SkinID="CorePagingGrid" OnInitializeLayout="grdResults_InitializeLayout" OnInitializeRow="grdResults_InitializeRow">
           <DisplayLayout>
                    <ClientSideEvents CellClickHandler="grdResults_CellClick" />
           </DisplayLayout>
 </igtbl:UltraWebGrid>

 

Thanks in advance,

Perumal.R

 

Parents
  • 45049
    posted

    How are you populating your grid with data?  I see that you're not setting teither the DataSource or DataSourceID property in the markup, so you're either binding it programmatically or are manually creating rows to directly add to the grid.  Which are you doing, and in what event?

    If you're binding to a data source, the most likely cause of this is that you're calling DataBind() again on a postback when you don't need to.  This will cause data to be re-loaded, and events to not function.

    If you're manually creating data, the most likely cause is that you're creating your row objects in a way that they're not stored in ViewState.  Create new UltraGridRow objects using the constructor that takes a boolean, pass true as that value, then add the new row to your grid - don't use the grid's Rows.Add() method to actually create the row.

Reply Children