(asp.net C#)如何隐藏gridview列
(asp.netC#)如何隐藏gridview列(注意:一列(操作)中有两个数据我只要隐藏“删除”)如图:前台:<asp:GridViewID="upload1"runa...
(asp.net C#)如何隐藏gridview列(注意:一列(操作)中有两个数据 我只要隐藏“删除”)
如图:
前台: <asp:GridView ID="upload1" runat="server" AutoGenerateColumns="False"
CellPadding="4" DataKeyNames="Id" ForeColor="#333333" GridLines="None"
onrowdatabound="upload_RowDataBound" onrowdeleting="upload_RowDeleting"
Width="600px">
<RowStyle BackColor="#EFF3FB" />
<Columns>
<asp:BoundField DataField="FileName" HeaderText="文件描述" />
<asp:BoundField DataField="FileType" HeaderText="文件类型" />
<asp:BoundField DataField="Size" HeaderText="文件大小(B)" />
<asp:TemplateField HeaderText="预览">
<ItemTemplate>
<a href='../<%#Eval("FilePath")%>'>预览</a>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
CommandName="Delete" Text="删除" OnClientClick="return confirm('您确认要删除所上传的文件吗?');" ></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#2461BF" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView> 展开
如图:
前台: <asp:GridView ID="upload1" runat="server" AutoGenerateColumns="False"
CellPadding="4" DataKeyNames="Id" ForeColor="#333333" GridLines="None"
onrowdatabound="upload_RowDataBound" onrowdeleting="upload_RowDeleting"
Width="600px">
<RowStyle BackColor="#EFF3FB" />
<Columns>
<asp:BoundField DataField="FileName" HeaderText="文件描述" />
<asp:BoundField DataField="FileType" HeaderText="文件类型" />
<asp:BoundField DataField="Size" HeaderText="文件大小(B)" />
<asp:TemplateField HeaderText="预览">
<ItemTemplate>
<a href='../<%#Eval("FilePath")%>'>预览</a>
<asp:LinkButton ID="LinkButton1" runat="server" CausesValidation="False"
CommandName="Delete" Text="删除" OnClientClick="return confirm('您确认要删除所上传的文件吗?');" ></asp:LinkButton>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
<SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
<HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
<EditRowStyle BackColor="#2461BF" />
<AlternatingRowStyle BackColor="White" />
</asp:GridView> 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询