Using CType with grid data

E

eagle

How do I retrieve a value off a grid, then convert it to a decimal, seems
like the only thing I can do is convert it to a string?? This is what works
if the value is a string:

strValue=cType(e.Item.Cells(1).Controls(1), Textbox).text

But I get an error when I try the following:

System.InvalidCastException: Cast from type 'TextBox' to type 'Decimal' is
not valid.

Dim KW as Decimal
kw = cType(e.Item.Cells(1).Controls(1), Decimal)

What can I do to fix this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,070
Latest member
BiogenixGummies

Latest Threads

Top