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
295
need to reference value in a ultradropdown
posted

Good morning!

I have a wingrid with a valuelist column (with an ultradropdown) and an unbounded column which needs to make reference to the second column in the valuelist of the first column. Do i have to programmatically get the value of the second column of the ultradropdown or is there a way to do this with the ultracalcmanager.

I'll try to explain it better:

with the ultracalcmanager i can show an unbounded column with the values of the first and second columns in the grid by the next way: colum.formula = "[column1] & "" "" & [column2]"

this way i have a third column with the values of col1 and col2 concatenated, but what i really need is the value of the selected row of the valuelist of the column1. Is there something similar to formula="[column1.column3valuelist] ...."  ? this formula should show the third column of the selectedrow of the ultradropdown.

Not sure if this is too clear, sorry!

 

-------edit-----

Can i use the column.formula to reference the text of a column instead of the value? i want a column with a formula wich will display the text (not the value) of a column wich has a valuelist set.

  • 469350
    Verified Answer
    Offline posted

    Hi,

    No, I don't see how CalcManager could help you here. In fact, you really can't even use the SelectedRow of the UltraDropDown in this case. Keep in mind that a single UltraDropDown services every cell in the column. So if you select something from the dropdown in row 0 the SelectedRow of the UltraDropDown changes, but that SelectedRow is not valid for any other row.

    So really, the only way to do this is to search the DropDown for the item that matches the current Value in the cell.

    The easest way to do this is to make use of the GetText method on the IValueList interface.

    Something like this:

    int index = -1;
    cell.ValueListResolved.GetText(cell.Value, ref index);
    if (index != -1)
         Debug.WriteLine(dropdown.Rows[index].Cells["Field Name"].Value);

    'cell' here is the grid cell that has the dropdown in it.