Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在运行时将新列添加到其他 2 列之间的网格中?
是的,你可以这样做:
var index = 1; //column index to insert var colDef = new ColumnDefinition() { Width=new GridLength(200) }; MyGrid.ColumnDefinitions.Insert(index, colDef);