This is a migrated thread and some comments may be shown as answers.

Custom GridViewGroupPanelItem content

1 Answer 88 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gianpaolo
Top achievements
Rank 1
Gianpaolo asked on 26 Feb 2019, 02:35 PM

Is it possible to customize the GridViewGroupPanelItem content so that custom controls inside the header are not visible?

Please see the attached image i took from the example project ColumnSelection, can i remove the CheckBox from the GridViewGroupPanelItem?

Kind regards,

Gian Paolo Tessitore

 

1 Answer, 1 is accepted

Sort by
0
Vladimir Stoyanov
Telerik team
answered on 01 Mar 2019, 02:10 PM
Hello Gianpaolo,

Thank you for the provided picture. 

The element inside the GridViewGroupPanelItem is actually an Image taken of the contents of the Header cell. This is done as a performance optimization for scenarios with custom elements such as the one in the ColumnSelection SDK example. 

With this in mind, there isn't an out of the box way to achieve the desired requirement. That said, you can inherit the GridViewGroupPanel class and override its PrepareContainerForItemOverride method. You can set the Content after the base method has set an Image in order to override this behavior. Of course, you would also have to replace the default GridViewGroupPanel with the custom one, by modifying the ControlTemplate of the RadGridView. 

I am attaching a sample project demonstrating this approach for your reference. Please, check it out and let me know if it helps. Note, that the recommended way of modifying ControlTemplates is with implicit styling and the NoXaml binaries as demonstrated in the project. Additionally, note that the extracted ControlTemplate is for the OfficeBlack theme. If you are using a different one, you will have to extract the corresponding template for that theme.

I hope you find this helpful.

Regards,
Vladimir Stoyanov
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
GridView
Asked by
Gianpaolo
Top achievements
Rank 1
Answers by
Vladimir Stoyanov
Telerik team
Share this question
or