We help IT Professionals succeed at work.
Get Started

VB.Net - DataGrid Change ColumnType

Jimbo99999
Jimbo99999 asked
on
197 Views
Last Modified: 2015-07-15
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
Comment
Watch Question
This problem has been solved!
Unlock 1 Answer and 5 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE