悬赏园豆:50
[已关闭问题]
<P>源代码如下:<BR><asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" Font-Size="Medium" ForeColor="#333333" Width="100%" OnRowDataBound="GridView1_RowDataBound" DataKeyNames="id,corpName" OnRowCreated="GridView1_RowCreated"><BR> <Columns><BR> <asp:TemplateField HeaderText="选择"><BR> <ItemTemplate><BR> <asp:CheckBox ID="CheckBox1" runat="server" /><BR> </ItemTemplate><BR> </asp:TemplateField><BR> <asp:BoundField HeaderText="序号"><BR> <HeaderStyle BackColor="Transparent" /><BR> </asp:BoundField><BR> <asp:BoundField DataField="corpName" HeaderText="单位名称" /><BR> <asp:BoundField DataField="date" HeaderText="添加日期" /><BR> </Columns><BR> <PagerSettings FirstPageText="第一页" LastPageText="最末页" NextPageText="下一页" Mode="NextPreviousFirstLast" PreviousPageText="前一页" /><BR> <FooterStyle BackColor="#B0DEDB" Font-Bold="True" /><BR> <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /><BR> <EmptyDataTemplate><BR> <table><BR> <tr><BR> <td><BR> 选择<BR> </td><BR> <td>序号</td><BR> <td>单位名称</td><BR> <td>添加日期</td><BR> </tr><BR> </table><BR> </EmptyDataTemplate><BR> </asp:GridView><BR>这样绑定的所有数据都是正常的,但是我将单位名称这一列转换为摸板后,运行时单位名称却没有绑定任何数据,请什么原因?</P>
<P>------------------</P>
<P>点击转换为摸板后的代码:<BR><asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" Font-Size="Medium" ForeColor="#333333" Width="100%" OnRowDataBound="GridView1_RowDataBound" DataKeyNames="id,corpName" OnRowCreated="GridView1_RowCreated"><BR> <Columns><BR> <asp:TemplateField HeaderText="选择"><BR> <ItemTemplate><BR> <asp:CheckBox ID="CheckBox1" runat="server" /><BR> </ItemTemplate><BR> </asp:TemplateField><BR> <asp:BoundField HeaderText="序号"><BR> <HeaderStyle BackColor="Transparent" /><BR> </asp:BoundField><BR> <asp:TemplateField HeaderText="单位名称"><BR> <EditItemTemplate><BR> <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("corpName") %>'></asp:TextBox><BR> </EditItemTemplate><BR> <ItemTemplate><BR> <asp:Label ID="Label1" runat="server" Text='<%# Bind("corpName") %>'></asp:Label><BR> </ItemTemplate><BR> </asp:TemplateField><BR> <asp:BoundField DataField="date" HeaderText="添加日期" /><BR> </Columns><BR> <PagerSettings FirstPageText="第一页" LastPageText="最末页" NextPageText="下一页" Mode="NextPreviousFirstLast" PreviousPageText="前一页" /><BR> <FooterStyle BackColor="#B0DEDB" Font-Bold="True" /><BR> <PagerStyle BackColor="#666666" ForeColor="White" HorizontalAlign="Center" /><BR> <EmptyDataTemplate><BR> <table><BR> <tr><BR> <td><BR> 选择<BR> </td><BR> <td>序号</td><BR> <td>单位名称</td><BR> <td>添加日期</td><BR> </tr><BR> </table><BR> </EmptyDataTemplate><BR> </asp:GridView></P>
seek
|
初学一级
|
园豆:
140
提问于:2008-08-12 22:52