Click here to Skip to main content
15,887,175 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi All,

I have one datagridview with four datagridcomboboxcolumns.
I want to bind four different lists to four datagridComboboxcolumns.

So i am approaching this with the logic:
1.Adding each list to each datatable.
2.Merging all four datatables to one datatable.
3.Binding final datatable with the datagridview.

But i am having problem in merging all datatable
to one datatable.? If i add second table to first one. Then secondtable column
starts from the next row of the last value of first table. It is not adding from the
first index of the datatable.

So Can anyone give me codelogic for above problem?
Or any better idea of binding that 4 lists
to my datagridview???

Whichever can anyone guide me with dis??

Regars,
Mohana
Posted

Hi,
If the schema of your table is same for all datatables then you can use a dataset and call the merge function of the dataset with respective datatable.

All the best.
--AK
 
Share this answer
 
My Advise Try to Write A Store Procedure Work out that place make single Temp Table then fetch it that as datatable or dataset to assign gridview datasource thats best way and simple one

Note:
1.Finally make query return like have 4 Dropdownlist Text and value field as colum

2.In Bind time dropdown datasource for all 4 same but each dropdown different text and value field for that same Datasource table column
 
Share this answer
 
v2
Comments
Mohanapriya Ranganathan 12-Jun-12 10:34am    
But my 2 lists are static lists and 2 lists are created during run time.
so i thought of processing it in the UI itself.
Michael_Jacsi 13-Jun-12 4:17am    
Can you Post some Source Code now what you tried in your Page.. its may better helps to understand and solve the problem

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900