Groups | Blog | Home
all groups > dotnet windows forms databinding > december 2005 >

dotnet windows forms databinding : Can I bind a FlowLayoutPanel to display a control for each record?


Gabe Covert
12/28/2005 1:59:01 PM
I've created a User Control to display data from a Dataset, and was wondering
if it were possible to bind a FlowLayoutPanel so that I can display an
instance of my User Control for each record in a dataset?

Is there another way that I could accomplish this task? I'd prefer to use
the FlowLayoutPanel for its great handling of multiple user controls...

Bart Mermuys
12/29/2005 12:54:23 AM
Hi,

[quoted text, click to view]

I doesn't have a DataSource, so like it is, i would say no.

[quoted text, click to view]

Yeah, but you should limit the number of usercontrols then, imagine a
DataTable with 1000 rows, this would create 1000 UserControls and if each
UserControl has 3 Control, then you end up with 3000 Controls, and each
Control uses windows resources, so too many Controls is a waste of
resources, scrolling won't go to well either.

That's why both the DataGrid and DataGridView only use a Control( which
could be a UserControl ) for the cell that's currently being edited and all
other cells are painted which doesn't require much resources.

So if you want to do it right, you should do it like that, it ain't easy and
the biggest challance is that you have to build a UserControl for editing
_and_ then be able to paint something that represents whatever was entered
on the UserControl.

HTH,
Greetings


[quoted text, click to view]

AddThis Social Bookmark Button