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
330
ultraDropDown in ultraGrid help
posted

Hi,

I've included a UltraDropDown in a certain UltraGrid Cell in a Column but would like it to be editable.  Is there any way to do this?  I've included a screen shot.

Is this done through the UltraGrid itself or the UltraDropDown?  Here is the code I am using:

 

UltraDropDown ultraDropDown1 = new UltraDropDown();
dt = new DataTable();
dt.Columns.Add("ID", typeof(string));
dt.Columns.Add("DisplayText", typeof(string));

foreach (string port in System.IO.Ports.SerialPort.GetPortNames())
dt.Rows.Add(new object[] { port, port });

dt.AcceptChanges();

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

this.ultraGridUsers.DisplayLayout.Bands[1].Columns["Channel"].ValueList = ultraDropDown1;

I would like the DisplayText column to be editable by typing it in there and also would like to hide the column headers if possible.

Thanks for the tutorial in the KB and thanks in advance.

 

 

  • 71886
    Offline posted

    Hello John,

    I prepared a sample for you regarding the behavior you want to achieve.

    Since the UltraDropDown control is for choosing, I tried to implement its behavior using an UltraTextEditor instance as an 'EditorComponent' for a ultraGrid column. For this instance I set a DropDown right button which makes a second grid popping up to show the DataTable you use. When you try to edit the DisplayText column everything is right and when you exit edit mode the data is 'saved' in the grids as it should be. Now, when you click in a cell in the first column, the value is selected to be displayed in the first grid and not giving the user the option to edit the cell as in the UltraDropDown control.

    Please feel free to let me know if I misunderstood you or if you have any other questions.

    EditDisplayTexColumntInGridEditor.zip