I set the FlowDirection of datagrid but to no use. If FlowDirection of DataGrid is set, should it be automatically set to all underlying controls. Currently the GroupByRecord header is showing data incorrectly due to its incorrect FlowDirection. Any ideas how can I make it correct.
I did this in dataGrid_InitializeRecord but didn't work. Any ideas?
if
(e.Record is GroupByRecord)
{
Style style = new Style(typeof(HeaderLabelArea), Infragistics.Windows.Themes.DataPresenterGeneric.HeaderLabelArea);
Setter setter = new Setter();
setter.Property =
FrameworkElement.FlowDirectionProperty;
setter.Value =
CultureInfo.CurrentUICulture.TextInfo.IsRightToLeft
?
FlowDirection.RightToLeft
:
FlowDirection.LeftToRight;
GroupByRecord gbr = e.Record as GroupByRecord;
Thanks,
Imad.
gbr.FieldLayout.Settings.HeaderLabelAreaStyle = style;
}
style.Setters.Add(setter);
Problem is solved. Thank you for the help.
Hello Imad,
You can change back the FlowDirection only for the GroupedByRecords while all of the other containers in the XamDataGrid have a FlowDirection set to RightToLeft. You can achieve this functionality by setting a style for the GroupByRecordPresenter like follows:
<Style TargetType="{x:Type igDP:GroupByRecordPresenter}">
<Setter Property="FlowDirection" Value="LeftToRight"/>
<Setter Property="HorizontalContentAlignment" Value="Right"/>
</Style>
However I notice that all of the Microsoft controls, when FlowDriection is set to RightToLeft, show the default string as you described it. This is why I believe that your best option in order to change the flow is handling the grouping and set a custom string that you want to be displayed.
Please let me know, if I can help you further on the matter.
Actaully changing description would br useless as the same text that is in English when displayed in Arabic the brackets of text mess up. They would get correct if the flowDirection is correctly set. As you can see from the
I am just following the progress of this issue. If you still have any questions on the matter, I will be glad to help.
I can suggest you in order to change the displayed text to handle the Grouped event of the XamDataGrid and change the Description property of the header the way you want. You can try something like:
private void xdg_Grouped(object sender, Infragistics.Windows.DataPresenter.Events.GroupedEventArgs e)
foreach (Record r in xdg.Records)
(r as GroupByRecord).Description =….
If you need any further assistance on this please feel free to ask.