如何在datagrid中以表格格式绑定结果 [英] how to bind result in table format in datagrid
本文介绍了如何在datagrid中以表格格式绑定结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
采用以下格式
in below format
<table class="style8" cellpadding="0" cellspacing="0">
<tr>
<td class="style13">
<asp:ImageButton ID="ImageButton144" runat="server" ImageUrl="~/Images/arrow.jpg" />
<asp:LinkButton ID="LinkButton142" runat="server" Font-Names="Trebuchet MS"
Font-Size="Small" ForeColor="Black" Font-Underline="False">Pet Walking</asp:LinkButton>
</td>
<td>
<asp:ImageButton ID="ImageButton146" runat="server" ImageUrl="~/Images/arrow.jpg" />
<asp:LinkButton ID="LinkButton144" runat="server" Font-Names="Trebuchet MS"
Font-Size="Small" ForeColor="Black" Font-Underline="False">Animal Fencing</asp:LinkButton>
</td>
<td>
<asp:ImageButton ID="ImageButton148" runat="server" ImageUrl="~/Images/arrow.jpg" />
<asp:LinkButton ID="LinkButton146" runat="server" Font-Names="Trebuchet MS"
Font-Size="Small" ForeColor="Black" Font-Underline="False">Pet House Sitting</asp:LinkButton>
</td>
<td>
<asp:ImageButton ID="ImageButton150" runat="server" ImageUrl="~/Images/arrow.jpg" />
<asp:LinkButton ID="LinkButton148" runat="server" Font-Names="Trebuchet MS"
Font-Size="Small" ForeColor="Black" Font-Underline="False">Breeding Services</asp:LinkButton>
</td>
<td>
<asp:ImageButton ID="ImageButton152" runat="server" ImageUrl="~/Images/arrow.jpg" />
<asp:LinkButton ID="LinkButton150" runat="server" Font-Names="Trebuchet MS"
Font-Size="Small" ForeColor="Black" Font-Underline="False">Animal Grooming</asp:LinkButton>
</td>
</tr>
<tr>
<td class="style13">
<asp:ImageButton ID="ImageButton145" runat="server" ImageUrl="~/Images/arrow.jpg" />
<asp:LinkButton ID="LinkButton143" runat="server" Font-Names="Trebuchet MS"
Font-Size="Small" ForeColor="Black" Font-Underline="False">Animal Boarding Kennels</asp:LinkButton>
</td>
<td>
<asp:ImageButton ID="ImageButton147" runat="server" ImageUrl="~/Images/arrow.jpg" />
<asp:LinkButton ID="LinkButton145" runat="server" Font-Names="Trebuchet MS"
Font-Size="Small" ForeColor="Black" Font-Underline="False">Vet Services</asp:LinkButton>
</td>
<td>
<asp:ImageButton ID="ImageButton149" runat="server" ImageUrl="~/Images/arrow.jpg" />
<asp:LinkButton ID="LinkButton147" runat="server" Font-Names="Trebuchet MS"
Font-Size="Small" ForeColor="Black" Font-Underline="False">Pet Training </asp:LinkButton>
</td>
<td>
<asp:ImageButton ID="ImageButton151" runat="server" ImageUrl="~/Images/arrow.jpg" />
<asp:LinkButton ID="LinkButton149" runat="server" Font-Names="Trebuchet MS"
Font-Size="Small" ForeColor="Black" Font-Underline="False">Pet Insurance</asp:LinkButton>
</td>
<td>
<asp:ImageButton ID="ImageButton153" runat="server" ImageUrl="~/Images/arrow.jpg" />
<asp:LinkButton ID="LinkButton151" runat="server" Font-Names="Trebuchet MS"
Font-Size="Small" ForeColor="Black" Font-Underline="False">Animal Removal</asp:LinkButton>
</td>
</tr>
推荐答案
好吧,因为它是一个表,所以您必须逐行进行操作以绑定结果集.表中没有直接方法可以做到这一点.
我看到Image&Linkbutton在每一行中都重复了-一种固定的布局.如果是这样,您可以尝试使用Datagrid代替.将字段与数据源映射,这应该向您显示结果.
试试吧!
Well, since it''s a table, you have to go row-by-row in order to bind the result set. No direct method in tables to do it.
I see Image & Linkbutton repeated all through each row - kind of fixed layout. If so, you can try using a Datagrid instead. Map the fields with the datasource and that should show you the result.
Try!
这篇关于如何在datagrid中以表格格式绑定结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文