Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
XamDataGrid Field Binding nullable types RecordContainerGenerationMode


I am using a XamDataGrid with the datasource bound to a collection of interfaces, which are resolved to the respective classes via UnityContainer. The fields are defined with namebinding, underlying types are short, string, int?, decimal?. RecordContainerGenerationMode is not set, so judging from the blog I found click here it is set to recycle.

Now to my problem: the values in cells whose types are nullable, like int? or decimal?, are sometimes horizontal aligned left sometimes right and this behavior is not coherent over the rows. Row 1 and 2 can be correctly aligned right, Row 3 is aligned left, Row 4 is right, and some are empty because of the null value. Which cells are aligned wrong is random and changes with scrolling. There is no styling on the grid.

This behavior is fixed if I set RecordContainerGenerationMode to anything other than recycle, or if I change the underlying type to int eg. decimal (what I do not want). Setting the RecordContainerGenerationMode to anything other than recycle, results in a feelable performance decrease either in scrolling or on the initialization of the view.

I tried to define a style for XamNumericEditor and XamCurrencyEditor to always align right and I can see these settings in Snoop, but the values are still displayed left. For the wrongfully aligned cells, if I check the settings with snoop, there is no hint on why they are displayed left.


<igEditors:XamDataGrid DataSource="{Binding Children, ValidatesOnNotifyDataErrors=True}"
                     ActiveDataItem="{Binding SelectedItem, Mode=OneWayToSource, UpdateSourceTrigger=PropertyChanged, ValidatesOnNotifyDataErrors=False}">
        <dataPresenter:FieldSettings AllowRecordFiltering="True" AllowEdit="False" AllowSummaries="False" />
                <dataPresenter:FieldSortDescription FieldName="ProduktId" Direction="Ascending" />
                <dataPresenter:Field Name="ProduktId"/>
                <dataPresenter:Field Name="Status"/>
                <dataPresenter:Field Name="FirmaBezeichnung"/>
                <dataPresenter:Field Name="ProduktCode"/>
                <dataPresenter:Field Name="ProduktArtId"/>
                <dataPresenter:Field Name="ProduktBezeichnung"/>
                <dataPresenter:Field Name="MindestProduktLaufzeitInJahren"/> 
                <dataPresenter:Field Name="DefaultProduktLaufzeitInJahren"/>
                <dataPresenter:Field Name="TarifBezeichnung"/>
                <dataPresenter:Field Name="GeschaeftsBereichBezeichnung"/>
                <dataPresenter:Field Name="ProduktMindestFolgePraemie"/>
                <dataPresenter:Field Name="ProduktMindestJahresPraemie"/>
                <dataPresenter:Field Name="AutomatischeVerlaengerung"/>

MindestProduktLaufzeitInJahren and DefaultProduktLaufzeitInJahren are of type int?

ProduktMindestFolgePraemie and ProduktMindestJahresPraemie are of type decimal?

Parents Reply Children