I'm trying to select multiple rows in a DGV and then do something with them(delete them for example) and then apply these changes to DB. and I'm using sql server express. the problem is when i load data from a table that is bound to the DGV and then try to check the rows, only one row will be checked and as soon as i click on another row(either a checkbox or somewhere else) the other checkbox goes unchecked. i looked into the properties of the DGV and the checkbox column but couldn't figure out the problem. oh and the checkbox column is the only column in the DGV that is not bound to the table
Jump to Post
Hi, would you mind to share your code here with us? Will be easier to salve the problem.
Show us how you bind DGV to the dataTable (and stuff).
Jump to Post
In my opinion, you have way too much code of DGV.
What you need is only to use DataSource property.
just and only this:
SqlConnection main_user_con = new SqlConnection(); main_user_con.ConnectionString = "Data Source=.\\SQLEXPRESS;AttachDbFilename=|DataDirectory|\\clubdb.mdf;Integrated Security=True;User Instance=True"; string con_string = "select * from users"; SqlDataAdapter userda = new …
All 5 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.