Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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
}

This is working fine and table is rendering as folllows-

Column 1    Column2   Column3    Column4
  10           11        12         13

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.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
246 views
Welcome To Ask or Share your Answers For Others

1 Answer

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...