Hello experts,
I tried to sort a field in form grid by code but when I did it the sort stays there all the time. My goal is to give the user the option to clear the sort. Maybe I am doing something wrong. This is my code:
[FormDataSourceEventHandler(formDataSourceStr(ProdTable, ProdTable), FormDataSourceEventType::Initialized)]
public static void ProdTable_OnActivated(FormDataSource sender, FormDataSourceEventArgs e)
{
var ProdTable_Ds = sender as FormDataSource;
Query q = new Query();
QueryBuildDataSource ds = q.addDataSource(tableNum(ProdTable));
ds.addSortField(fieldNum(ProdTable, ItemId));
ProdTable_Ds.query(q);
}
Thanks
*This post is locked for comments
I have the same question (0)

Report
All responses (
Answers (