I have the following repeater item:

<asp:Repeater ID="RptLeaveRequests" runat="server" 
        onitemdatabound="RptLeaveRequests_ItemDataBound">
<ItemTemplate>
    <table id="tableItem" runat="server">
        <tr>
                <td style="width: 100px;">
                    <asp:Label ID="lblDate" runat="server" Text='<%#Eval("Date", "{0:dd/M/yyyy}") %>'></asp:Label>
                </td>
                <td style="width: 100px;">
                    <asp:Label ID="lblHours" runat="server" Text='<%#Eval("Hours") %>'></asp:Label>
                </td>
                <td style="width: 200px;">
                    <asp:Label ID="lblPeriod" runat="server" Text='<%#Eval("AMorPM") %>'></asp:Label>
                </td>
                <td style="width: 200px; font-size:10px;">
                    <asp:Label ID="lblNote" runat="server" Text='<%#Eval("Note") %>'></asp:Label>
                </td>
                <td style="50px">
                    <asp:RadioButtonList ID="rbtVerified" runat="server" >
                        <asp:ListItem Value="1">Accept</asp:ListItem>
                        <asp:ListItem Value="2">Reject</asp:ListItem>
                    </asp:RadioButtonList>
                </td>
                <td>
                    <asp:TextBox ID="txtNotes" runat="server" ></asp:TextBox>
                </td>
            </tr>
    </table>
</ItemTemplate>
</asp:Repeater>

on page load I am binding the Repeater:

else if(Convert.ToInt32(Session["UserLevel"]) != 0 && Convert.ToInt32(Session["UserLevel"]) < 151)
{
       RptLeaveRequests.DataSource = newLeaveLogic().GetManagerUnverifiedLeaveRequests(Convert.ToInt32(Context.User.Identity.Name));
       hasRequests = true;
       RptLeaveRequests.DataBind();
}

The GetManagerUnverifiedLeaveRequests method returns a DataTable with EmployeeId (int) , Date, Hours, AMorPM and Note.
Now I would like to Group the data (Data,Hours,AMorPM and Note) retrieved from the DataTable for each different EmployeeId in the following method, but I am not sure how to proceed:

protected void RptLeaveRequests_ItemDataBound(object sender, RepeaterItemEventArgs e)
{
       if (hasRequests)
       {
             //grouping
       }
}

I have tried to follow this example but I could not understand / interpret the code behind for the OnRowDataBound for the data.

Member Avatar for LastMitch

I have tried to follow this example but I could not understand / interpret the code behind for the OnRowDataBound for the data.

@cirbab4

I know you are new to Daniweb, but I'm not sure why you post a link to the code from stackoverflow and post the code here? There's nothing wrong with the code. I know you are having a hard time implying the code to your own code, you need to post your existing code.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.