S
snowburnt
I have a dropdownlist inside of a datalist.
this is what I've done to try to get data to it:
private void DisplayTicketData_ItemDataBound(object sender,
DataListItemEventArgs e){
DropDownList ddl;
ddl = (DropDownList)e.Item.FindControl("Owner");
ddl.Items.Add(new ListItem("happy","happy"));
ddl.Items.Add(new ListItem("1","happy2"));
}
the ASP:
<aspataList ID="DisplayTicketData"....>
...
<aspropDownList ID="Owner" />
...
</aspataList>
I tried more complicated databinding with this function, but if I
can't even get it to work with adding them like this, I figured there
was something wrong with my function.
all it gives me is a blank dropdown list.
Thanks in advance!
let me know if you need any more info.
--Bart
this is what I've done to try to get data to it:
private void DisplayTicketData_ItemDataBound(object sender,
DataListItemEventArgs e){
DropDownList ddl;
ddl = (DropDownList)e.Item.FindControl("Owner");
ddl.Items.Add(new ListItem("happy","happy"));
ddl.Items.Add(new ListItem("1","happy2"));
}
the ASP:
<aspataList ID="DisplayTicketData"....>
...
<aspropDownList ID="Owner" />
...
</aspataList>
I tried more complicated databinding with this function, but if I
can't even get it to work with adding them like this, I figured there
was something wrong with my function.
all it gives me is a blank dropdown list.
Thanks in advance!
let me know if you need any more info.
--Bart