I paste a string to a cell I add before pasting. So I can not get CellValuePresenter.
Can I get the text MaxLenth of the cell without CellValuePresenter?
Hello Shengjie,
If you are adding cells to a XamDataGrid Field you can always use the Cells’ Field’s width, since the Cells are auto sized to fit their Fields’width. You can use the Field’s LabelMaxWidthResolved and LabelWidthResolved properties.
If this doesn’t help please describe your scenario in more details and/or upload some descriptive screenshots and/or sample to this thread.
Sincerely,
Petar Monov
Developer Support Engineer
Infragistics Bulgaria
www.infragistics.com/support
Thanks for your reply. Yes, it is a good solution. But I want the string length, can I get it from field?
The length of the cell's text you can get by calling the Cell.Value.ToString() method and checkings its Length. There is not way to get this from the Field directly.