Hi Dave,
First of all, I would like to confirm my understanding of your issue. From
your description, I understand that this issue involves 2 problems. One is
how to merge two tables' data into one, and the other is how to make the
even and odd rows display with the different formats. If there is any
misunderstanding, please feel free to let me know.
To merge data, there is no direct method to achieve this. We have to create
a new data table, and copy rows from the two tables one by one.
We can also use DataGrid's AlternatingBackColor and AlternatingItemStyle
property to change the format for odd rows. Here is a sample code snippet.
private void CopyDefaultTableStyle(DataGrid datagrid,
DataGridTableStyle ts)
{
ts.AllowSorting = datagrid.AllowSorting;
ts.AlternatingBackColor = datagrid.AlternatingBackColor;
ts.BackColor = datagrid.BackColor;
ts.ColumnHeadersVisible = datagrid.ColumnHeadersVisible;
ts.ForeColor = datagrid.ForeColor;
ts.GridLineColor = datagrid.GridLineColor;
ts.GridLineStyle = datagrid.GridLineStyle;
ts.HeaderBackColor = datagrid.HeaderBackColor;
ts.HeaderFont = datagrid.HeaderFont;
ts.HeaderForeColor = datagrid.HeaderForeColor;
ts.LinkColor = datagrid.LinkColor;
ts.PreferredColumnWidth = datagrid.PreferredColumnWidth;
ts.PreferredRowHeight = datagrid.PreferredRowHeight;
ts.ReadOnly = datagrid.ReadOnly;
ts.RowHeadersVisible = datagrid.RowHeadersVisible;
ts.RowHeaderWidth = datagrid.RowHeaderWidth;
ts.SelectionBackColor = datagrid.SelectionBackColor;
ts.SelectionForeColor = datagrid.SelectionForeColor;
}
For more information, please check the following article.
http://msdn.microsoft.com/msdnmag/is.../08/datagrids/
HTH.
Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."