Hi,
I have a XamDataGrid which is bound 2-way. Based on the user action, I want to apply a transform function which modifies the contents of the cell and for a specific user action this modification should be applied to all the cells in that column. Is there anything other than looping through the rows to change the value of each cell for that column possible?
Hello Arpita,
If you want to change a Property of all items in a collection, the only way is to loop trough all items and change that Property. I can suggest you use for loop instead of foreach, becasue it is faster, since it is not creating new instance for every item.
Hope this helps you.
User clicks on a button outside the grid, and I want to apply an algorithm to update the value in all the cells of a particular columns. E.g. append the value in all cells with XYZ. So I am looking for an alternative to looping every row in the grid to do the change.
Could you please be more specific what is the fucntionality you want to achieve, so I could be able tell you whether you could use Triggers or you will have to loop through all Cells.
Looking forward for your reply.
Hi Stefan,
I want to change the contents/value of the cell and not the property, that will still work?
Hello,
Thank you for your post. I have been looking into and I can say that if you don’t want to loop through all the Records in order to change all Cells, you can use Style for the CellValuePresenter with appropriate Triggers in order to change a Property in all Cells. Please let me know if this helps you or you need further assistance on this matter.