I have a requirement where there are specific rows that need to be hidden in the RadGridView, but they need to be included in the grid in order for the summary row in the footer and details in the group header to be correct.
I tried editing the RowTemplate and changing the Border Height and Visibilty to 0 and Collapsed, but a white space remains in the grid for the missing row. What is the correct way to hide a row WITHOUT filtering out the row on the datasource?
Thanks,
-Robert
5 Answers, 1 is accepted
It is not recommended to work with the visual elements and try setting the height of the rows to zero. What you may try is to calculate the aggregates based on the ItemsSource (which will give you information for all the items, not just for the filtered ones) and filter the grid.
Maya
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
The natural thing a user of a control would expect to be able to do is to hide rows, not work with 2 seperate filtered or agrregated dataviews and try to match up grid groups to aggregated data. Being able to hide a row without removing it completely in a filter solves all issues at once - while still being able to decide whats visible based on a binding.
Is there any plans to add this ability to the control? I see there are other users that have posted the same issue.
Thanks,
-Robert
RadGridView is virtualized control, which means that its visual elements are recreated and reused on scrolling. That being said, if you set the height of a row to zero, the next item that needs to use this row is supposed to be hidden as well, which I believe is not a desired behavior. Furthermore, changing the height will break the whole virtualization and its logical functionality. That is why it is always the recommended approach to work with the data items instead of the visual elements.
I will recommend to you to run through this and this articles for a reference on virtualization.
Maya
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
B) Binding a property such as height or visibility to a ViewModel IS the correct way to work with properties of visual elements. I'm not sure how that can be qualified as incorrect.
I'm just saying, this functionality is within reason, and from other forum posts, I'm not the only one looking to work with the control in this way?
Being a part of the team which developed RadGridView , I must assure you that it was never designed to work the way you expect. Conditional hiding of rows based on a value is just an alternative definition for Filtering. Regarding DataGrid controls that is the official , traditional and recommended way.
I understand the fact you need to hide some rows , but preserve the totals. This unfortunately is a marginal scenario that is not supported by RadGridView. The only descent approach I can think of here is to use a filtered grid and external UI and logic for the totals.
Kind regards,
Pavel Pavlov
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>