Hi.
I am showing a column on a datagridview. The codes are below;
DataTable table_nmrlr = new DataTable();
adapter_nmrlr.Fill(table_nmrlr);
...
dataGridView3.DataSource = table_nmrlr;
First column has 10 row. Then I want to show another column on datagridview on under the other. I mean the second column must start at 11.th row. But I couldnt do this. There should be 2 column on the same datagridview's column. How can I do this?
Loading

Kirtan PatelRank #292 · 8.6K reputationPosted Nov 12, 2009, 5:40 AM EST
this can be done force fully by code but it will not make consistency as Row Column Format :)
and Also you have to Consider Cell as Header of Some Column :)
yokzuRank #5,421 · 300 reputationPosted Nov 12, 2009, 7:04 AM EST
Nilanka DharmadasaRank #1,875 · 794 reputationPosted Nov 12, 2009, 6:29 PM EST
It's easy. You should change your SQL statement that you use to get the dataset from database.
select X.commoncolumn from
((select 1 as id , column_1 as commoncolumn from table_1) union (select 2 as id , column_2 as commoncolumn from table_2)) X
order by X.id
This will show the data from table 1 first and the data from table two in a single column.
Hope you can change your query with your table and column names.
If you find this usefu for u, please do not forget to mark this as accepted.
Nilanka DharmadasaRank #1,875 · 794 reputationPosted Nov 12, 2009, 7:02 PM EST
One thing i forgot. In the previous reply, replace 'union' word with 'union all'.
Coz union will select only distinct data from the two tables. If you have sama data in both tables then u'll get only one row for both of those rows.
If you use union all, then this will not happen.
Hope you got it. :)