Adding mask to DataGridView columns

A

Andrus

I need to create WinForms DataGridView column which shows spaces between
thousands.
I have found that MaskedTextBox Mask property supports this

I tried to add column to DataGridView using

var column = new DataGridViewMaskedTextBoxColumn();
column.Mask= "99 999 999.99";

but got error because DataGridViewMaskedTextBoxColumn does not exist.

How to add Mask to DataGridView column ?

Andrus.
 
A

Andrus

I need to create WinForms DataGridView column which shows spaces between
thousands.
I have found that MaskedTextBox Mask property supports this

I tried MSDN DataGridview Masked TextBox column sample.
This sample displays mask only for current cell, not to whole column.

I tried to use

public MaskedTextBoxCell()
: base()
{
DisplayStyleForCurrentCellOnly = false;
....

But got error since DisplayStyleForCurrentCellOnly does not exist for
TextBox cells.

How to show amouts in every row separated with space like

1 234.55
22 444.44
343 333.33
3 333.45


Andrus.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top