Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Webform kid living in a Winform world....

Status
Not open for further replies.

jfrost10

Programmer
Jun 3, 2001
2,004
CA
Hey guys,

I've got a problem, and coming from a webform background I think I know how I'd solve it from a web standpoint; but I'm doing a winform project on the side, and not sure how I'd pull it off with winform controls.

I have two tables, we'll call them Group and Item. Each item belongs to a record in the Group table.

I need to display something like this:

GROUP TITLE
ItemAsCheckbox ItemAsCheckbox ItemAsCheckbox ItemAsCheckbox
ItemAsCheckbox ItemAsCheckbox ItemAsCheckbox ItemAsCheckbox

GROUP TITLE
ItemAsCheckbox ItemAsCheckbox ItemAsCheckbox ItemAsCheckbox
ItemAsCheckbox ItemAsCheckbox ItemAsCheckbox ItemAsCheckbox

But here's the thing: there's no set amount of items, so one group title could have 50 items or 1 or 10 or some other number. Also, I'd like to stick all of this within a scrolling control (on a web form, I'd place all this in a div tag and set the Overflow property to Auto. Not sure what the corresponding thing would be in winforms though.

So thats my cunnundrum. Any thoughts on how to pull it off?

Thanks guys!

D'Arcy
 
The first thing is that creating webforms is different in Winforms, in that webforms are generally created on the fly and webforms are normally created in design time and then just populated with data. Having said that it is not impossible, but it is far more painfull.

What you have to do is create the object and then place it on the form in the extact location where you want it to be displayed and you also have to use Object Arrays (ie an array of objects like text boxes or check boxes).

If I was you I would use a tree view or grid view to perform this task. Then you have complete control over it with out all the problems of creating check boxes (You would create the check boxes in the tree view).

Let me know how you go.


AGIMA - professional web hosting is our business.

AGIMA Computing
 
You'd think they'd have a way of duplicating this within a winform. Odd...

Treeview is a no go...the idea is that they'd have multiple rows consisting of 4-5 checkboxes. If the rows grew more than the screen, they could scroll. The Treeview would force the user to scroll vertically down the list, as opposed to better using the space on the form.

You're bang on about the differences between win and web forms. If this were a web project, creating a div tag with an overflow of auto with either a repeater, datagrid, or just flow layout grid to hold the checkboxes would be cake.

I'll keep looking into it this week, and when I find a solution I'll let you know.

Thanks,

D'Arcy
 
Win forms have a AutoScroll property that you can use but you still have to populate the information on the form.

AGIMA - professional web hosting is our business.

AGIMA Computing
 
This would be happening within a tab control, so whatever container I used (panel, etc.) would need to have that property as well. I'm sure I'll find something that works out.
:)

D
 
Have you looked at using the data repeater control, this could help and it can be placed straight onto the form.
 
oh HO! So there is a data reader control for the winforms (sorry, havn't had time to look back into this...been living in *gag* vb6.0 land)

interesting...

D
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top