In Silverlight how do you set the HeaderStyle of a dynamic DataGridColumn -


I have a data grid and I'm dynamically adding this grid to my ViewModel column. The user has a setting dialog, where they can show which columns in this data grid. The problem I am running is that I do not know how to set the header style on one of these datagrid columns created in my ViewModel.

The most basic version of this will be to add tooltips to these dynamic columns on the DataGridColumnHeader. Note that these columns are not defined in XAML due to their dynamic nature, most columns are data-driven and thus are not known at the time of compilation.

Bonus points How to add a button to this style and how to set it up or command property, so that I can remove the column from the grid (x image on one button in the column header) Imagine, when I click it, I want to remove the column.)

You Specify the header style in the code like this: -

  style header style = new style (TypeGridColumnHeader); HeaderStyle.Setters.Add (New Setter (ToolTipService.ToolTipProperty, "Hello World")); YourDynamicColumn.HeaderStyle = headerStyle;    

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -