Posted 22 Feb 2013
Link to this post
we use RadGridView to display a collection of objects.
the model of this collection is as follows:
Public Class Model
private Dictionary<string, MethodInfo> extensionMethodeByfqdnNameCache = new Dictionary<string, MethodInfo>();
public object this[string name]
if (extensionMethodeByfqdnNameCache.Keys.Where(key => key == name).FirstOrDefault() == null)
string folderPath = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location);
string assemblyFilePath = name.Split(',').Trim();
string assembliesSearchRslt = Directory.GetFiles(folderPath, assemblyFilePath ".dll", SearchOption.AllDirectories);
if (assembliesSearchRslt.Count() < 1) throw new Exception("Cannot load assembly");
Assembly assembly = Assembly.LoadFrom(assembliesSearchRslt);
var currentType = this.GetType();
var methodeinfo = currentType.GetMethod("GetExtensionObject");
var extensionType = assembly.GetType(name.Split(',').Trim());
MethodInfo generic = methodeinfo.MakeGenericMethod(extensionType);
return extensionMethodeByfqdnNameCache.Where(dic => dic.Key== name).FirstOrDefault().Value.Invoke(this, null);
The model is shared across multiple assembly.
using a modular mechanism personalized.
the grid is always displayed and each change (module) are added Propertie anotre specific model:
and recovering these properties through the binding as follows:
Model. [^ ClassName, Assembly]. Property
Note: Model contain a method "GetExtension" ClassName to load a Dicationnary.
Binding the work properly.
we create a personalized component filrage and we could fill it with the values of this column grid personalized.
but when we must create a filter and passes FilterDescriptor Member of the filter [ClassName, Assembly]. Property with the operator Equal
unfortunately this does not filter the grid.
FilterDescriptor.Member is on, does that make a filter on the Model property declared in the Model class and can not invoke the method this [string name] to retrieve the extended properties?
how to do the filtering mechanism with an extension properties on the Model?
if you must use IColumnFilterDescriptor found in Q1 2012?