1

I have an UltraWinGrid with a column that I've tied an UltraCombo dropdown to as an EditorControl. I want the user to only select an option from this dropdown, I don't want them to type in text into the grid cell, or to cut/paste text either. How do I make the cell readonly, but at the same time allow the user to select an option from the dropdown? All the answers I've found online say how to disable the cell completely which is not what I want.

private void LoadItems()
{
    DataTable dtt = new DataTable();
    dtt.Columns.Add("Int", typeof(int));
    dtt.Rows.Add(2);
    dtt.Rows.Add(3);
    dtt.Rows.Add(4);

    uc.DropDownStyle = UltraComboStyle.DropDownList;

    uc.SetDataBinding(dtt, null);
}

void myGrid_Grid_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e)
{
  myGrid.Grid.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.False;
  e.Layout.Bands[0].Columns["aaa"].ValueList = uc;

}
bob joe
  • 51
  • 1
  • 7

1 Answers1

1

I think I figured it out. I used this and it seems to work so far:

  e.Layout.Bands[0].Columns["aaa"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
bob joe
  • 51
  • 1
  • 7