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
580
How to set selected item in Ultragrid ValueList column
posted

 

I have populated a ValueList

myGrid.DisplayLayout.ValueLists["FromList"].ValueListItems.Add()

It all works fine, I can make a manual selection

I would like to assign a value to it from the code behind.

User selects "create new item" form the list, then a window opens. When window is closed I would like to select a created value.

I have tried to set a cell value to the same name as value in the list, but that only displayed a text, my valueListItems are using a tag value which in that case is null. If I open a drop down it looks like nothing is selected.

I am in CellChangeevent

e.Cell.Row.Cells[0].Value = justCreatedValue

Parents
  • 469350
    Verified Answer
    Offline posted

    Hi,

    You need to set the Value of the cell to the DataValue of the new item, not to the ValueListItem itself.

    Alternately, you could set the Text on the Cell.EditorResolved to the display text of the ValueListItem you want.

Reply Children
No Data