<asp:Repeater ID="rpt_power" runat="server"
onitemdatabound="rpt_power_ItemDataBound">
<ItemTemplate>
<tr>
<td height="37">
<asp:Label ID="Label1" runat="server" Text='<%#Eval("id")%>'></asp:Label><%#Eval("ModelName")%></td>
<td>
<asp:DropDownList ID="chk_power" runat="server">
</asp:DropDownList>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
==============================================================================================================================
protected void rpt_power_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.EditItem)
{
Label Label1 = (Label)e.Item.FindControl("Label1");
int id = int.Parse(Label1.Text);
List<BAOLISMS.Model.tfunction> tfunctionlist = tfunctionBLL.GetModelList("ModelId=" + id + "");
DropDownList mychk = e.Item.FindControl("chk_power") as DropDownList;
if (tfunctionlist.Count > 0)
{
mychk.DataSource = tfunctionlist;
mychk.DataTextField = "FunctionName";
mychk.DataValueField = "Id";
mychk.DataBind();
}
}
}
onitemdatabound="rpt_power_ItemDataBound">
<ItemTemplate>
<tr>
<td height="37">
<asp:Label ID="Label1" runat="server" Text='<%#Eval("id")%>'></asp:Label><%#Eval("ModelName")%></td>
<td>
<asp:DropDownList ID="chk_power" runat="server">
</asp:DropDownList>
</td>
</tr>
</ItemTemplate>
</asp:Repeater>
==============================================================================================================================
protected void rpt_power_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.EditItem)
{
Label Label1 = (Label)e.Item.FindControl("Label1");
int id = int.Parse(Label1.Text);
List<BAOLISMS.Model.tfunction> tfunctionlist = tfunctionBLL.GetModelList("ModelId=" + id + "");
DropDownList mychk = e.Item.FindControl("chk_power") as DropDownList;
if (tfunctionlist.Count > 0)
{
mychk.DataSource = tfunctionlist;
mychk.DataTextField = "FunctionName";
mychk.DataValueField = "Id";
mychk.DataBind();
}
}
}