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
175
Xam Data Dynamic Formatting of the CellValuePresenter
posted

I have a  XamDataGrid which is Bound to DataView as i dont know the fields (Its Dynamic)

but i want XamDataGrid to format Fields depend on their DataType ( Which Is also MYCustomdataType) & Formatting is also user Customizable LikE

MYCustomdataType1 which is a double internally but User can opt to show this value in many Diff Formats:-

10000 to (10,000) or -10-, I have a Class/service which handle this for me.

So if a Column of a dataview is of MyCustomDataType. it should get formatted as per the Object/Service Setting in GUI Only As i also Have Export To CSV feature So I cannot manipulate Actual Object Values at View Model before Binding it to Grid.

I tried the same via Changing Filed Class property:-

under FieldLayoutInitialized event

{

If(Field.DataType== typeof(MyCustomDataType))

Field.ConverterParameter = GetFormatStringFor(typeof(MyCustomDataType));
Field.Converter = new FormattingConverter();

 }

Its not working for me. Can you please help..

  • 138253
    Offline posted

    Hello,

     

    I am just checking the progress of this issue and was wondering if you managed to achieve your goal or if you need any further assistance on the matter.

  • 138253
    Offline posted

    Hello shahanshah,

     

    Thank you for your post. I have been looking into it and I can suggest you create a Style for the CellValuePresenter and use Triggers in order to apply different formats or use StyleSelector for the CellValuePresenter’s ContentTemplateSelector. Here:

     

    http://ko.infragistics.com/community/forums/p/12559/421600.aspx

     

    similar approaches are discussed. Please let me know if this helps you or you have further questions on this matter.

     

    Looking forward for your reply.