|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Getting an Object Properties value...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 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 > > 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 >> >> > >
Q: DataColumn Expressions
What is WebBrowser control called now? Manipulating controls created by another thread Estimates on money lost because of VB.NET The below snippet does not work...anyone know how to reference a procedure? Form1.closing in VB2005??? DateTime Q: DataView with Table with large number of rows Services Grants Help referencing control backgorund image |
|||||||||||||||||||||||