Problem with composite webcontrol - Any suggestions for a newbie?

B

Brian Hampson

Scenario:

Want to create a datagrid, in which each cell is populated by an
image(each image different), and a checkbox. Language: C#

I want my datagrid to end up 5 rows across. (I'm choosing the
Datagrid, since it's pageable - if I could have a pageable HTML table,
I'd go there even)

It seems that I want to create a composite control which has an image
and a checkbox, and then use it on a page that creates a datagrid,
which pulls data and populates values into each of the to sub controls
in each cell.

Is this correct? If so, I have NO idea how to go about this.


1. How do I create the composite control
2. How do I get to use it on my other page?
3. How do I populate and display correctly in a DataGrid?

Thanks!

Brian Hampson
System Administrator
ALS Environmental, Americas
Email to Brian dot Hampson at REMOVETHISGARBAGE.ALSEnviro dot com
 
D

Dan Brussee

Possibly you want a DataList instead of a DataGrid? You have much more
control over horizontal flow with the DataList.
 
B

Brian Hampson

Thanks Dan. I was trying to stay in the DataGrid for it's paging abilities.
I've since decided to go with an HTML table of thumbnails, each one links to
a larger picture which asks the user if they want to add it to their
collection (and acts accordingly).

I still have a paging issue, only now with an HTML table - but that's life I
suppose :)
 
A

Alessandro Zifiglio

hi Brain,
you can still not use the datagrid but continue to use its paging
functionality. The paging functionality for the datagrid is provided by the
PagedDataSource class.
This class encapsulates the properties of the DataGrid control that allow it
to perform paging. For a quick how to, refer to the link below which is one
of the first results on google ;)

http://www.codetricks.com/article.php?cat=asp&id=18&pagenumber=1
 
B

Brian Hampson

Ah... I hadn't thought of a "PagedDataSource" (Admittedly, I didn't eve know
about it until you posted <grin>)

I have ended up going with a different design, as I couldn't get the
composite control that I wanted repeated to work either. Frustrating stuff,
this learning :)

Thanks to all for the feedback. I'm sure I'll be revisiting this issue at
some point again, when I find composite control that I can't live without.

B.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top