Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
639
Set Dropdown for a column of Ultragrid
posted

Hi all,

I have a ultragrid let user to update directly, I would like to set 1 of the column as dropdown selection to update data. The data of the dropdown will be get from a data source, how should I code for this condition?

I found from the community, most of the sample is assign data with hardcode method like below, can you all please suggest me a method which data retrive by data source?

private void BindUltraDropDown()
{
    DataTable dt = new DataTable();
    dt.Columns.Add("ID", typeof(int));
    dt.Columns.Add("DisplayText", typeof(string));

    dt.Rows.Add(new object[] {1, "A"});
    dt.Rows.Add(new object[] {2, "B"});
    dt.Rows.Add(new object[] {3, "C"});
    dt.AcceptChanges();

    this.ultraDropDown1.SetDataBinding(dt, null);
    this.ultraDropDown1.ValueMember = "ID";
    this.ultraDropDown1.DisplayMember = "DisplayText";
}


Thank you very much!