DataGridView
-
Hi! I have a question. I have a DataGridView that displays some records and beside it I have another DataGridView. How can I double click on a record in DataGridView1 so that the record appears in DataGridView2? It's basically an assignment function where I double click the records I need and they are displayd in the second gridview. I know that I have to execute the code in the double click event of the datagridview but I have no idea how to add the selected record to datagridview2 Thank you in Advance!!
Illegal Operation
-
Hi! I have a question. I have a DataGridView that displays some records and beside it I have another DataGridView. How can I double click on a record in DataGridView1 so that the record appears in DataGridView2? It's basically an assignment function where I double click the records I need and they are displayd in the second gridview. I know that I have to execute the code in the double click event of the datagridview but I have no idea how to add the selected record to datagridview2 Thank you in Advance!!
Illegal Operation
You'd have to read the data from the record, put it into an acceptable data source, like a list, and apply it to the second view.
Christian Graus Driven to the arms of OSX by Vista. Read my blog to find out how I've worked around bugs in Microsoft tools and frameworks.
-
Hi! I have a question. I have a DataGridView that displays some records and beside it I have another DataGridView. How can I double click on a record in DataGridView1 so that the record appears in DataGridView2? It's basically an assignment function where I double click the records I need and they are displayd in the second gridview. I know that I have to execute the code in the double click event of the datagridview but I have no idea how to add the selected record to datagridview2 Thank you in Advance!!
Illegal Operation
Why? What are you trying to accomplish? Are you copying data? Anyway, I very rarely use a DataGridView, they're generally not very appropriate for production applications (they're really only good for making quick-and-dirty prototypes and demoes).
-
Hi! I have a question. I have a DataGridView that displays some records and beside it I have another DataGridView. How can I double click on a record in DataGridView1 so that the record appears in DataGridView2? It's basically an assignment function where I double click the records I need and they are displayd in the second gridview. I know that I have to execute the code in the double click event of the datagridview but I have no idea how to add the selected record to datagridview2 Thank you in Advance!!
Illegal Operation
Are you using "data bound" grids or "unbound" grids? If you're using "unbound" grids, then retrieve the selected DataGridViewRow(s) and copy them to the second grid. If you're using "bound" grids, you should be using a typed dataset with 2 tables of the same type, and using the methods of the typed tables to retrieve the selected row(s) and adding them to the second table. (see the grid's .SelectedRows and row .Selected properties for starters).
-
Hi! I have a question. I have a DataGridView that displays some records and beside it I have another DataGridView. How can I double click on a record in DataGridView1 so that the record appears in DataGridView2? It's basically an assignment function where I double click the records I need and they are displayd in the second gridview. I know that I have to execute the code in the double click event of the datagridview but I have no idea how to add the selected record to datagridview2 Thank you in Advance!!
Illegal Operation
look into the datagridviews.Rows.Add function. I think it even takes a DataGridViewRow object. extract that object from your first datagridview and your done. hope this helps.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archive -
Why? What are you trying to accomplish? Are you copying data? Anyway, I very rarely use a DataGridView, they're generally not very appropriate for production applications (they're really only good for making quick-and-dirty prototypes and demoes).
PIEBALDconsult wrote:
they're generally not very appropriate for production applications
It's the first time I here this, why do you find it inappropriate for production applications?
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archive -
PIEBALDconsult wrote:
they're generally not very appropriate for production applications
It's the first time I here this, why do you find it inappropriate for production applications?
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview ArchiveThere's usually a better way to present the data; very few applications (pretty much just spreadsheets) work well as a grid.
-
There's usually a better way to present the data; very few applications (pretty much just spreadsheets) work well as a grid.
Ok, it's from a functional level, not because the control is 'bad'.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview Archive -
Ok, it's from a functional level, not because the control is 'bad'.
V.
Stop smoking so you can: Enjoy longer the money you save. Moviereview ArchiveRight.