|
-
March 1st, 2012, 02:12 AM
#1
Plz help for databinding..in dgv
Dear Sir,
Thanks for ur goods help. but now i am not clear to get the exapmle from "http://msdn.microsoft.com/en-us/libr...atamember.aspx )"
suppose
i have two table as per order no.. and both table structure are same formated.
if select orderno one by one then data filled into the datagridview control as per selection of
one by one orderno. if select 1st orderno then all datafiled into dgv and next i select 2nd orderno then all data filled in after lastrow there means all data should be displayed in dgv
so. plz give sample code or suitable idea regarding this matter
i did it like that
dgv.datasource=table (orderno -1)
dgv.datasource=table (orderno-2)
but it displayed only last table(order-2) data in datagridwview control
but i want both table 1 and 2 data to be shown in datagridview..
thank & regards
-
March 2nd, 2012, 10:44 AM
#2
Re: Plz help for databinding..in dgv
Create a table with the same schema (table.clone) then bind this table to your dgv. You can use one of your other tables in design mode if you need to format columns, etc. Then in code use this new table as the datasource.
When the user makes choices you can clear the rows when needed. You can also itterate through the selected table and have the new table .importrow. You won't be able to actually assign the rows to the new table as they already belong a table. This method will create duplicate data so, depending on the table size, it may not be the best way.
You can also use a couple List(Of TableRow) to get table rows and then use List.AddRange to append the various Lists. Your DGV can then use the List as the datasource.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|