Click here to Skip to main content
15,893,381 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i want to add a Button to every Row in my Datagrid
and when some click that button it should update the current Row in Datagrid

C#
SqlConnection conn = new SqlConnection("Server= localhost; database=tailoringmng; integrated Security=true");
                SqlCommand cmd = new SqlCommand("undonetask",conn);
                cmd.CommandType = CommandType.StoredProcedure;
                SqlDataAdapter da = new SqlDataAdapter(cmd);
                
                if (conn == null && conn.State == ConnectionState.Closed)
                {
                    conn.Open();
                }

                    DataTable dt = new DataTable("myTable");
                    da.Fill(dt);
                    
                dgridstatus.DataSource = dt.DefaultView;
                conn.Close();
                }

this is my code i have no idea how to select selected row from Datagrid
and how should i add button
Posted
Comments
Madhu Nair 7-Feb-14 1:41am    
You are trying to do this on WinForms or in ASP.Net?
abdul manan 7 7-Feb-14 2:12am    
winform

1 solution

 
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