Home
Help
Register
Log in

Search

 
   Active Threads  

You are here: Home > LLBLGen Pro > LLBLGen Pro Runtime Framework> Getting started with databinding the Winforms DataGridView with SelfService v3.5
 

Pages: 1
LLBLGen Pro Runtime Framework
Getting started with databinding the Winforms DataGridView with SelfService v3.5
Page:1/1 

  Print all messages in this thread  
Poster Message
like2175
User



Location:
Camberley, United Kingdom
Joined on:
27-Mar-2006 16:16:06
Posted:
83 posts
# Posted on: 14-Nov-2012 13:41:38.  
I have a Windows Form application. I have a DataGridView that I would like to bind (ultimately) to an LLBLGen Collection. When editing some of the columns I would like to use ComboBoxes bound (ulitmately) to filtered and sorted LLBLGen Collections.

Could someone explain in simple terms the best practice steps required to bind the DataGridView and Combo boxes. Should I be:

1. Dragging my LLBLGenPro created DAL dll onto the toolbox, then dragging the collections onto my form then binding the grid and combo boxes to these?

2. Adding a bindingSource, connecting that to a collection and binding the grid to the bindingSource. Should the Collection be created through Data - Add New Data Source?

3. Using some other method?

If I want to be able to apply a sort and filter to the combo box data sources, where should this be done?

I am not sure the best practice way of doing this in 2012 with my setup of LLBLGenPro v3.5, C#, VS2010 (or VS2012) and .NET framework 4 or above.

I used option 1 with some success but kept getting errors when trying to open the Windows Form designer which I could only fix by re-adding the DAL .dll to the toolbox (surely this isn't necessary)

(coming from ASP.NET forms, this WinForms stuff is all a bit alien at the moment!)

Any help, or just a pointer to the most up to date document describing how to do this, would be gratefully received.
  Top
Walaa
Support Team



Location:

Joined on:
21-Aug-2005 16:03:48
Posted:
14639 posts
# Posted on: 14-Nov-2012 18:09:38.  
To setup databinding at design time, it's recommended you use the Data sources feature in Visual Studio.NET. Create a Data Source based on an entity type in the generated code, e.g. CustomerEntity. Setup databinding using that data source, e.g. through dragging a BindingSource onto your form. When you set the DataSource property of that BindingSource to the Data Source you created of the entity type, you can design the control bound to the BindingSource. At runtime, set the DataSource property of the BindingSource instance to a fetched EntityCollection<T> instance. This will make sure the data shows up in the control bound to the BindingSource.


  Top
like2175
User



Location:
Camberley, United Kingdom
Joined on:
27-Mar-2006 16:16:06
Posted:
83 posts
# Posted on: 15-Nov-2012 09:33:36.  
Walaa wrote:
To setup databinding at design time, it's recommended you use the Data sources feature in Visual Studio.NET. Create a Data Source based on an entity type in the generated code, e.g. CustomerEntity. Setup databinding using that data source, e.g. through dragging a BindingSource onto your form. When you set the DataSource property of that BindingSource to the Data Source you created of the entity type, you can design the control bound to the BindingSource. At runtime, set the DataSource property of the BindingSource instance to a fetched EntityCollection<T> instance. This will make sure the data shows up in the control bound to the BindingSource.


Thank you - just what I needed.
  Top
Pages: 1  


Powered by HnD ©2002-2007 Solutions Design
HnD uses LLBLGen Pro

Version: 2.1.12172008 Final.