Gridview inside ListView Control
-
Hi, U mean,inside Gridview, Listbox is a Itemtemplate... page_load() { u have to create the function as a dataset, within the function u have to take the id,text from the query. } DesingView: Then u have to call the function like, regards, kannak....
kannak
-
Hi, U mean,inside Gridview, Listbox is a Itemtemplate... page_load() { u have to create the function as a dataset, within the function u have to take the id,text from the query. } DesingView: Then u have to call the function like, regards, kannak....
kannak
-
Insert a Grid View in item Template of ListView view below code The code is tested .
<asp:ListView ID="ListView1" runat="server"
onitemdatabound="ListView1_ItemDataBound1">
<LayoutTemplate>
<table border="0" cellpadding="3" cellspacing="0" width="97%">
<tr class="lstheader">
<td width="15%">
Col one</td>
<td width="15%">
Grid Column</td></tr> <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder> </table> </LayoutTemplate> <ItemTemplate> <tr > <td> <asp:Label ID="lblDate" runat="server" Text='<%#Bind("DepartmentID") %>'></asp:Label> </td> <td> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"> <Columns> <asp:BoundField HeaderText="Department" DataField="Department" /> </Columns> </asp:GridView> </td> </tr> </ItemTemplate> <AlternatingItemTemplate> <tr > <td> <asp:Label ID="lblDate" runat="server" Text='<%#Bind("DepartmentID") %>'></asp:Label> </td> <td> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"> <Columns> <asp:BoundField HeaderText="Department" DataField="Department" /> </Columns> </asp:GridView> </td> </tr> </AlternatingItemTemplate> </asp:ListView>
now firstly Bind the ListView Control as below
protected void Page_Load(object s
-
Insert a Grid View in item Template of ListView view below code The code is tested .
<asp:ListView ID="ListView1" runat="server"
onitemdatabound="ListView1_ItemDataBound1">
<LayoutTemplate>
<table border="0" cellpadding="3" cellspacing="0" width="97%">
<tr class="lstheader">
<td width="15%">
Col one</td>
<td width="15%">
Grid Column</td></tr> <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder> </table> </LayoutTemplate> <ItemTemplate> <tr > <td> <asp:Label ID="lblDate" runat="server" Text='<%#Bind("DepartmentID") %>'></asp:Label> </td> <td> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"> <Columns> <asp:BoundField HeaderText="Department" DataField="Department" /> </Columns> </asp:GridView> </td> </tr> </ItemTemplate> <AlternatingItemTemplate> <tr > <td> <asp:Label ID="lblDate" runat="server" Text='<%#Bind("DepartmentID") %>'></asp:Label> </td> <td> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"> <Columns> <asp:BoundField HeaderText="Department" DataField="Department" /> </Columns> </asp:GridView> </td> </tr> </AlternatingItemTemplate> </asp:ListView>
now firstly Bind the ListView Control as below
protected void Page_Load(object s
-
It's working fine. Thanks. I need to expand and collapse the ID (Department-ID) the department details will be display in gridview or (listview). Plz help me.... Thanks.
Plz chk the below link. http://mattberseth.com/blog/2008/01/building_a_grouping_grid_with.html I need like this. Thanks.
-
It's working fine. Thanks. I need to expand and collapse the ID (Department-ID) the department details will be display in gridview or (listview). Plz help me.... Thanks.
You Can Use "CollapsiblePanelExtender" inside Listview for expand and collapse Below code.
<asp:ListView ID="ListView1" runat="server"
onitemdatabound="ListView1_ItemDataBound1">
<LayoutTemplate>
<table border="0" cellpadding="3" cellspacing="0" width="97%">
<tr >
<td width="15%">
Col one</td>
<td width="15%">
Grid Column</td></tr> <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder> </table> </LayoutTemplate> <ItemTemplate> <tr > <td> <asp:Label ID="lblDepartmentID" runat="server" Text='<%# Bind("DepartmentID") %>'></asp:Label> </td> <td> <asp:LinkButton CausesValidation="false" ID="lnkexp" runat="server">+</asp:LinkButton> <asp:LinkButton CausesValidation="false" ID="lnkCol" runat="server">-</asp:LinkButton> <asp:Label ID="Label3" runat="server" Text="panel"></asp:Label> <asp:Panel ID="pnl1" runat="server" > <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"> <Columns> <asp:BoundField HeaderText="Department" DataField="Department" /> </Columns> </asp:GridView> </asp:Panel> <cc1:CollapsiblePanelExtender ExpandControlID="lnkexp" CollapseControlID="lnkCol" TargetControlID="pnl1" ID="CollapsiblePanelExtender2" runat="server" TextLabelID="Label3" ExpandedText="collapse" CollapsedText="expand" SuppressPostBack="True" Collapsed="True"> </cc1:CollapsiblePanelExtender> </td> </tr> </ItemTemplate> <AlternatingItemTemplate> <tr > <td>
-
You Can Use "CollapsiblePanelExtender" inside Listview for expand and collapse Below code.
<asp:ListView ID="ListView1" runat="server"
onitemdatabound="ListView1_ItemDataBound1">
<LayoutTemplate>
<table border="0" cellpadding="3" cellspacing="0" width="97%">
<tr >
<td width="15%">
Col one</td>
<td width="15%">
Grid Column</td></tr> <asp:PlaceHolder ID="itemPlaceholder" runat="server"></asp:PlaceHolder> </table> </LayoutTemplate> <ItemTemplate> <tr > <td> <asp:Label ID="lblDepartmentID" runat="server" Text='<%# Bind("DepartmentID") %>'></asp:Label> </td> <td> <asp:LinkButton CausesValidation="false" ID="lnkexp" runat="server">+</asp:LinkButton> <asp:LinkButton CausesValidation="false" ID="lnkCol" runat="server">-</asp:LinkButton> <asp:Label ID="Label3" runat="server" Text="panel"></asp:Label> <asp:Panel ID="pnl1" runat="server" > <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false"> <Columns> <asp:BoundField HeaderText="Department" DataField="Department" /> </Columns> </asp:GridView> </asp:Panel> <cc1:CollapsiblePanelExtender ExpandControlID="lnkexp" CollapseControlID="lnkCol" TargetControlID="pnl1" ID="CollapsiblePanelExtender2" runat="server" TextLabelID="Label3" ExpandedText="collapse" CollapsedText="expand" SuppressPostBack="True" Collapsed="True"> </cc1:CollapsiblePanelExtender> </td> </tr> </ItemTemplate> <AlternatingItemTemplate> <tr > <td>