Hi, All
I populate a datagrid using dataset, read data from SQL Server database
"Northwind" database including "Customer", "Order" and "Orderdetails"
tables. When the "unit price" display in the datagrid, it does not have $
sign. How do I format "Unit Price " column with $ sign?

Thanks


Kai

Re: formatting datagrid column? by William

William
Tue Apr 27 14:10:15 CDT 2004

http://www.knowdotnet.com/articles/cgrid.html
"kai" <kailiang@earthlink.net> wrote in message
news:0Wxjc.12736$gH6.6662@newsread3.news.atl.earthlink.net...
> Hi, All
> I populate a datagrid using dataset, read data from SQL Server database
> "Northwind" database including "Customer", "Order" and "Orderdetails"
> tables. When the "unit price" display in the datagrid, it does not have $
> sign. How do I format "Unit Price " column with $ sign?
>
> Thanks
>
>
> Kai
>
>
>



Re: formatting datagrid column? by v-kevy

v-kevy
Tue Apr 27 22:13:21 CDT 2004

Thanks for Bill's quick response!

Hi Kai,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that you need to add a '$' before the unit
price value in DataGrid. If there is any misunderstanding, please feel free
to let me know.

Bill has provided us with a good article. We can subclass DataGrid and then
can format the columns. Here I have another way. If your DataGrid is just
for read purpose, you can add a column to the DataTable and set the new
column's expression to '$' + UnitPrice. Then you can hide the UnitPrice
column by setting its ColumnMapping property to MappingType.Hidden. Now we
can only see the column with $ in the DataGrid.

HTH. If anything is unclear, please feel free to reply to the post.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."


Re: formatting datagrid column? by v-kevy

v-kevy
Fri Apr 30 08:57:00 CDT 2004

Hi Kai,

I'd like to know if this issue has been resolved yet. Is there anything
that I can help. I'm still monitoring on it. If you have any questions,
please feel free to post them in the community.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."