GridView-----Finde
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="false" SkinID="GridView_DefaultSkin"
AllowSorting="true" DataKeyNames="FCaseReportID,FIsView,FSendDate,FReferServiceID"
OnSorting="GridView1_Sorting" AllowPaging="True" OnPageIndexChanging="GridView1_PageIndexChanging"
OnRowDeleting="GridView1_RowDeleting" OnRowEditing="GridView1_RowEditing">
............
<asp:BoundField DataField="FIsView" HeaderText="完成情况" SortExpression="FIsView"></asp:BoundField>
</asp:GridView>
我想在CS代码里面把"完成情况"这一列隐藏因该怎么做?
------解决方案--------------------<asp:BoundField DataField="FIsView" HeaderText="完成情况" SortExpression="FIsView" Visible=false> </asp:BoundField >
------解决方案-------------------- 把你的判断条件写出来..
可以尝试:
Visible=<%=num>1?"false":"true"%>
------解决方案--------------------ls的正解
------解决方案--------------------gridView.Columns[0].Visible = false;
隐藏第0列
------解决方案--------------------gridView.Columns[0].Visible = false;