Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0What if I want to manually iterate through a datareader to build instead of using a bound data grid?What if I want to manually iterate through a datareader to build instead of using a bound data grid?
Previous
 
Next
New Post
1/31/2008 11:57 AM
 

Does anybody else 'manually' build their display table or other HTML, as opposed to binding the datareader to a datagrid? 

If so, how do you do it?  (and if you have examples, that would be great).  The only time I've come close, the table\grid was showing up Above the View\Edit toolbox in DNN *laugh*  And it wasn't even a dynamic sample to begin with.

To my way of thinking, you can be alot more flexible and dynamic with your content via 'manually' going through each row and deciding what to do with it, as opposed to just a X by Y grid... Or is there a way to fully customize the grid and insert logic into it?

I'm only asking because I may not be allowed to alter the stored procs which we have in play in order to return the results already customized to display what I need (hyperlinks, mouseover stuff, etc) as directed by my boss.

Brian

 
New Post
1/31/2008 12:53 PM
 

Most of what you mentioned can be accomplished by handling the ItemCreated or ItemDataBound events of the DataGrid/Gridview, etc. You might also want to consider using a DataList/ListView control where you can get away from the X by Y grid look.  Many times you can also create a formatting function of public scope that can be called from with a databinding expression.


Bill, WESNet Designs
Team Lead - DotNetNuke Gallery Module Project (Not Actively Being Developed)
Extensions Forge Projects . . .
Current: UserExport, ContentDeJour, ePrayer, DNN NewsTicker, By Invitation
Coming Soon: FRBO-For Rent By Owner
 
New Post
1/31/2008 12:54 PM
 

The ListView control that comes with ASP.NET 3.5 will do what yuo need. You can Google for examples of it. If you don't have asp.net 3.5 you can use teh Repeater control



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
New Post
1/31/2008 3:47 PM
 


I've been digging into both the gridview and the repeater, both of which show some promise, but I'm not sure if they show enough. 

The problem I'm seeing at this point is that, if the group which the current record is a part of (let's say that thats column 0 in the returned dataset), then I need to display a new header row which will span the width of the table). 

So, for example

Group 1
Name A        link A1    link A2     link A3
Name B        link B1   link B2     link B3
Group 2       
Name C        link C1    link C2   link C3
Name D        link D1    link D2   link D3
Name E        link E1     link E2   link E3
Group 3
Name F        link F1      link F2   link F3
Name G        link G1     link G2  link G3

The group name is actually returned in each row from the stored proc (first column).  If its different that the one above (or different than a blank value for the first record, then it needs to be it's own row in the output display.  I considered using the data repeater for this, as I could simply make a horizontal template for it but I'm not sure if this is a viable solution or not...

The Alternating record function will allow me to alter the background colors of each row, so thats useful, but I would also like to have it reset after each group change.  Again, with a table output, I had this all licked, but as I try to bring it into DNN, I'm not having the greatest of luck. 

The links will be mostly static, with only the last section of each link being dynamic based off the record value, again, easy to do the way I was doing it... Now... I'm still puzzling this out...

BTW, I'm using SQL 2005, with VS 2005 and the 2.0 framework,   If this is solvable with VS2008, I think I can get the upgrade approved.

It's annoying that alot of what I'm finding is CLOSE, but not quite there...

Why isn't there some kind of just straight HTML rendering control for DNN where you can just build the html code string and then set some property of said control (ie control.text =  strTableCodeToOutput)

Brian

 
New Post
1/31/2008 4:07 PM
 

You can do some great things with ListView grouping:

http://mattberseth.com/blog/2008/01/building_a_grouping_grid_with.html

image 



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0What if I want to manually iterate through a datareader to build instead of using a bound data grid?What if I want to manually iterate through a datareader to build instead of using a bound data grid?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out