Hi,I want to know how canwe select a value from a datagrid and search for that value in another databse.Thanks
sdhawan
-2
Junior Poster
Recommended Answers
Jump to PostWhen the use clicks on a cell in the DataGridView this causes several events to fire.
CellClick
orSelectionChanged
are most likely what you need.
Jump to PostI've been doing something similar just now.
Here is a code sample of what I did.private void dgTestData_CellClick(object sender, DataGridViewCellEventArgs e) { if (e.RowIndex == -1) return; // column header clicked - do nothing // get the row just clicked DataRowView drv = dgTestData.Rows[e.RowIndex].DataBoundItem as DataRowView; …
Jump to PostTestData is my DataSet that has a table called Tests.
If the DataSet is constructed using the VisualStudio designer then this adds a class for the table row; in my case called
TestData.TestsRow
.Since my DataGridView was set up by setting the DataSource to an instance of …
All 11 Replies
nick.crane
342
Veteran Poster
nick.crane
342
Veteran Poster
sdhawan
-2
Junior Poster
nick.crane
342
Veteran Poster
sdhawan
-2
Junior Poster
nick.crane
342
Veteran Poster
sdhawan
-2
Junior Poster
nick.crane
342
Veteran Poster
sdhawan
-2
Junior Poster
sdhawan
-2
Junior Poster
nick.crane
342
Veteran Poster
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.