Groups | Blog | Home
all groups > asp.net webcontrols > april 2004 >

asp.net webcontrols : Problem with composite webcontrol - Any suggestions for a newbie?



Brian Hampson
4/3/2004 10:42:48 PM
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

Brian Hampson
4/5/2004 1:12:38 AM
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 :)

[quoted text, click to view]

Alessandro Zifiglio
4/5/2004 10:51:41 AM
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

[quoted text, click to view]

Brian Hampson
4/7/2004 1:44:54 PM
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.

"Alessandro Zifiglio" <alessandrozifiglio@No-Spam--hotmail.com> wrote in
message news:%23HEeQwuGEHA.3332@TK2MSFTNGP12.phx.gbl...
[quoted text, click to view]

AddThis Social Bookmark Button