I have a grid view which is binded to a data source. The grid view is refreshing every 1 minute using a timer. I need suggestions for the following.
- How can i retain the selected row after refreshing the grid view?
- How can retain the selected row after sorting?
- How can i change the color of row based on a column value after refreshing?
Your help will be really appreciated.
5 Answers, 1 is accepted
I tried the sample application given by you. I tried the same thing in WPF application. But i am not able to derive the cellstyleselector class from styleselector. I have included Telerik.windows.control, but then also styleselector is not coming. Let me know how to proceed.I am using telerik Q1 2010 SP2.
I managed to run the same as a wpf application. But i have few more queries.
- In the given code, it is creating a new item and adding the same in the grid without rebinding. But i need to rebind the grid. In my case, there would be new items added and others items updated. So how can i achieve this?
- If i rebind the grid in timer_tick event, the already selected row in the grid is lost. I need to retain the selected row and the previous sorting (user would have sorted the grid, also multiple sorting is allowed).
Help me to achieve this.
You do not need to rebind the grid in case of items adding. As to the update you can use the replace approach instead. If you still do not want to do this you can simply copy in a local variable the grid SelectedItem and restore it after rebind.All the best,
the Telerik team