473,493 Members | 4,355 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Formatting issue with PropertyInfo.GetValue

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 ?

Dec 2 '05 #1
1 1741
Can someone help on this please.....

Dec 5 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
7388
by: gt | last post by:
I am trying to replicate the functionality of DataTextField/DataValueFields in an extended DropDownList control that I have created in order to provide a third value for each ListItem. This value...
3
1975
by: Oskar Lundgren | last post by:
I want to iterate over fields declared like this, using reflection (and there are good reasons for that): Protected WithEvents Foo1 As Bar Protected WithEvents Foo2 As Bar .... I use the...
15
8180
by: Charles Law | last post by:
I have adapted the following code from the MSDN help for PropertyInfo SetValue. In the original code, the structure MyStructure is defined as a class MyProperty, and it works as expected. There is...
0
417
by: Paul | last post by:
I'd like to iterate through the controls on pages within a dll. I can get a page's Controls in a PropertyInfo class but can't extract the ControlsCollection from there. Dim asm As =...
6
1189
by: ECathell | last post by:
I have a routine that compares 2 intances of the same object to see if there are any changes. The problem is that even though there are no changes, it tells me there are. I have even tried running a...
0
7146
by: SyZLaB | last post by:
I had a problem using system.reflection.propertyinfo.getvalue in vb - and searched a lots of newsgroups and libraries - but none had the solution to my problem - and it also seamed like many others...
2
2501
by: Carlos Rodriguez | last post by:
I have the following function in C#public void Undo(IDesignerHost host) { if (!this.componentName.Equals(string.Empty) && (this.member != null)) { IContainer container1 = (IContainer)...
1
3568
by: samueltilden | last post by:
I am writing a very generic DumpObject(object Obj) method. I can easily GetType() and GetType().GetProperties(). I can easily PropertyInfo.GetValue(Obj, null) for scalar variables. The...
1
4844
by: damiensawyer | last post by:
Hi, I need to invoke .getvalue and .setvalue on fieldinfo and propetyinfo objects. Even though they're both derived from MemberInfo, they don't share those two methods. I've finding myself...
0
6980
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7157
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
6862
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5452
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
4579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3078
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1397
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
637
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
282
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.