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
4165
How to update Datasource of UltraComboEditor when it is EditorControl of a Column?
posted

Hi,

 

I have a ultraComboEdtior of whose datsource I have set to a list of Location objects. I have set this combo box as the Editor component of a column in an ultragrid.

 

I have a method to add a new customer. In this method I get the datasource from the editor control (by first casting to ultracomboeditor, then to my list). I add the new customer. I see the count of the datasource go up by one. I do not see though the new customer when I drop down the list in the cell. What am I missing?

 

c = (ugReplicate.DisplayLayout.Bands[0].Columns["siteID"].EditorComponent as UltraComboEditor).DataSource as List<CSM.Location>;                    

c.Add(fl.SiteLocation);

Here is where I see the datsource go up by one (even on the first line if I hold my mouse over DataSource).

 

Thanks,

M.

 

Parents
  • 53790
    Verified Answer
    posted

    Hello Michael,

    Maybe one possible approach to solve your task could be if you call DataBind() method. For example:

    private void ultraButton1_Click(object sender, EventArgs e)

            {

                i++;

                List<string> list = (ultraGrid1.DisplayLayout.Bands[0].Columns[1].EditorComponent as UltraComboEditor).DataSource as List<string>;

                list.Add("Item " + i.ToString());

                (ultraGrid1.DisplayLayout.Bands[0].Columns[1].EditorComponent as UltraComboEditor).DataBind();

            }

     Please take a look on attached sample and video file for more details and if you have any questions, feel free to write me

    Regards

    Video323.rar
Reply Children