In my suspension questions I want to get some values through reflection. Now I want the values to be set by objects thanks to reflection.
I want to write this:
private void AppliquerColonnesPersonnalisation(Control control, Propriete propriete, PropertyInfo Info)
{
UltraGrid grille = (UltraGrid)control;
SortedList<int,string> sortedOrderedColumns = new SortedList<int,string>();
if (grille != null)
{
ColumnsCollection cols = MapPropertyInfo(Info);
PropertyInfo contains type ColumnsCollection. I just want to "map" my PropertyInfo to an object to define some properties after: For example:
cols[prop.Nom].Hidden = false;
Is it possible?
Regards,
Florian
EDIT: I tried the GenericTypeTea solution, but I have some problems. Here is my code snippet:
private void AppliquerColonnesPersonnalisation(Control control, Propriete propriete, PropertyInfo Info)
{
UltraGrid grille = (UltraGrid)control;
ColumnsCollection c = grille.DisplayLayout.Bands[0].Columns;
ColumnsCollection test = Info.GetValue(c,null) as ColumnsCollection;
SortedList<int,string> sortedOrderedColumns = new SortedList<int,string>();
But TargetException
source
share