H
Hugo Flores
I bound the items of a DropDownList with an ObjectDataSource, but I
also want to add a new item at top with an option that would say All,
and an emtpy value.
I tried this
Private Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
ddl.Items.Insert(0, New ListItem("All", ""))
End Sub
But that doesn't work
This is my .aspx code
<aspropDownList ID="ddl" runat="server"
DataSourceID="ObjectDataSource1" DataTextField="name"
DataValueField="id">
</aspropDownList>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
SelectMethod="GetAllEntities"
TypeName="Entities"></asp:ObjectDataSource>
I'm pretty sure, there is a way, I just don't know how
Thanks
also want to add a new item at top with an option that would say All,
and an emtpy value.
I tried this
Private Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
ddl.Items.Insert(0, New ListItem("All", ""))
End Sub
But that doesn't work
This is my .aspx code
<aspropDownList ID="ddl" runat="server"
DataSourceID="ObjectDataSource1" DataTextField="name"
DataValueField="id">
</aspropDownList>
<asp:ObjectDataSource ID="ObjectDataSource1" runat="server"
SelectMethod="GetAllEntities"
TypeName="Entities"></asp:ObjectDataSource>
I'm pretty sure, there is a way, I just don't know how
Thanks