My XamDataGrid has a child table that is automatially given a header identifying the entire table. The data source is a DataSet and I use the following XAML to change the title of the header:
<
igDP:Field Name="FK_Templates_BetConfiguration" Label="Bet Configuration:"/>
That works just fine. I have been unable to find a way to style the child table's label so that it doesn't affect the child table's column headers (or doesn't require me to re-write ExpandableFieldRecordPresenter). So, the natural question is how do I do this?
Thanks!
*Bump* in the naaaame of love...
Do the *bumpty* *bump*, a-do a-do the *bumpty* *bump*...
Hi Alex,
That didn't work, but I'll assume it was a problem in the way I described what I was after. I'll paraphrase. Every expandable table in my XamDataGrid has a header (it exists right above the column listing of the table). I want to style that header. My attempts to do so have failed because whenever I style the table header I end up styling the column header as well (or the alternative is nothing gets styled at all). So my question is, how do I style the table header without affecting anything else?
Thanks.
Thanks for clearing that out. You are trying to restyle the header of the expandable field record presenter and not the label presenter. In this scenario, I would go with a converter for the ExpandableFieldRecordPresenter. Here is a very simple way to achieve this:
<local:MyConverter x:Key="conv"/>
<Style TargetType="{x:Type igDP:ExpandableFieldRecordPresenter}">
<Setter Property="Background" Value="{Binding Path=Index, Converter={StaticResource conv}}"/>
</Style>
class MyConverter : IValueConverter
{
public object Convert(...)
if ((int)value == 0)
return Brushes.Red;
else
return Brushes.Blue;
}
...
Here I am using the Index of the ExpandableFieldRecord so that I can identify it. You can, of course, bind to anything you want as long as it is identical for each record.
I tried a subset of what was suggested:
<Style x:Key="recordPresenterStyle" TargetType="{x:Type igDP:ExpandableFieldRecordPresenter}">
<Setter Property="Background" Value="Blue"/>
The result was that eveyrthing had a blue background except the column headers and table headers (the second of which I am targeting). Let's say I had the following table:
Header Alpha
Col A Col B Col C Col D
Value 1 Value 2 Value 3 Value 4
What I want to style is "Header Alpha" exclusively. BTW, I am using the Office2k7Blue theme in case that has any impact.
Regarding the theme,
You should place that style inside the Resources of the XamDataGrid itself, and nowhere up the element tree, as this style will not be picked up, because of the theme.
That worked! Now that I am modifying the actual template, what is the risk with future versions of the control?
Thank you sir!
Not much.
We are trying to keep the structure similar as much as possible, unless some big change is needed.