Ask a Question related to ASP.NET General, Design and Development.
-
DesignerX #1
binding datasource to dropdownlist control
I am being sent an ArrayList of ListItems.
I can bind to a dropdownlist control using:
oDropDownList.DataSource = oArrayList
This works but when the dropdownlist is rendered both the select box value
and the text are the same (The ListItem.Text), How do I get the
ListItem.Text to render as the text and the ListItem.Value to be the html
select option 'value'?
Thank You,
Stan
DesignerX Guest
-
Binding an array to a DropDownList
Hi all, I'd like to bind an array to a DropDownList and use the array index as the DataValueField. Is this possible? Thanks, Paul -
How to get DataSource for a DropDownList in a Dynamic DataGrid?
Howdy! I am in the midsts of converting some DataGrids which were previously built in HTML into dynamicly added DataGrids which will be called... -
How to gat DataSource for a DropDownList in a Dynamic DataGrid?
Howdy! I am in the midsts of converting some DataGrids which were previously built in HTML into dynamicly added DataGrids which will be called... -
Binding a DropDownList in a DataGrid
none of these links to INDIA work... "Saravana" <saravank@sct.co.in> wrote in message news:O0#0lqDRDHA.3796@tk2msftngp13.phx.gbl...... -
Error Binding DropDownList on EditItem Command of DataGrid Control
I am sure this has come up before, but I haven't been able to find an answer as of yet. That said, any help is definitely appreciated! I have a... -
Saravana #2
Re: binding datasource to dropdownlist control
Use DataTextField and DataValueField properties of dropdownlist to assign
text and value for dropdownlist.
--
Saravana
Microsoft India Community Star,
MCAD,SE,SD,DBA.
"DesignerX" <designerx2@yahoo.com> wrote in message
news:fL-dnQd3Gd_n_oGiRTvUog@giganews.com...> I am being sent an ArrayList of ListItems.
>
> I can bind to a dropdownlist control using:
>
> oDropDownList.DataSource = oArrayList
>
> This works but when the dropdownlist is rendered both the select box value
> and the text are the same (The ListItem.Text), How do I get the
> ListItem.Text to render as the text and the ListItem.Value to be the html
> select option 'value'?
>
> Thank You,
> Stan
>
>
Saravana Guest
-
DesignerX #3
Re: binding datasource to dropdownlist control
Saravana,
Thanks for the reply, unfortunately that is my problem... I do not know how
to use the DataValueField property without looping thru the entire
ArrayList. With an ArrayList of ListItems, how would I use the
DataValueField to refer property to refer to a property of the object within
the array?
Thanks,
Stan
"Saravana" <saravank@sct.co.in> wrote in message
news:Oey3gNAUDHA.2088@TK2MSFTNGP10.phx.gbl...value> Use DataTextField and DataValueField properties of dropdownlist to assign
> text and value for dropdownlist.
>
> --
> Saravana
> Microsoft India Community Star,
> MCAD,SE,SD,DBA.
>
>
> "DesignerX" <designerx2@yahoo.com> wrote in message
> news:fL-dnQd3Gd_n_oGiRTvUog@giganews.com...> > I am being sent an ArrayList of ListItems.
> >
> > I can bind to a dropdownlist control using:
> >
> > oDropDownList.DataSource = oArrayList
> >
> > This works but when the dropdownlist is rendered both the select boxhtml> > and the text are the same (The ListItem.Text), How do I get the
> > ListItem.Text to render as the text and the ListItem.Value to be the>> > select option 'value'?
> >
> > Thank You,
> > Stan
> >
> >
>
DesignerX Guest



Reply With Quote

