Forum Discussion
scottcm
12 years agoNew Contributor
I did see that code and it's the basis for the code I wrote. I ended up figuring out the problem, but there is more than 1 possible solution.
The easiest solution if you have control over the applications source code is to change the XtraGrid to filter by display text rather than value. I didn't have that option so I created a check for the type of editor used by the column filter and based on that either used text or looked up the "Id" value of the selection.
The code snippet ended up looking like this.
The easiest solution if you have control over the applications source code is to change the XtraGrid to filter by display text rather than value. I didn't have that option so I created a check for the type of editor used by the column filter and based on that either used text or looked up the "Id" value of the selection.
The code snippet ended up looking like this.
column = GetGridColumn(grid, view, columnId);
if (column["ColumnEdit"] != null && column["ColumnEdit"]["EditorTypeName"] == "PopupList")
{
filterValue = GetIdValueFromDataSource(column["ColumnEdit"]["DataSource"], displayText);
}
else if (column["ReadColumnEdit"]!=null && column["ReadColumnEdit"]["EditorTypeName"] == "PopupList")
{
filterValue = GetIdValueFromDataSource(column["ReadColumnEdit"]["DataSource"], displayText);
}
else
{
filterValue = displayText;
}
view["SetFilterRowValue"](column, filterValue);
Related Content
Recent Discussions
- 2 days agoMW_Didata