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
190
Custom settings in InitializeRow event are lost on grid sorting and paging
posted

I have a WebDataGrid with sorting enabled (on most columns) and paging enabled. There two editable columns and I have BatchUpdating enabled (AutoCRUD = false). In the InitializeRow event I set the Row.CssClass and if the data fits into a certain criteria it turns the text red. These rows happen to appear at the top of the grid when it first laods (due to custom business logic). When the grid is sorted the data sorts, but the red text remains on the first few rows. And when I page through the grid on every page the red text still appears at the top.

I also have 2 TemplateDataField columns that show different images based on the underlying data. In the InitializeRow event I set the Tooltip to each of the images. When I sort the grid the data sorts (with the images), but each Tooltip stays on the cell and doesn't sort. The same thing happens when I page through the grid. I only get the Tooltips from the first page set up correctly.

Has anyone else ran into this? The InitializeRow event is hit upon sort and paging so I know the code is running, but the grid doesn't seem to be responding.

Any help is much appreciated,

Karen

Parents
  • 190
    Verified Answer
    Offline posted

    In doing some more research I found a couple of posts in the forums regarding client-side styling and found a workaround. I removed the logic from the InitializeRow event and added a ClientEvents-Initialize method. Here I set the cell styling and Tooltip based on certain pieces of data within the row. It's not ideal, but it works. 

    Does someone else has a better solution?

    -Karen

Reply Children