473,395 Members | 2,006 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,395 software developers and data experts.

Format number in the datagrid

Jan
Is there a way to display numbers in specified format in
data grid. I know that I can do this converting numbers
to strings but in the grid I want them as numbers
(because of sorting).

For example: number 10 I want to display as 10.00

Thanks,

Jan.
Nov 15 '05 #1
4 6498
Hi Jan,

Use the Format property of the DataGridTextBoxColumn object to specify
desired format.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Jan" <an*******@discussions.microsoft.com> wrote in message
news:07****************************@phx.gbl...
Is there a way to display numbers in specified format in
data grid. I know that I can do this converting numbers
to strings but in the grid I want them as numbers
(because of sorting).

For example: number 10 I want to display as 10.00

Thanks,

Jan.


Nov 15 '05 #2
Hi Jan,

Use the Format property of the DataGridTextBoxColumn object to specify
desired format.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Jan" <an*******@discussions.microsoft.com> wrote in message
news:07****************************@phx.gbl...
Is there a way to display numbers in specified format in
data grid. I know that I can do this converting numbers
to strings but in the grid I want them as numbers
(because of sorting).

For example: number 10 I want to display as 10.00

Thanks,

Jan.


Nov 15 '05 #3
Jan
Thanks, it works perfectly.

Jan.
-----Original Message-----
Hi Jan,

Use the Format property of the DataGridTextBoxColumn object to specifydesired format.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Jan" <an*******@discussions.microsoft.com> wrote in messagenews:07****************************@phx.gbl...
Is there a way to display numbers in specified format in data grid. I know that I can do this converting numbers
to strings but in the grid I want them as numbers
(because of sorting).

For example: number 10 I want to display as 10.00

Thanks,

Jan.


.

Nov 15 '05 #4
Jan
Thanks, it works perfectly.

Jan.
-----Original Message-----
Hi Jan,

Use the Format property of the DataGridTextBoxColumn object to specifydesired format.

--
Dmitriy Lapshin [C# / .NET MVP]
X-Unity Test Studio
http://x-unity.miik.com.ua/teststudio.aspx
Bring the power of unit testing to VS .NET IDE

"Jan" <an*******@discussions.microsoft.com> wrote in messagenews:07****************************@phx.gbl...
Is there a way to display numbers in specified format in data grid. I know that I can do this converting numbers
to strings but in the grid I want them as numbers
(because of sorting).

For example: number 10 I want to display as 10.00

Thanks,

Jan.


.

Nov 15 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: J.B | last post by:
I have a datagrid that will display different datasets, (it runs different sprocs based on a value in the querystring) but it will always return 6 columns. The 5th and 6th columns are always Date...
6
by: Hutty | last post by:
I've looked around and have yet to find anything that would answer my question regarding formating a column in a datagrid. My grid looks like this as far as data" AMHQCON|51300.01|-3147 The...
4
by: yer darn tootin | last post by:
Does anyone know the sort expression for a column that's data has been returned in the format, eg '07 Jul 05'?? The sort expression {..:"dd mmm yy"} doesn't work ( if the column was returned as...
1
by: George Yachán | last post by:
I have added a new column to a typed dataset which displays an expression which is the result of one double (data type) field divided by another double field. I would like format this column to...
5
by: Robin Tucker | last post by:
My database has a column for numeric data items. How can I use this number in the "format" command, such that for, say precision 2, I get numbers like 2011.01 or 2387.00 and for 4 I would get...
4
by: postings | last post by:
Hi I have a decimal numbers showing up on my datagrid that is displaying lots of trailing zeros in the listbox. i.e. 1.000100 or 1.000000 I want to get rid of all the trailing zeros (I...
4
by: Bernie Hunt | last post by:
I'm looking for information on how to format a strings in a Datagrid. The application has telephone numbers coming from a database and they are a string of 10 digits. I would like to add in the "-"...
6
by: JFB | last post by:
Hi all, How can I format a fax number as 888-333-444? The number is coming from database as 8883334444 <ItemTemplate> <%#container.dataItem("cfax")%> </ItemTemplate> Tks JFB
9
by: seep | last post by:
hi i m finding following error on the code that i wants to use to get all record from table via store procedure with paging. the error is : Input string was not in a correct...
1
by: differentsri | last post by:
THIS IS AN ASP.NET 1.1 APPLICATION IAM TRYING TO UPDATE THE FIELD BUT I AM NOT ABLE TO UPDATE IT? CAN U TELL THE REASON ? IT IS GIVING THE FOLLOWING ERROR BELOW I HAVE ALSO GIVEN THE CODE OF...
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: 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...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.