471,330 Members | 1,663 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,330 software developers and data experts.

Adding mask to DataGridView columns

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.

Jun 27 '08 #1
1 9270
>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.

Jun 27 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by Stropher | last post: by
7 posts views Thread by Mitchell S. Honnert | last post: by
reply views Thread by =?Utf-8?B?RGV2ZXJz?= | last post: by
7 posts views Thread by =?Utf-8?B?TG9zdEluTUQ=?= | last post: by
6 posts views Thread by Miro | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.