Default cell value when using a DataGridMaskedTextColumn

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 12 years ago by Sarah
Version: 11.1.0542
Avatar
Hi,

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,
Sarah

Comments (1)

Posted 12 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
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.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.