Hello,
Adding rows to the WebCombo is quite easy. All you need to do is add a few columns, and then add a few rows. Below is a simple snippet of what you will have to do.
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
this.WebCombo1.Columns.Clear();
UltraGridColumn col1 = new UltraGridColumn();col1.Key = "Col1";
col1.Header.Caption =
"Column1";this.WebCombo1.Columns.Add(col1);
UltraGridColumn col2 = new UltraGridColumn();col2.Key = "Col2";
col2.Header.Caption =
"Column2";this.WebCombo1.Columns.Add(col2);
UltraGridColumn col3 = new UltraGridColumn();col3.Key = "Col3";
col3.Header.Caption =
"Column3";this.WebCombo1.Columns.Add(col3);for (int i = 0; i < 10; i++)
{
UltraGridRow row = new UltraGridRow();this.WebCombo1.Rows.Add(row, false, true);
this.WebCombo1.Rows[i].Cells[0].Value = i.ToString();this.WebCombo1.Rows[i].Cells[1].Value = "More " + i.ToString();this.WebCombo1.Rows[i].Cells[2].Value = "Text" + i.ToString();
}
this.WebCombo1.DataValueField = "Col1";this.WebCombo1.DataTextField = "Col3";
}
}
Steve Osterberg
Corporate Trainer