Default cell value when using a DataGridMaskedTextColumn

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 13 years ago by Sarah
Version: 11.1.0542

I'm using a DataGridMaskedTextColumn and when a new row is added, I would like to populate the cell with a default value that uses the mask. At present the cell is empty until it is first edited.

For example, if my mask is "blah \\d+" I would like the default value for each new row to be "blah 0", "blah 1" etc.

How is this achieved?

Many thanks,

Comments (1)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Hi Sarah,

Our ThemeDataGrid is an extension of the Microsoft DataGrid, and we only support our extensions/themes. General DataGrid questions should be directed to Microsoft or a third-party Q&A site (such as StackOverflow).

Your question if effectively how to initialize a new row added by the DataGrid. The answer would vary depending on how you are using the DataGrid, but ultimately it will be creating a new object of the item type of the bound collection. So you could probablydo it in the default constructor of that class. Or you may be able to use the BeginningEdit on the DataGrid, where you'd just need to verify that the event is associated with the new row.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.