在网格视图中使用复选框 [英] using of check box in the grid view

查看:81
本文介绍了在网格视图中使用复选框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友,

我正在使用一个具有9列的网格视图,另一个是复选框字段列..因此,当我在特定的复选框字段中进行选中时,必须在其中将相应的行更新为参加"数据库..

在9列中,我有一列为状态",其中该列的值是正在处理"或正在参加" ..现在我仅在处理投诉的情况下才进行此类操作通过选中网格中的相应复选框,指导如何更新网格中特定行的状态.

我将网格的显示附加在Word文件中,通过它你可能会得到一个清晰的主意,请检查我是否非常需要. .

C:\ Documents and Settings \ admin \ Desktop \ grid.docx




谢谢,
praveen

hello friends,

I''m using the one grid view having of 9 columns and other one is of check box field column.. so when I make checked in the particular check box field then that respective row must be get updated as ''Attended'' in the database..

here out of 9columns i have one column as ''status'' where the value this column is either ''Under Process'' or ''Attended''..right now i''m fetching only under process complaints only so kindly plz guide how the status of the particular row in the grid is updated by checking on the respective check boxes in the grid.

frinds i''m attaching the display of the grid in the word file by which u may get an clear idea plz check it i''m very much indeed needed . .

C:\Documents and Settings\admin\Desktop\grid.docx




Thx,
praveen

推荐答案

DataGridDemo [ ^ ]请参阅复选框和文本框"部分
DataGridDemo[^] See the section Checkboxes and TextBoxes


在aspx页面上

On aspx page

<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" xmlns:asp="#unknown">
                   DataKeyNames="PAY_DET_ID" HorizontalAlign="Left"  CellPadding="2"
                    Width="100%" BorderWidth="1px"

                   CaptionAlign="Bottom" CellSpacing="1" >
                       <headerstyle forecolor="#0066CC" />
                       <pagerstyle font-bold="True" font-size="Small" />
                       <rowstyle bordercolor="#999966" borderstyle="Dashed" borderwidth="1px" />
                       <columns>

                           <asp:templatefield headertext="Select">
                           <itemtemplate>
                           <asp:checkbox id="chkSelect" runat="server" oncheckedchanged="CheckBox1_CheckedChanged" autopostback="true" />
                           </itemtemplate>

                           </asp:templatefield>
                           <asp:boundfield datafield="column1" headertext="column1" />
                           <asp:boundfield datafield="column2" headertext="column1" />
                           <asp:boundfield datafield="column3" headertext="column1" />
                           </columns>
                   </asp:gridview>



并在CS页面上



and on cs page

protected void CheckBox1_CheckedChanged(object sender, EventArgs e)
   {
       // Make connection and update the column in database using GridView1.SelectedValue which is datakey of gridview

   }


这篇关于在网格视图中使用复选框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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