2
<asp:DropDownList ID="ddlGroupSearch" CssClass="cssTextbox" runat="server">
    <asp:ListItem Value="1" Text="Referring Physician Wise"></asp:ListItem>
    <asp:ListItem Value="2" Text="Specialty Wise"></asp:ListItem>
</asp:DropDownList>


<asp:Repeater runat="server" ID="repeaterParent" OnItemDataBound="repeaterParent_ItemDataBound">
    <ItemTemplate>
        <tr>
            <td>                            
                <asp:Label ID="lblREF_PHY_ID" runat="server" Text='<%# this.RenderGroup(Eval("REF_PHY_ID") as string)%>'></asp:Label>
            </td>
        </tr>
        <tr>
            <td class="cssTableListTd">
                <asp:Label ID="lblPatNameListData" runat="server" Text='<%#Eval("Patient_Name")%>'></asp:Label>
            </td>
            <td class="cssTableListTd">
                <asp:Label ID="lblPatIDListData" runat="server" Text='<%#Eval("Patient_ID")%>'></asp:Label>
            </td>
            <td class="cssTableListTd">
                <asp:Label ID="lblPatSexListData" runat="server" Text='<%#Eval("Sex")%>'></asp:Label>
            </td>
            <td class="cssTableListTd">
                <asp:Label ID="lblPatBirthDateListData" runat="server" Text='<%#Eval("Patients_Birth_Date")%>'></asp:Label>
            </td>
        </tr>
    </ItemTemplate>
</asp:Repeater>

c#

protected void Page_Load(object sender, EventArgs e)
{
    //get data bind to repeater
    repeaterParent.DataSource = DataTable;
    repeaterParent.DataBind();.
}  

string lastValue = "";
protected string RenderGroup(string currentValue)
{
    if(currentValue == this.lastValue)
        return "";//Group has changed    
    this.lastValue = currentValue;
    return currentValue;
}

I have to show report group wise. I have a DropDownList in my page. Now according to the DropDownList value I have to call RenderGroup function. How should I call in repeater?

I have taken a reference of this link ref link

Community
  • 1
  • 1
ND's
  • 2,155
  • 6
  • 38
  • 59

1 Answers1

0

Did you tried by applying group by functionality in to DataTable that you are binding to repeater?

I am pointing to something like below.

Ref: Link

Thanks!

M.K
  • 218
  • 3
  • 10