complex gridview? page

Last post 11-09-2007 2:24 AM by dotsad. 8 replies.

Sort Posts:

  • complex gridview? page

    11-01-2007, 7:56 PM
    • Loading...
    • jepatte
    • Joined on 11-26-2002, 2:29 PM
    • Posts 25

    I am coming from an ASP background where I feel like I could get in the code and do almost anything, but now with ASP.NET, it seems a lot harder to make things happen. 

    For instance, I created this page with asp rather easily.....is there a specific control (like the gridview) that I can use to do something like this? As you can see, I need to break on two separate cartegories.  This is just a recordset with two joins ordered by the catregory, title, and version.  But then I need the icons on the left which I know I can do with template columns.  But can you do these breaks on categories as well?   Or am I better off, doing this with an asp:table ?  Please help.

    grid 

     

    jepatte
  • Re: complex gridview? page

    11-01-2007, 8:59 PM
    • Loading...
    • andrecarrilho
    • Joined on 02-06-2006, 12:08 PM
    • Lisboa - Portugal
    • Posts 222

    You can use a GridView and using ItemTemplate format the data display.

    Cheers

    André da Silva Carrilho
    http://andrecarrilho.blogspot.com/
    http://dotnetslackers.com/community/blogs/andrecarrilho/

    If the post has been answered please marke it as Answered :-)
  • Re: complex gridview? page

    11-01-2007, 10:23 PM
    • Loading...
    • jepatte
    • Joined on 11-26-2002, 2:29 PM
    • Posts 25

    But how do you do breaks on categories using the gridview?  See Anti-Virus Software, then it breaks again at Trend.

    jepatte
  • Re: complex gridview? page

    11-02-2007, 10:40 AM
    • Loading...
    • andrecarrilho
    • Joined on 02-06-2006, 12:08 PM
    • Lisboa - Portugal
    • Posts 222

    When you use ItemTemplate in a GridView you are able to format the data display. You can use tables, div's or whatever. Copy and paste your html block from your asp page inside your item template and twick it accordingly. Use <%# Eval(columnName) %> to fill the fields you want.

    Hope this helps

    Cheers

    André da Silva Carrilho
    http://andrecarrilho.blogspot.com/
    http://dotnetslackers.com/community/blogs/andrecarrilho/

    If the post has been answered please marke it as Answered :-)
    Filed under: ,
  • Re: complex gridview? page

    11-02-2007, 11:10 AM
    • Loading...
    • jepatte
    • Joined on 11-26-2002, 2:29 PM
    • Posts 25

    thanks for your response.  I understand the itemtemplate and how it works, but the gridview doesn't allow for breaking like the example of the image I posted.  This is one recordset.

     ie.

    CategoryMain, CategorySub, Softwaretitle, Price, etc.
    I don't want to show CategoryMain and CategorySub on each row, I want to only show it once (almost like a report).  You see what I mean?

    jepatte
  • Re: complex gridview? page

    11-06-2007, 6:02 AM
    Answer

    Hi jepatte ,

    You can use nested gridview to do such thing. A contains B and B contains C.

    Then set A's datasource as different kinds of software B's datasource as different kinds of  products and set C's datasource as details.

    Each inner gridview is putted in container's itemtemplate tags.

    Sincerely,
    Samu Zhang
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: complex gridview? page

    11-06-2007, 3:26 PM
    Answer
    • Loading...
    • jepatte
    • Joined on 11-26-2002, 2:29 PM
    • Posts 25

    ok, I almost understand.  To make this simpler, lets say I have one gridview inside another, so then I have 2 sqldatasources.  How do I make it so that the inner gridview only shows the child records for the current parent record that its on?  This is really just simething like a report except I need itemtemplate fields so I can display an edit/delete option.

    Thanks

    jepatte
  • Re: complex gridview? page

    11-09-2007, 1:26 AM

    Hi,

    You can bind datasource to your inner gridview manually on the event RowDataBound of parent gridview. Each time you retrieve different id from the row of parent gridview and generate sql statement to retrieve datasource to bind to inner gridview.

    Sincerely,
    Samu Zhang
    Microsoft Online Community Support

    Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.
  • Re: complex gridview? page

    11-09-2007, 2:24 AM
    • Loading...
    • dotsad
    • Joined on 04-25-2007, 5:52 PM
    • Seattle, WA
    • Posts 67

    here is a great tutorial with exact goal:

    http://www.asp.net/learn/data-access/tutorial-27-cs.aspx

     

     

    Please mark my answer as correct if it was correct.

    my blog with .NET hints seattle-khv.spaces.live.com
Page 1 of 1 (9 items)
Microsoft Communities
Page view counter