|
-
Jul 27th, 2006, 12:42 PM
#1
Thread Starter
PowerPoster
[2.0] custom format column datagridview
in a datagrid view, if I add a custom row (not binding to anything at all):
Code:
this.theDataGridView.Columns.Add("Value", "Value");
this.theDataGridView.Columns.Add("Name", "Name");
string[] rows = new string[2];
rows[0] = "5.236";
rows[1] = "blah";
this.theDataGridView.Rows.Add(rows);
how can I set the format of the value column?
I know that this works:
this.theDataGridView.Columns["Value"].DefaultCellStyle.Format = "#.##";
but only when you are binding to a datasource, such as SQL.
If I apply this at any point in the code, it still does not format the column, to give me the format as follows:
x.xx -> 5.23
any ideas?
-
Jul 27th, 2006, 02:04 PM
#2
Thread Starter
PowerPoster
Re: [2.0] custom format column datagridview
yes I believe I solved it, pretty obvious: incorrect data format!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|