日期:2014-05-17 浏览次数:20387 次
<asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False" DataKeyNames="id" CssClass="Fontsmall" onpageindexchanging="GridView1_PageIndexChanging" onrowdatabound="GridView1_RowDataBound" Width = "100%" onrowcommand="GridView1_RowCommand" onrowcreated="GridView1_RowCreated" > <Columns> <asp:TemplateField HeaderText = "设备情况1" > <ItemTemplate> <asp:Image ID="Image1" runat="server" ImageUrl ='<%# GetUrl( (string)Eval("qk1")) %>'/> </ItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText = "设备情况2" > <ItemTemplate> <asp:Image ID="Image2" runat="server" ImageUrl ='<%# GetUrl( (string)Eval("qk2")) %>'/> </ItemTemplate> </asp:TemplateField> </Columns> </GridView>
protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e) { e.Row.Cells[0].Visible = false; e.Row.Cells[1].Visible = false; }