c# - How to add radcombobox to cell in a table row cell -
i trying add radcombobox table row cell. cannot use table.row.cells.add(radcombobox) expects cell object. table programatically created .
protected override void page_init(object sender, eventargs e) { base.page_init(sender, e); configuretablecolumns(datacontext, operatingconditionstable, node, segments); configuretablerows(datacontext, operatingconditionstable, node, segments, inputs); } private void configuretablerows(ctaladatacontext context, table table, ctala.entity.treenode reviewnode, ienumerable<ctala.entity.treenode> segments, ilookup<string, operatingconditioninput> inputsgroupedbycategory) { foreach (var category in inputsgroupedbycategory) { foreach (var input in category) { var row = new tablerow() { cssclass = (altrow) ? "rgaltrow" : "rgrow" }; table.rows.add(row); var cell = new tablecell() { text = input.name }; row.cells.add(cell); var unitcell = new radcombobox() { id = "unit", allowcustomtext = false }; foreach (var item in input.unit) { unitcell.items.addrange(new radcomboboxitem[] { new radcomboboxitem(item) }); } //cell = new tablecell() //{ // text = input.unit //}; row.controls.add(unitcell);}}
refer this link.
to add radcombobox cell:
radcombobox combobox = new radcombobox { id = "foo" } combobox.items.add(new radcomboboxitem((0).tostring(), "firstitem")); newcell.controls.add(combobox);
Comments
Post a Comment