foreach (
var row
in lst.Select(x =>
x.crow).Distinct())
{
LayoutControlItem layout_preitem =
null;
var lstItem = lst.Where(x => x.crow == row).OrderBy(x =>
x.ccol);
foreach (
var item
in lstItem)
{
var txtitem =
new TextBox { Name =
item.cname };
layoutControl1.Controls.Add(txtitem);
var layoutitem =
layoutControlGroup1.AddItem();
layoutitem.Control =
txtitem;
layoutitem.Text =
item.cname;
if (layout_preitem !=
null)
{
layoutitem.Move(layout_preitem, InsertType.Right);
layout_preitem.Width = layoutControlGroup1.Width /
lstItem.Count();
}
layout_preitem =
layoutitem;
}
}
public class tagitem
{
public string cname {
get;
set; }
public int crow {
get;
set; }
public int ccol {
get;
set; }
}
转载于:https://www.cnblogs.com/zhahost/p/3159770.html