We are using RadTileView in our WPF application. I need to customize the RadTileView in the following two ways.
1. Reduce the header height. It currently seems having lots of margin/padding around the header text and we want to reduce them.
2. Add a delete button ("X") on the left side of the header text (in the maximumized view only). When the button is clicked,
we will remove that item from datasource.
Can you please let me know how to implement above two things?
Thanks!
5 Answers, 1 is accepted
To achieve this you'll have to edit the default template of the RadTileViewItem. You can change the size of the header by setting size to the grid that contains the HeaderElement and also in this grid you should add the new button. I've attached a sample project so could you please examine it and see if it helps you?
If you have further questions feel free to ask.
Zarko
the Telerik team
Thanks. This is what I am looking for. However I ran into two issue when running your sample project.
1. Get the following exception:
{"Type reference cannot find type named '{clr-namespace:Telerik.Windows.Controls.TileView;assembly=Telerik.Windows.Controls.Navigation}TileViewCommands'."}
I commented out that "Command="Telerik_Windows_Controls_TileView:TileViewCommands.ToggleTileState" and it runs now. What could caused that? Different versions?
2. The click on the header to maximize the item act weird especially after I double clicked the header. So I commented out the whole "ControlTemplate.Triggers" block in the xaml and it seems working properly now. So, I guess if no triggers defined for the template in my xaml, it just uses the default?
3. The "X" button looks too overwhelming on every header. So I changed mind to use right-click context menu for delete operation. Since I don't need to add "X" button on the header anymore, is there any other simple way to shrink the header height instead of changing the default template?
Thanks,
Jie
I'm very sorry but in my previous post I've attached the wrong dlls and that's why you were getting those errors. Unfortunately there's no easier way to shrink the header height but to edit the default template.
Could you please examine the attached project(TileViewCustomTemplate.zip) and see if this time everything is OK?
Zarko
the Telerik team
Thanks.
It's not necessary to upgrade, because you can edit the old template (the one from the 2010.3 version) where we don't use this command, but we advise you to upgrade because we are stopping the support for the old version (that's because the we made a major refactoring on the tileview for the 2011.1 version and most of the problems from 2010.3 are fixed in 2011.1).
If you have more questions feel free to ask.
Zarko
the Telerik team