T
Tim
Hi,
I am trying to move a datacolumn in a datatable. What I have tried so
far is to create a new datacolumn set it equal to the one I want to
remove and then remove it, add another column and add it back again in
the place I want it.
tableStyle.MappingName = "DVGlobalPrices";
System.Data.DataColumn dCol = new DataColumn();
dCol = dvData.Table.Columns["CUR_new_price_1"];
dvData.Table.Columns.Remove(dCol);
if(dvData.Table.Columns["Button"] == null)
dvData.Table.Columns.Add("Button");
dvData.Table.Columns.Add(dCol);
However the column mapping seem to be lost as the whole column is now
displayed as (null) instead of the values.
Is this the best way to go about it? Is there another way? I am trying
to add a column that is not in the original dataview. If I append the
column to the end of the columns collection everything works fine, but I
would like to put it before the last column in the dataview.
Tim
I am trying to move a datacolumn in a datatable. What I have tried so
far is to create a new datacolumn set it equal to the one I want to
remove and then remove it, add another column and add it back again in
the place I want it.
tableStyle.MappingName = "DVGlobalPrices";
System.Data.DataColumn dCol = new DataColumn();
dCol = dvData.Table.Columns["CUR_new_price_1"];
dvData.Table.Columns.Remove(dCol);
if(dvData.Table.Columns["Button"] == null)
dvData.Table.Columns.Add("Button");
dvData.Table.Columns.Add(dCol);
However the column mapping seem to be lost as the whole column is now
displayed as (null) instead of the values.
Is this the best way to go about it? Is there another way? I am trying
to add a column that is not in the original dataview. If I append the
column to the end of the columns collection everything works fine, but I
would like to put it before the last column in the dataview.
Tim