Home All Groups Group Topic Archive Search About

Getting an Object Properties value...

Author
13 Dec 2006 5:49 PM
RSH
I have a situation where I am creating a class (oValue) that contains two
properties "Name" and "Value".

I am using a thrid party grid control which has a DropDownList Control.  The
PopulateValueList function takes 3 arguments a list,the name field, and the
value field.
My issue outlined in the code below is that I am adding my Object reference
to the list, and then trying to specify the text and value fields (see the
arrow below).  The problem is that when I run the page I get "oValue" for
the display text in each row.  How do I correctly reference the Name
property, and the Value property when sending the values to the
PopulateValueList function?

Thanks!
Ron

Dim oList As New ArrayList

Dim oVal As oValue

oVal = New oValue("Full Time", "Full Time")

oList.Add(oVal)

oVal = New oValue("Part Time", "Part Time")

oList.Add(oVal)



Dim valList As Janus.Web.GridEX.GridEXValueListItemCollection

valList = column.ValueList

valList.PopulateValueList(oList, oVal.Name, oVal.Value) <--------------



Public Class oValue

Private mValue As String

Public Property Value() As String

Get

Return mValue

End Get

Set(ByVal Value As String)

mValue = Value

End Set

End Property

Private mName As String

Public Property Name() As String

Get

Return mName

End Get

Set(ByVal Value As String)

mName = Value

End Set

End Property

Public Sub New(ByVal id As String, ByVal name As String)

mName = name

mValue = id

End Sub

End Class

Author
14 Dec 2006 12:04 AM
RobinS
How about
  valList.PopulateValueList(oList, "Name", "Value")

I think it's probably looking for the name of the property
you are trying to bind to.

Robin S.
----------------------------------

Show quoteHide quote
"RSH" <way_beyond_o***@yahoo.com> wrote in message
news:%23mvgb8tHHHA.924@TK2MSFTNGP02.phx.gbl...
>I have a situation where I am creating a class (oValue) that contains
>two properties "Name" and "Value".
>
> I am using a thrid party grid control which has a DropDownList
> Control.  The PopulateValueList function takes 3 arguments a list,the
> name field, and the value field.
> My issue outlined in the code below is that I am adding my Object
> reference to the list, and then trying to specify the text and value
> fields (see the arrow below).  The problem is that when I run the page
> I get "oValue" for the display text in each row.  How do I correctly
> reference the Name property, and the Value property when sending the
> values to the PopulateValueList function?
>
> Thanks!
> Ron
>
> Dim oList As New ArrayList
>
> Dim oVal As oValue
>
> oVal = New oValue("Full Time", "Full Time")
>
> oList.Add(oVal)
>
> oVal = New oValue("Part Time", "Part Time")
>
> oList.Add(oVal)
>
>
>
> Dim valList As Janus.Web.GridEX.GridEXValueListItemCollection
>
> valList = column.ValueList
>
> valList.PopulateValueList(oList, oVal.Name, oVal.Value)
> <--------------
>
>
>
> Public Class oValue
>
> Private mValue As String
>
> Public Property Value() As String
>
> Get
>
> Return mValue
>
> End Get
>
> Set(ByVal Value As String)
>
> mValue = Value
>
> End Set
>
> End Property
>
> Private mName As String
>
> Public Property Name() As String
>
> Get
>
> Return mName
>
> End Get
>
> Set(ByVal Value As String)
>
> mName = Value
>
> End Set
>
> End Property
>
> Public Sub New(ByVal id As String, ByVal name As String)
>
> mName = name
>
> mValue = id
>
> End Sub
>
> End Class
>
>
Author
14 Dec 2006 1:22 PM
RSH
Silly me!

That was it...perfect!

Thanks!


Show quoteHide quote
"RobinS" <RobinS@NoSpam.yah.none> wrote in message
news:K_6dnYvlL9qKCB3YnZ2dnUVZ_umlnZ2d@comcast.com...
> How about
>  valList.PopulateValueList(oList, "Name", "Value")
>
> I think it's probably looking for the name of the property
> you are trying to bind to.
>
> Robin S.
> ----------------------------------
>
> "RSH" <way_beyond_o***@yahoo.com> wrote in message
> news:%23mvgb8tHHHA.924@TK2MSFTNGP02.phx.gbl...
>>I have a situation where I am creating a class (oValue) that contains two
>>properties "Name" and "Value".
>>
>> I am using a thrid party grid control which has a DropDownList Control.
>> The PopulateValueList function takes 3 arguments a list,the name field,
>> and the value field.
>> My issue outlined in the code below is that I am adding my Object
>> reference to the list, and then trying to specify the text and value
>> fields (see the arrow below).  The problem is that when I run the page I
>> get "oValue" for the display text in each row.  How do I correctly
>> reference the Name property, and the Value property when sending the
>> values to the PopulateValueList function?
>>
>> Thanks!
>> Ron
>>
>> Dim oList As New ArrayList
>>
>> Dim oVal As oValue
>>
>> oVal = New oValue("Full Time", "Full Time")
>>
>> oList.Add(oVal)
>>
>> oVal = New oValue("Part Time", "Part Time")
>>
>> oList.Add(oVal)
>>
>>
>>
>> Dim valList As Janus.Web.GridEX.GridEXValueListItemCollection
>>
>> valList = column.ValueList
>>
>> valList.PopulateValueList(oList, oVal.Name, oVal.Value) <--------------
>>
>>
>>
>> Public Class oValue
>>
>> Private mValue As String
>>
>> Public Property Value() As String
>>
>> Get
>>
>> Return mValue
>>
>> End Get
>>
>> Set(ByVal Value As String)
>>
>> mValue = Value
>>
>> End Set
>>
>> End Property
>>
>> Private mName As String
>>
>> Public Property Name() As String
>>
>> Get
>>
>> Return mName
>>
>> End Get
>>
>> Set(ByVal Value As String)
>>
>> mName = Value
>>
>> End Set
>>
>> End Property
>>
>> Public Sub New(ByVal id As String, ByVal name As String)
>>
>> mName = name
>>
>> mValue = id
>>
>> End Sub
>>
>> End Class
>>
>>
>
>