Home Forums WPF controls Xceed DataGrid for WPF Direct access to the default CellEditors for numeric types?

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • User (Old forums)
    Member
    Post count: 23064
    #26008 |

    My data collection has some nullable numeric types. While I can edit these OK in the grid (provided I specify the datatype to be the non-nullable equivalent in the DataGridCollectionViewSource), I’ve observed that the editors assigned accept all text.

    This contrasts from the behavior you get with default editors assigned for numeric types.

    By default, the CellEditor associated with a numeric type doesn’t allow non-numeric input.

    Is it possible to define a grid ItemProperty in the DataGridCollectionViewSource and the Column in the DataGridControl for a nullable field in such a way to have the corresponding grid column use the same CellEditor that would be assigned for the equivalent non-nullable numeric type?

    Thanks.

    Imported from legacy forums. Posted by Richard (had 2376 views)

    User (Old forums)
    Member
    Post count: 23064

    The way to do this is shown in the Xceed documentation here 🙂

    http://doc.xceedsoft.com/products/XceedWpfDataGrid/Formatting%20a%20Cells%20Content.html

    You need to access the cell editors directly, just specify a value converter via a template as shown in the example.

    Works great!

    Those changes made last year to the docs are so great with the gray out / colorized text to show you the salient features of an example.

    Xceed WPF DataGrid Rocks!

    Imported from legacy forums. Posted by Richard (had 420 views)

    User (Old forums)
    Member
    Post count: 23064

    correction to above…

    “You need to access…”

    should read

    “You don’t need to access…”

    Imported from legacy forums. Posted by Richard (had 3421 views)

Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.