Hi all,
I have a webcombo in my page. Is it possible to add a row dynamically in a webcombo justlike adding items to dropdownlist at runtime.
Thanks
This isn't pretty, but atleast it's working:
WebCombo_Name.DataBind(); // need to do this, to get colums from original datasource
WebCombo_Name.Rows.Add("-1"); // -1 here is a unique key, you need for finding your row
WebCombo_Name.Rows.FromKey("-1").Cells[0].Value = 2; // you need it here to locate the added row, you'll be modifying
WebCombo_Name.Rows.FromKey("-1").Cells[3].Text = "Some text here"; // here you can set values for cells
WebCombo_Name.DataBind(); // need to bind again to make added row visible.