Click here to Skip to main content
15,902,114 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Comments
Sunasara Imdadhusen 7-Oct-11 9:56am    
Please provide snippet of code. so we can give proper solution.
[no name] 7-Oct-11 11:54am    
This isn't an email. You can't attach anything.

DataGridDemo[^] See the section Checkboxes and TextBoxes
 
Share this answer
 
On aspx page

C#
<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>


and on cs page

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

   }
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900