如何在asp.net中显示GridView Inside ListView [英] How to display GridView Inside ListView in asp.net
本文介绍了如何在asp.net中显示GridView Inside ListView的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
我在listview中设计了Grid,我需要将数据绑定到listview中的网格。
Hi All,
I have designed the Grid inside the listview i need to bind the data to grid which is inside the listview.
<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>
你能告诉我如何在listview中绑定网格。
Can you please tell me how to bind the grid inside listview.
推荐答案
嗨西瓦,
它非常简单的写数据加载函数列表视图中的网格视图的内容项目数据绑定
这一个将帮助您
http://stackoverflow.com/questions/19466178/find-gridview-inside-listview [ ^ ]
这篇关于如何在asp.net中显示GridView Inside ListView的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文