c# - Add UserControls on LayoutControl via Code -
i want add usercontrols on layoutcontrol via code. should appear among each other. , problem. become 1 usercontrol visible. following @ moment:
foreach (myclass tempmyclass in allobjectsfrommyclass) { // create usercontrol ctrlprogramm programm = new ctrlprogramm(); // set label values , on control programm.bxprogramminitialiseren(tempmyclass); // add usercontrol layoutcontrol controls collection layoutcontrol.controls.add(programm); } i can see control created in first loop of foreach. maybe recline 1 on other? maybe need add panel first?
information: layoutcontrol in namespace devexpress.xtralayout , using devexpress v2010 vol.2
regards
when adding controls layoutcontrol you should wrap these controls layoutcontrolitems follows:
//create layout item , add root group. layoutcontrolitem item1 = layoutcontrol.root.additem(); item1.name = "item1"; ctrlprogramm programm = new ctrlprogramm(); // set item's control , caption. item1.control = programm; item1.text = "program:"; related articles:
how to: create layout items via code
how to: create layout groups , items via code
to learn more layoutcontrol concepts please refer following articles:
introducing xtralayoutcontrol
tutorial: creating simple layout
Comments
Post a Comment