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?
| SitePoint Sponsor |
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?

Boooi don't think you will...
Long live .NET![]()
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
I think someone is (or was) working on a similar system for WACT, but it isn't completed yet.
There is a proposal for a pear datagrid.





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).Originally Posted by Widow Maker
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.
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.Originally Posted by HarryF
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





Thanks Harry for explaining that, but on this point you've made
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 ?...you have a problem, and that's the short coming of this approach.
Just an idea of course, but that imposses some limitations/overheads as well![]()
Why would you want to though? Tables should be used for tabular data.Originally Posted by Widow Maker

Sure you could do that. As with ASP.NET you could also write your own component and save the additional layer of processing.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 ?
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.Why would you want to though? Tables should be used for tabular data.
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.ASP.NET offers more light-weight and customizable siblings of the datagrid callsed DataList and Repeater.





Doesn't one W3C spec or another suggest that you do not use TABLEs ? ie XHTML1.1Why would you want to though? Tables should be used for tabular data.
Not sure if the spec it's self allows the use of TABLEs solely for tabular data though.
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.Originally Posted by Widow Maker





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.
CSS2 offers that:Originally Posted by Widow Maker
You can use it today, just not in IE/WindowsCode:div { display: table-row; } div div { display: table-cell; }. This still doesn't mean you shouldn't use tables to present tabular data though.
Bookmarks