VB.Net - DataGrid Change ColumnType

Good Day Experts!

I gave it a valiant effort but I am really out of ideas.  I have a DataGrid with double data values in 5 columns as received from a DataTable.  I do not have the DataGrid column formatted as currency.

I need to be able to iterate through the DataGrid and based on a string value in the first column put a $ or £ in front of the double value.  Here is what I am trying:

Dim Amount As String = CStr(DataGridRow.Cells(4).Value)
DataGridRow.Cells(4).Value = "$" & Amount

Unfortunately I am getting an error --> Not a valid value for type decimal

It feels like the DataGrid is holding onto the type "assigned" from the DataTable but I am not sure.

Can you help with ideas?

Thanks,
jimbo99999
Jimbo99999Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

David Johnson, CD, MVPOwnerCommented:
is the source a string or a decimal?
Scott McDaniel (Microsoft Access MVP - EE MVE )Infotrakker SoftwareCommented:
Assuming you're using a DataGridView:

If DataGridRow.Cells(4) is a Numeric value, then you cannot add the currency symbol. You can format it as Currency:

DataGrid.Columns(4).DefaultCellStyle.Format = "c"

It feels like the DataGrid is holding onto the type "assigned" from the DataTable but I am not sure.
AFAIK, you cannot change the Datatype of a Datagridview Column after it's created. You'd have to instead create a new column with your desired type, and fill it as needed. You can set the Column DataPropertyName to the column in your underlying dataset, and the grid should show the values in that column (assuming they're compliant with the column's datatype, of course).
Jimbo99999Author Commented:
Thanks for your responses.  Please don't mark as neglected as I was off for the holiday.
Jimbo99999Author Commented:
I ended up taking the currency designation off the column.  Then Interrogated the Datagrid formatting the value to decimal then converting to a String so I could add the "£" or "$" designation.  

Thanks for your responses,
jimbo99999

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Jimbo99999Author Commented:
I didn't want to delete the question since I found a solution on my own.  I wanted to share it for others to use that may be in the same situation.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.