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
215
Bug in webgrid on ClickCellButton
posted

It appears that the webgrid (v8.3) looses track of the rows when in Ajax mode and either scrolled past the off-band fetch or grouped by dragging column to the top in OutlookGroup mode.

I have a ClickCellButton event hooked up on each row to add items into the shopping cart. When I scroll or group the ClickCellButton event returns completely different item than the one in the row clicked on in the Dim TestName As String = e.Cell.Row.Cells(3).Value.ToString

statement

Is there a way to fix this? for now I just removed the Ajax and OutllokGroup from the grid. Not very elegant solution.

Thanks,

Jakub

Parents
  • 45049
    Suggested Answer
    posted

    Jakub,

    For most XmlLoadOnDemandType values, WebGrid does not remember what rows were already loaded when you post back.  So, the result you've described is generally expected.

    There are two possible solutions for this.

    The first is to process information client-side, rather than server-side.  By avoiding the postback, you avoid the scenario of the grid resetting its rows in the first place.  Obviously, this is an option only if you're able to process your functionality on the client.  In your scenario, you might be able to use the client-side ClickCellButton event, rather than the server-side event.

    The second option is to change the DisplayLayout.XmlLoadOnDemandType property to Accumulative (Infragistics.WebUI.UltraWebGrid XmlLoadOnDemandType.Accumulative).  With this setting, any rows that were loaded into the grid remain loaded when you postback.

Reply Children