Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
1705
Bind a WinGrid to a Business Object List
posted

I was able to accomplish this in the code behind but I was wondering if there is away to do it on the designer view.

  ultraGrid1.DataSource = UserBLL.GetList();
  ultraGrid1.DataBind();

 

I'm a web developer and I was looking for the equivalent of the ObjectDataSource control, so I can use the designer to bind the grid to a business logic layer class.

 

Thanks. 

Parents
  • 37774
    posted

    Unfortuantely there is no equivalent of an ObjectDataSource for WinForms, so I do not think that there is any way to do this at design-time.  The grid needs to have the structure provided to it by an object, and there is no way, at design-time, to do this.  Perhaps you can make a design-time instance of your list, or make a class that implements IListSource in order to provide design-time binding.  Alternatively, depending on what you need to do at design-time (i.e. if you don't need the column DataTypes to match), you could just define the schema through the grid's designer and bind at run-time.

    -Matt 

Reply Children