Click here to Skip to main content
15,884,976 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,
I have designed the Grid inside the listview i need to bind the data to grid which is inside the listview.
ASP.NET
<asp:ListView ID="lvContent" runat="server" OnPagePropertiesChanging="lvContent_PagePropertiesChanging" OnItemDataBound="lvContent_OnItemDataBound">
                <LayoutTemplate>
                    <blockquote>
                        <asp:PlaceHolder runat="server" ID="itemPlaceholder"></asp:PlaceHolder>
                    </blockquote>
                </LayoutTemplate>
                <ItemTemplate>
                    <div class="listalign" id="divStaffRoster">
                        <div class="span12" style="removed: relative;">
                            <img src='<%# GetImage(Eval("ImageValue").ToString())%>' alt="image" height="120" width="120" style="height: 100px; width: 100px; margin-bottom: 10px; margin-right: 10px; margin-top: 0;" />

                            <div style="margin-removed 3px; removed: absolute; display: inline-block;">
                                <div class="row-fluid">
                                    <div style="width: 100%; margin-removed 10px">
                                        <asp:Label ID="lblStaffName" runat="server" Font-Bold="True" Text="Staff Name :" />
                                        <asp:Label ID="lblFirstNamevalue" runat="server" Text='<%#Eval("FullName") %>'>
                                        </asp:Label>
                                    </div>
                                </div>
                                <div class="row-fluid">
                                    <div style="width: 100%;">
                                        <asp:Label ID="lblStaffCode" runat="server" Text="Staff Code :" Font-Bold="True" />
                                        <asp:Label ID="lblStatusValue" runat="server" Text='<%#Eval("StaffCode") %>'>
                                        </asp:Label>
                                    </div>
                                </div>
                                <div class="row-fluid">
                                    <div style="width: 100%;">
                                        <asp:Label ID="lbStafftype" runat="server" Font-Bold="True" Text="Staff Type :" />
                                        <asp:Label ID="lblStaffType" runat="server" Text='<%#Eval("StaffTypeCd") %>'>
                                        </asp:Label>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <asp:GridView ID="InnerListView" runat="server" AutoGenerateColumns="False" >

                        <Columns>
                            <asp:TemplateField HeaderText="Subject">
                                <ItemTemplate>
                                    <asp:Label ID="Label0" runat="server" Text='<%#Eval("Subject") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="MarksObtained">
                                <ItemTemplate>
                                    <asp:Label ID="lbl1" runat="server" Text='<%#Eval("MarksObtained") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="OutOff">
                                <ItemTemplate>
                                    <asp:Label ID="lbl1" runat="server" Text='<%#Eval("OutOff") %>'></asp:Label>
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>
                </ItemTemplate>
                <EmptyDataTemplate>
                    <div style="width: 100%; text-align: center">
                        <h3>No Data found.</h3>
                    </div>
                </EmptyDataTemplate>
            </asp:ListView>

Can you please tell me how to bind the grid inside listview.
Posted

1 solution

Hi Siva,

its very simple write data loading functionality for grid view inside List View Item Data Bound

this one will help you
http://stackoverflow.com/questions/19466178/find-gridview-inside-listview[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900