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
210
Ultrawebgrid viewstate is not maintained for subsequent postbacks
posted

In my application I have problem with asp.net Ultrawebgrid, as it is not maintaining the view state for subsequent postbacks.

I can explain this with a scenario.On my webpage I have following controls.

UltraWebGrid

SqlDataSource

DropdownList

Button.

SqlDatasource is configured to stored procedure with input parameter in database.Which returns list of records.

UltraWebGrid uses SqlDataSource as data source.

I used Sql DataSource for dropdown also.

I modified the rows of grid.I added new rows, modified and deleted existing ones.I changed selected item for dropdown also.

When I submit the page by clicking button multiple times, Dropdown retains its value.But where as Grid maintains viewstate only for first postback and looses changes for subsequent postbacks.I am wondering will it bind to data for each postback...

Please help me...

Thx

shravan

 

 

 

Parents
No Data
Reply
  • 28464
    posted

    Hello,

    Yes, this is indeed the case - UltraWebGrid does not automatically maintain the ViewState of its datasource, since this could potentially lead to huge ViewState. asp:DropDownList requires only DataTextField and DataValueField, for Grid this can be a lot of columns and rows.

    The solution is to rebind the grid upon each postback. This can be done either manually or automatically, using the InitializeDataSource event of the grid.

    I recommend going thru Tony Lombardo's article on databinding here:

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

    HTH,

Children
No Data