Hi everyone , as the Subject say im working with two value list inside my ultragrid, one of then has static values that i set on the load event and the other one will take its values depending on the value selected on the first one , they are my columns "Type" and "Subtype" im trying to do that using the "after cell list close up" even of the ultragrid(not sure if its the righ one) i have the next code on said event:
ValueList lista = new ValueList(); switch (e.Cell.SelText) { case "Factura": lista.ValueListItems.Add(1, "Factura"); lista.ValueListItems.Add(2, "Adelanto"); lista.ValueListItems.Add(3, "Avance"); lista.ValueListItems.Add(4, "Retencion"); break; case "Intereses": lista.ValueListItems.Add(1, "Interes"); break; case "Letra de Cambio": lista.ValueListItems.Add(1, "Letra de Cambio"); break; case "Nota de Débito": lista.ValueListItems.Add(1, "Nota de Debito"); break; case "Otro Débito": lista.ValueListItems.Add(1, "Otro Debito"); break; } UGridDetalle.DisplayLayout.Bands[0].Columns["Subtipo"].ValueList = lista;
and its working just fine except that it also trigger when the user select any value on the subtype and i want it to trigger only when the user select a value from the type list, i have tired using activerow to select the header or something to be able to know whats the source of my event but i havent been able to find a way
Hi and Tyvm Mike by using the code you mention i was able to stop the even from trigger on the other list and now is working just fine but i will make sure to take a look at the example you posted, to do things the right way
By the way, changing the ValueList on the second column may not work very well. The grid needs the ValueList to be there in order to translate the DataValue to the DisplayText and vice versa, so if you swap out the ValueList, this could cause problems in other cells where the value no longer exists on the list or has a different DisplayText for the same value.
There's an example of how to do this in a better way here:
Creating a dropdown list in a grid cell whose list values are dependent on another cell - Windows Forms - Infragistics Community
Hi,
I would use:
e.Cell.Column.Key