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
20
Changing Display value of a cell without changing the "real" value
posted

Hello and good morning infragistics team,

My question is similar in nature to this other one I have found on your forums: https://es.infragistics.com/community/forums/f/ultimate-ui-for-windows-forms/51898/different-display-value

However, I am interested not only in changing display values for a dropdown list, but also for individual cells containing single values.

My issue is that some back-end database values will get into what's displayed to the user and I want to clean that up, however the back end values are important and simply truncating them leads to writing bad data to our database.

Is there some similar thing to "valuelist.DisplayValue" type stuff for individual cells?


Cheers and Happy new year,

Sasha

  • 6120
    Offline posted

    Hello Sasha,

    As suggested in the forum post that you pasted here, using a ValueList is the best way to display a different DisplayValue in the Grid cell. By setting the Column style to DropDownList the user will not be able to see the dropdown arrow and thus will not be able to open the dropdown list. This can also be done using a DrawFilter but like suggested it is a very complicated route to do it that way.

    Another alternative approach is to add an unbound column to the Grid. Then you would handle the InitializeRow event and populate the cell of the unbound column with whatever data you want based on any other cell(s) in the row.

    Setting the Text on the TextUIElement of the cell using a CreationFilter is another easier option. My recommendation to achieve this is using a ValueList instead of a CreationFilter or adding a unbound column as these two approaches require custom code.

    Please let me know if I may be of further assistance.

    Sincerely,
    Sahaja Kokkalagadda
    Associate Software Developer