Hi
How could i make the header multi line?
Hi,
Let me know if there are any further questions on this issue.
@ mheusser
This is because you have a very basic, stripped down control template for the LabelPresenter. Themes make heavy use of triggers to react to certain events such as MouseOver. This will depend on the theme you are using as well. What I recommend you do is look at the default styles folder for the DataPresenter and check out the LabelPresenter style that is in there. You'll want to modify it a bit to add in the TextBlock with TextWrapping. The location of the default styles is C:\Program Files (x86)\Infragistics\NetAdvantage 2012.1\WPF\DefaultStyles\DataPresenter. Pick the file that has the theme you want.
@ sam
Without some criteria to search by it is going to be impossible to know which field layout you want. You need to have some criteria to perform any kind of search. Is there any such criteria that you can use to determine which field layout you need? Things such as the field layout with the most columns. Maybe you could give your FieldLayouts a key at design time and then just search for that key at run time like so:
FieldLayout myFieldLayout = xamDataGrid1.FieldLayouts["MyFieldLayoutKey"];
thanks alot for response Marainne
i think i didnt elaborate my fistr query well,
i am getting numerous fieldlayouts of xamdatagrid , lets say i have three layouts, one contains source properties, 2nd contains one or two flag properties and third one have all those columns which are shown in grid which contain grids as well as some addtional some addtional fields define in xaml .
My 2nd grid in another view is bringing 2 layouts ,one have source while other have source + some addtional fields define in xaml and i want to get the 2nd layout as it is actual depiction of my xamdatagrid
as i am making a generalized method to parse the grids, its impossible for me to decide whch is the most appropirate layout to be parsed at run time.can u help me to resolve this issue?
Thanks for the response, I've tried your suggested solution like this:
<Style TargetType="{x:Type igDP:LabelPresenter}">
<Setter Property="ContentTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Text="{Binding}" Background="{Binding}" TextWrapping="Wrap"/>
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
However the applied Theme for the DataGrid doesn't well anymore. Eg. the MouseOver background is now the same as with a button.
Hi Sam,
i ) For accessing Fields you should use the field's name as the indexer instead of hard-coding 0, 1, etc. This way whenever the position of a field is changed in the Fields collection you will always get the field you want.
Field myField = xamDataGrid.FieldLayouts[0].Fields["MyFieldName"];
ii ) The field chooser will only display the fields that were added to the Fields collection. As you can see from my attached screenshot, I have 3 columns and only 3 options in my field chooser even though my datasource actually has a 4th property. I did not create a field for that 4th property so it does not appear in my field chooser.
iii ) You can set the AllowHiding property in the Field.Settings property to "Never". In XAML it would look like this:
<igDP:Field Name="NotificationImage"> <igDP:Field.Settings> <igDP:FieldSettings AllowHiding="Never"/> </igDP:Field.Settings> </igDP:Field>