SitePoint Sponsor

User Tag List

Results 1 to 15 of 15
  1. #1
    SitePoint Enthusiast
    Join Date
    Mar 2004
    Location
    south
    Posts
    39
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    ASP.NET datagrid clone

    I'm trying to move from ASP.NETto PHP but am missing .NET's datagrid with its inline editing. It seems I used it on just about every page I coded.

    Is there a class or some script examples that duplicate this functionality?

  2. #2
    ALT.NET - because we need it silver trophybronze trophy dhtmlgod's Avatar
    Join Date
    Jul 2001
    Location
    Scotland
    Posts
    4,836
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Booo i don't think you will...

    Long live .NET

  3. #3
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Heh, ironically, the datagrid was one of the main reasons I moved from PHP to ASP.NET for my primary development. If I recall correctly, HarryF mentioned some replacement for it...
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  4. #4
    No. Phil.Roberts's Avatar
    Join Date
    May 2001
    Location
    Nottingham, UK
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I think someone is (or was) working on a similar system for WACT, but it isn't completed yet.

  5. #5
    SitePoint Member
    Join Date
    Mar 2004
    Location
    germany
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    There is a proposal for a pear datagrid.

  6. #6
    Non-Member
    Join Date
    Jan 2004
    Location
    Planet Earth
    Posts
    1,764
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For those of us in the dark, what is a datagrid ?

  7. #7
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Widow Maker
    For those of us in the dark, what is a datagrid ?
    It's basically an HTML "macro" for generating tables from result sets. Instead of having to hand code tables etc. the basics is just to plant a <asp:datagrid/> in your template then "point" the results of a query at it. Makes generating tables fast and easy, at the price of flexibilty in terms of the output HTML from it - it's taking the HTML design decisions for you (although there are options to customize).

    In WACT, [member]jsweat[/member] has a tag <data:table> which generates a table straight from the result set you pass it. There's alot to do before this approaches the kind of functionality ASP.NET's datagrid provides and, right now, there's a "re-use" issue, when it comes to building tags, that needs solving.

    There clearest example I can give though, which demonstrates the point, is the <calendar:month/> tag - here's a template using it and end result is here. As you can see, the calendar:month tag works like an "HTML macro", preventing you from having to generate HTML table tags for a calendar, and saving you alot of time. Course if you want to build you calendar with <div/> tags, you have a problem, and that's the short coming of this approach.

  8. #8
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by HarryF
    It's basically an HTML "macro" for generating tables from result sets. Instead of having to hand code tables etc. the basics is just to plant a <asp:datagrid/> in your template then "point" the results of a query at it. Makes generating tables fast and easy, at the price of flexibilty in terms of the output HTML from it - it's taking the HTML design decisions for you (although there are options to customize).
    The datagrid is also very nice to use for inline editing, which is the real point of it. It's basically a very quick way to dish up data for viewing and editing. While a datagrid is more or less confined to being a table (as it's dealing with tabular data, that makes sense), ASP.NET offers more light-weight and customizable siblings of the datagrid callsed DataList and Repeater.

    For an example of how it looks, see example 1 on this page:
    http://samples.gotdotnet.com/quickst...ataaccess.aspx
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  9. #9
    Non-Member
    Join Date
    Jan 2004
    Location
    Planet Earth
    Posts
    1,764
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Harry for explaining that, but on this point you've made

    ...you have a problem, and that's the short coming of this approach.
    Not from the WACT point of use, but from an XML point of use, if your datagrid uses TABLE elements, wouldn't it be possible to use an XSL stylesheet to transform those TABLE elements to DIVs ?

    Just an idea of course, but that imposses some limitations/overheads as well

  10. #10
    No. Phil.Roberts's Avatar
    Join Date
    May 2001
    Location
    Nottingham, UK
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Widow Maker
    wouldn't it be possible to use an XSL stylesheet to transform those TABLE elements to DIVs ?
    Why would you want to though? Tables should be used for tabular data.

  11. #11
    SitePoint Wizard gold trophysilver trophy
    Join Date
    Nov 2000
    Location
    Switzerland
    Posts
    2,479
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not from the WACT point of use, but from an XML point of use, if your datagrid uses TABLE elements, wouldn't it be possible to use an XSL stylesheet to transform those TABLE elements to DIVs ?
    Sure you could do that. As with ASP.NET you could also write your own component and save the additional layer of processing.

    Why would you want to though? Tables should be used for tabular data.
    Very true. Mentioned div tags for sake of example. The point is this general approach is a trade off - you sacrifice some flexibility but gain on having an easy life. There's nothing you can do with the datagrid that can't be done with plain HTML but you have to work harder.

    ASP.NET offers more light-weight and customizable siblings of the datagrid callsed DataList and Repeater.
    I wonder if the Datagrid isn't a layer on top off the Repeater? WACT has a component, the list which is basically the same as the repeater in terms of functionality. Because it doesn't output HTML directly, but rather provides you placeholders for inserting your own HTML, you can do pretty much any "loop" type XML generation you need to. Seems like a good platform to build something like a data grid on top off, re-using what the Repeater already does.

  12. #12
    Non-Member
    Join Date
    Jan 2004
    Location
    Planet Earth
    Posts
    1,764
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Why would you want to though? Tables should be used for tabular data.
    Doesn't one W3C spec or another suggest that you do not use TABLEs ? ie XHTML1.1

    Not sure if the spec it's self allows the use of TABLEs solely for tabular data though.

  13. #13
    No. Phil.Roberts's Avatar
    Join Date
    May 2001
    Location
    Nottingham, UK
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Widow Maker
    Doesn't one W3C spec or another suggest that you do not use TABLEs ? ie XHTML1.1
    It's suggested that you don't use tables for layout purposes. But the idea that you shouldn't use tables for anything is just stupid. They were intended for tabular data and they will continue to be used for that purpose. There are no plans to remove tables from the XHTML specification.

  14. #14
    Non-Member
    Join Date
    Jan 2004
    Location
    Planet Earth
    Posts
    1,764
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Well, that's cleared that up then

    What news of CSS Level 3 though ? Doesn't that offer more TABLE formatting as well huh ?

    The W3C have dropped some suggestions from what I've heard.

  15. #15
    ☆★☆★ silver trophy vgarcia's Avatar
    Join Date
    Jan 2002
    Location
    in transition
    Posts
    21,236
    Mentioned
    1 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by Widow Maker
    What news of CSS Level 3 though ? Doesn't that offer more TABLE formatting as well huh ?
    CSS2 offers that:
    Code:
    div {
      display: table-row;
    }
    div div {
      display: table-cell;
    }
    You can use it today, just not in IE/Windows . This still doesn't mean you shouldn't use tables to present tabular data though.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •