I've been working through the "MyCustomFilteringColumn" overrides code example, and I've got everything working except I can't seem to get the filter to work, unless I hard code the column name in my query. I'm working with a Data Template Object, and populating the filter dropdown list with Linq query results. But I can't figure out how to evaluate the UniqueName of the passing object (this.UniqueName) as a parameter of my Data Object
Here's what I have in my code:
I've hardcoded "FullName" which is a property of EmployeeDTO (GetAllEmployees() returns a List<EmployeDTO>), but what I'd like to do is have this.UniqueName evaluate to "FullName" or whatever column is requesting the list.
Thanks,
Gabe
Here's what I have in my code:
private
void
list_ItemsRequested(
object
o, RadComboBoxItemsRequestedEventArgs e)
{
((RadComboBox)o).DataTextField =
this
.DataField;
((RadComboBox)o).DataValueField =
this
.DataField;
var employees = from emp
in
EmployeeBL.GetAllEmployees()
where emp.FullName.ToLower().Contains(e.Text.ToLower())
select emp;
((RadComboBox)o).DataSource = employees;
((RadComboBox)o).DataBind();
}
I've hardcoded "FullName" which is a property of EmployeeDTO (GetAllEmployees() returns a List<EmployeDTO>), but what I'd like to do is have this.UniqueName evaluate to "FullName" or whatever column is requesting the list.
Thanks,
Gabe