jeudi 29 décembre 2016

convert invoked funtion to List<>

It's really hard to explain my problem but i will do my best

my code is:

    public virtual void LoadList() {
        MethodInfo method = ClassType.GetType().GetMethod("Set", new Type[0]);
        MethodInfo generic = method.MakeGenericMethod(this.ClassType.GetType());
        var List = generic.Invoke(_classType, null);
        //everything works great till here. but now i want to convert the list, that
        //was returned from invoke method, into the List, in order to bind it to the
        //DataSource
      grdList.DataSource = List;
      grdList.Columns["ID"].Visible = false;
    }

so i want to convert the result from invoked method to list. any suggestions? pardon me if couldnt explain the problem well.





Aucun commentaire:

Enregistrer un commentaire