Formatting issue with PropertyInfo.GetValue

  • Thread starter Thread starter Learner
  • Start date Start date
L

Learner

I am using Reflection to get values of some of the controls in a
datagrid. One of the control is a DropDownbox, but I cannot get to see
the EXCACT "selectedItem" property value using this.

It works, but the only thing is wont seem to keep the ACTUAL format.

For Ex: ViewSource has the value HTML like this
<option selected="selected" value="1.0">1.0</option>
So, I was expecting GetValue.ToString() to return EXCAT "1.0", but
unfortunately it return only "1" which is not what I want. Somehoe, its
converting anf formatting it as a integer.

If the HTML is like , <option selected="selected"
value="1.1">1.1</option>, GetValue.ToString() will give EXACT "1.1" as
desired.

If the HTML is like , <option selected="selected"
value="ALL">"ALL"</option>, GetValue.ToString() will give EXACT "ALL"
as desired.

The dropdown can contain either numeric (1.0 or 1.9 etc) or string
(ALL) data.

Anythoughts on how to get a "1.0" while that is the seelcted item ?
 
Back
Top