带有选定列的gridview可编辑 [英] gridview with selected columns editable

查看:63
本文介绍了带有选定列的gridview可编辑的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的项目中,我每个月都要更新一次机器值.我需要将数据从数据库获取到只有一个列是可编辑的gridview.

In my project ihave to update machine values in every month.I need to get data from database to a gridview with only one column is editable. How can I do it?

推荐答案

您数据库中的数据是固定的,意味着列已固定,然后使用

your data from database is fix means the column is fixed then use the

<asp:GridView ID="GridView1" runat="server" BackColor="White" BorderColor="#e9ecef" AutoGenerateColumns="False"

           BorderStyle="None" BorderWidth="1px" CellPadding="4" ForeColor="Black" GridLines="Vertical"

           OnRowDataBound="GridView1_RowDataBound" OnRowCommand="GridView1_RowCommand" OnRowUpdating="GridView1_RowUpdating" ShowFooter="True">
           <Columns>
               <asp:ButtonField Text="SingleClick" CommandName="SingleClick" Visible="False"/>
               <asp:TemplateField HeaderText="Id">
                   <ItemTemplate>
                       <asp:Label ID="IdLabel" runat="server" Text='<%# Eval("Id") %>'></asp:Label>
                   </ItemTemplate>
               </asp:TemplateField>
               <asp:TemplateField HeaderText="Task">
                   <ItemTemplate>
                       <asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval("Description") %>'></asp:Label>
                       <asp:TextBox ID="Description" runat="server" Text='<%# Eval("Description") %>' Width="175px" visible="false"></asp:TextBox>
                   </ItemTemplate>
               </asp:TemplateField>


..........


..........


这篇关于带有选定列的gridview可编辑的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆