DataTable dt = new DataTable();
dt.Columns.Add("TreeID",typeof(Int32));
dt.Columns.Add("RowNumber" , typeof(Int32));
dt.Columns.Add("nam" , typeof(string));
dt.Rows.Add(new object[] {0,1,"Aaaa"});
dt.Rows.Add(new object[] {1,2,"Bbbb"});
dt.Rows.Add(new object[] { 1 , 3 , "Cccc" });
tvwInvcodes.ParentFieldName = "TreeID";
tvwInvcodes.KeyFieldName = "RowNumber";
tvwInvcodes.DataSource = dt;
tvwInvcodes.OptionsBehavior.PopulateServiceColumns = true;
tvwInvcodes.PopulateColumns();
tvwInvcodes.BestFitColumns();
tvwInvcodes.ExpandAll();
|