I have a repeater who has to be populated with output from a function which gives values from a class getAgentGroup as IEnumerables
<asp:Repeater ID="RepeaterAgentGroups" runat="server">
<ItemTemplate>
<asp:CheckBox ID="chkAgentGroup" runat="server" />
<asp:Label ID="lblAgentGroupName" runat="server" Text='<%#Eval("Group.Name") %>'></asp:Label>
</ItemTemplate>
</asp:Repeater>
Public Function GetAgentGroups(agentName As String) As IEnumerable(Of GroupAgentRelation)
Dim agent As Datalayer.Agent = Datalayer.Agent.For(mTenant).GetAgent(agentName)
If Not agent Is Nothing Then
Return agent.GroupRelations
End If
Return New List(Of GroupAgentRelation)
End Function
public GroupRelation(Group group, User user, bool fix, bool active, eGroupMemberRole role)
{
this.Group = group;
this.User = user;
this.Fixed = fix;
this.Active = active;
this.Role = role;
}
}
public class GroupAgentRelation : GroupRelation
{
public Agent Agent;
public class Factory
{
public virtual GroupAgentRelation CreateNew(Group group, Agent agent, bool fix, bool active)
{
return new GroupAgentRelation(group, agent, fix, active);
}
}
public GroupAgentRelation(Group group, Agent agent, bool fix, bool active)
: base(group, agent.User, fix, active, eGroupMemberRole.None)
{
this.Agent = agent;
}
}
Ho do i populate labels in repeater with group name and checkbox state based on active and fixed.. Also how do i know which checkbox is checked while saving snce they are not named according to group name.