473,385 Members | 1,673 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 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 9692
>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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: dbuchanan | last post by:
Hello, Is this a bug? Is there some kind of work around? I want to add default values for a few columns in my datagridview I found the "DefaultValuesNeeded" event for the datagridview I...
4
by: Stropher | last post by:
I have the following: this.dataGridViewBill.DataSource = tblResult; //hide the following columns this.dataGridViewBill.Columns.Visible = false; //email this.dataGridViewBill.Columns.Visible =...
2
by: bob | last post by:
After adding a new row (programmatically) to a table/view that is being displayed in the DataGridView control, the new row appears in the DataGridView grid. Now, how do I select that new row? If...
7
by: Mitchell S. Honnert | last post by:
Is there an equivalent of the DataGrid's DataGridTableStyle for the DataGridView? If not, is there an easy way to duplicate the DataGridTableStyle's functionality for the DataGridView? Here's...
3
by: connected | last post by:
I'm having difficulty with populating a DataGridView control with data correctly. It works with a single class, for example... class MyClass { private string _propertyOne; private string...
0
by: =?Utf-8?B?RGV2ZXJz?= | last post by:
I've successfully made the columns in a DataGridView format numbers correctly using the Format porperty. Now I'm trying to do the same with textboxes, but the Mask property doesn't work the same...
7
by: =?Utf-8?B?TG9zdEluTUQ=?= | last post by:
Hi All :) I'm converting VB6 using True DBGrid Pro 8.0 to VB2005 using DataGridView. True DBGrid has a MultipleLines property that controls whether individual records span multiple lines. Is...
9
by: trint | last post by:
How can I retrieve all of the data from a datagridview? Any help is appreciated. Thanks, Trint
6
by: Miro | last post by:
Sorry for the cross post. I am stuck. I have a datagridview for poker rounds. Basically there are 3 columns in this datagridview. "Round" "SmallBlind" "BigBlind" I have an issue when I tab...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...

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.