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
415
ValueToTextConverterProperty is not working
posted

Hello,

In xamdatagrid, On click of a button, I need to convert all 0(int,double and decimals) into blank . To implement this i created a style in C# and set ValueToTextConverterProperty and changes it value into the converter as per the cell value but it's not updating the value in the grid.

If column contains 0.00 then it converts to 0 otherwise it's retaining it's old value.

//Code I've written to set ValueToTextConverterProperty :

Style appliedStyleOnSelectedField = SelectedField.Settings.EditorStyle; //Selected field is the column of xamdatagrid

var newSetter = new Setter(ValueEditor.ValueToTextConverterProperty, new ZeroToBlankConverter());

appliedStyleOnSelectedField.Setters.Add(newSetter);
SelectedField.Settings.EditorStyle = appliedStyleOnSelectedField ;

Anyone know why is this behaving so weird ?

Parents
  • 35319
    posted

    Hello,

     

    I have been looking into your post and it seems that you have not set a style for the EditorStyle. This is why it is null. I have create a sample application(DataGridValueToTextConverterProperty.zip) where I have achieve the desired dictionary.

     

    If you need any further assistance on this matter, feel free to ask.

     

    DataGridValueToTextConverterProperty.zip
Reply Children