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
355
PropertyChanged on gridcells, MaxChars on Fields
posted

Hi.

I have two quick questions. 1. Is there a nice way to set the maximum number of characters allowed in a field in a datagrid(when the type is String)? That is so that input is limited to the number of chars, without using a converter to validate after the text is inputed?

2. Is there a good way to let the grid update it's bound data on UpdateSourceTrigger=PropertyChanged rather than lost focus?

I know it's possible with some "hacking" using the CellChanged event, but is there a cleaner way to do this? (Still want the converters etc to do their job, would forinstance somewhat solve issue nr 1)

We have problems with the XamDataGrid due to the latter issue. The grids in our views doesn't receive the lostfocus event, and there for the ui hasn't updated the source wich causes data to be missed.

 

Best regards,

Stian