last day (16 days later) » 

9:15 PM
0
A: Set dropdown list inside repeater

Paolo CostaNo, I don't think it's possible do do something like that. Anyway, what's the need to bind an Id as you know you have only two values? You can simply write <asp:DropDownList ID="ddlContact" runat="server"> <asp:ListItem Text="select" Value="0" Selected="True" ></asp:ListItem> <asp:ListItem T...

 
How can i find out that which inspector has which selected value?
 
loop the repeater items and for each item call (item.FindControl("ddlContact") as DropDownList).SelectedValue. You need the code in an answer so it's more clear?
 
loop would give me a selected value but it won't tell me the inspector id.
 
You have sto store the id in another control inside the repeater, for example a hidden field that you can referecnce in the same way (findControl etc...)
 
sorry for not being very clear. Inspector id is already in the other cell of the table. First cell has inspector id and other one has dropdown.
 
9:15 PM
please show me the cell definition
 
<ItemTemplate>
<tr id="clmRow" runat="server">
<td align="center"><%#DataBinder.Eval(Container.DataItem, "InspectorID").ToString%></td>

<td style="text-align: center">
<asp:DropDownList ID="ddlContact" runat="server">
<asp:ListItem Text="select" Value="0" Selected="True" ></asp:ListItem>
<asp:ListItem Text="phone" Value='<%#DataBinder.Eval(Container.DataItem, "InspectorID").ToString() + "|phone" %>' ></asp:ListItem>
<asp:ListItem Text="email" Value='<%#DataBinder.Eval(Container.DataItem, "InspectorID").ToString() + "|email" %>' ></asp:ListItem>
 
Ok, so it's better if you define it in a literal <asp:literal id="litInspectorId" runat="server" /> and fill it in the ItemDataboundEventHandler. Do you know how to do it?
 
yes
or i can add label and set in itembound event
 
label or literal is almost the same
 
Dim id As Label = CType(e.Item.FindControl("inspectorid"), Label)
 
9:20 PM
Perfect :-)
Do you still need my help? It's very late here and I need to go to bed :-)
 
no thanks for your help
 
don't forget to upvote or approve something :-) Bye
 
i will :)
 
9:43 PM
hi
you there
 

  last day (16 days later) »