hi,
im still a novice in c# programming
im developing a windows form in visual studio 2010(krypton toolkit) in c# .net platform.
i have a datagrid view in my form named stage2grid which contains a column called layout id. when i make changes to this layout id column which is a string, i should be able to check if the particular changed value is already present in the database.
if yes then he should change the value else i should be able to continue with my work.
can u please help me put with the code.
sushanth08
0
Newbie Poster
Recommended Answers
Jump to PostBellow is the simple code to check a particular value in datagridview... Were you asking for this type of solution?
if (dataGridView1.Rows[row_index].Cells[column_index].Value.ToString() == "value_compars") { MessageBox.Show("Do Next Work"); //Rest of the code }
Jump to PostDo you populate dgv with all the "layout id" from the database? I means are the all rows from dataBase, present in the dgv?
And how do you populate dgv? Is it data bound, or not? If it is, you can loop through the dataTable of particular column, and …
Jump to PostHi, this is a bit more complicated as I thought. I knew I have to se CellValidating event, but there is quite some code, as you can see.
…
You can see Iam giving yo u a whole code I wrote, including with my example data (this one you can delete).
All 9 Replies
abelLazm
183
Postaholic
sushanth08
0
Newbie Poster
sushanth08
0
Newbie Poster
Mitja Bonca
557
Nearly a Posting Maven
sushanth08
0
Newbie Poster
sushanth08
0
Newbie Poster
Mitja Bonca
557
Nearly a Posting Maven
sushanth08
0
Newbie Poster
Mitja Bonca
557
Nearly a Posting Maven
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.