I have a dropdown in a Grid and I want to fill it in runtime. I tried it in a RowSelected event but it doesn't work.
Then I tried it to assign the attribute PXStringList in the field definition on the DAC, but it doesn't work either.
This is the event
protected virtual void HIASetupDetail_RowSelected(PXCache sender, PXRowSelectedEventArgs e)
{
List<string> values = new List<string>();
values.AddRange(new string[] { "A", "B" });
if (e.Row == null)
{
return;
}
HIASetupDetail HIASetupDetailRow = (HIASetupDetail)e.Row;
PXStringListAttribute.SetList<HIASetupDetail.acumaticaField>(sender, HIASetupDetailRow, values.ToArray(), values.ToArray());
}
And this is the DAC
[System.SerializableAttribute()]
public class HIASetupDetail : PX.Data.IBqlTable
{
#region AcumaticaField
public abstract class acumaticaField : PX.Data.IBqlField
{
}
[PXDBString()]
[PXDefault()]
[PXUIField(DisplayName = "Acumatica Field")]
public virtual string AcumaticaField { get; set; }
#endregion
}
This is the Dropdown in the Grid
Any idea why it doesn't work in the Grid?




PXStringListto the DAC, then you should be able to overwrite it's values from code usingPXStringListAttribute.SetList- Samvel Petrosov