移动RenderTable的列 [英] Moving the column of RenderTable
问题描述
我有一个renderTable和我添加的行和列的表如下: -
I have a renderTable and I am adding rows and columns to the table as follows-
RenderTable renderTable = new RenderTable();
DataTable dt = GetData();
foreach (DataRow row in dt.Rows)
{
var header = renderTable.Rows[renderTable.Rows.Count];
header[0].Text = "Column 1";
header[1].Text = "Column 2";
header[2].Text = "Column 3";
header[1].Text = "Column 4";
var data = renderTable.Rows[renderTable.Rows.Count];
data [0].Text = row["col1"].ToString(); // 10
data [1].Text = row["col2"].ToString(); // 11
data [2].Text = row["col3"].ToString(); // 12
data [3].Text = row["col4"].ToString(); // 13
}
这是工作的罚款,并表被渲染为folllows -
This is working fine and table is rendering as folllows-
Column 1 Column2 Column3 Column4
10 11 12 13
我的要求是,现在我要到第4列移动到另一个地方了第二名如下。 (这个地方可以根据条件不同)
My requirement is, now I want to move the column 4 to another place like 2nd place as follows . (this place can differ depending on condition)
Column 1 Column4 Column2 Column3
10 13 11 12
我试着插入方法,但它不是为我工作作为插入索引可能发生改变。
有没有渲染表列移动到指定索引的任何功能。
I tried Insert method but it is not working for me as the insert index may change. Is there any function of render table to move the column to specified index.
请建议如果有任何替代。
Please suggest any alternative if any.
推荐答案
我们很遗憾地提及,但没有,可以让RenderTable柱的移动到指定的指数自C1PrintDocument的COLS是只读的任何功能。
We regret to mention but there isn't any function that can allow the moving of column of RenderTable to a specified index since the Cols of C1PrintDocument is ReadOnly.
这篇关于移动RenderTable的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!