GridView Vs. HTML Table (ASP.net 2.0) - html

For full control of your application, do you prefer a GridView or a HTML table?
And why?
For instance, I need to create on-the-fly hyperlinks-per-row in a GridView/HTML table. What object would be more easy to add that feature (or others like this one)?
Note: I'm creating programmatically my datasets

If you don't need the built in support for sorting or paging, and want more control over the rendered output then I would consider using a Repeater control to output a table. If you need the built in sorting/paging then the GridView can be very helpful.
If you want the best of both worlds, upgrade to ASP.net 3.5 and use the ListView.
EDIT: Can you clarify what you mean by 'on-the-fly hyperlinks-per-row'?

Stay away from the Gridview. It has to pull down the entire dataset to render the paging. It's much faster to render only the rows you need (e.g. rows 30 - 40 of 6,0000) and use a seperate pager control.
Also when it comes to HTML/CSS, using a repeater or listview will be much easier to debug, since you'll have total control over the code.

A plain HTML <table> generated by Response.Write is straightforward and has the added benefit that if you ever work on a non-Microsoft system, you won't feel naked without their redundant ASP.NET web controls that mostly just make it more difficult to generate the HTML everyone already knows.

I think the Repeater or the newer ListView is the way to go if you don't need sorting and/or paging. The Repeater and ListView allow you to control the HTML (the GridView is a total black box in this regard and generates atrocious HTML) while avoiding the tedious server-side code that comes with the <asp:Table> control: "OK, new row. New cell. Do something with cell. Add cell to row. Add row to table. Repeat".
On the other hand, if you need paging and sorting, the GridView is probably the better solution.

You can use GridView or more simple Repeater-like controls to build your own html, even if you have to sort/page you data.
With a Repeater for example you can build a custom system of pagination using a PagedDataSource data source with the property AllowPaging sets to true.
The only problem is clearly that with a simple Repeater you must write more code to do the work that GridView does natively.
But the result is faster.

Related

Control for display of grouped data

For a small in-house project I need to display tabular data grouped by a certain column. It would be nice to be able to expand/collapse the groups. The Group title is a simple text string.
Is there an easy way to accomplish this with standard controls, preferably using data-binding instead of manually populating for example a ListView control?
You may be able to achieve what you need using SubDatasheets in Access.
Another way to display information, if you don't have too many columns, is to use a tree view.
There is even a 100% VBA one!

Django - should I use only 1 view for all website?

Lets say I want to make a website in which only one HTML template is used. For example, if one wants to create a new object, he clicks a button, and form shows up, leaving the remaining web page intact. My question is simples: should I use only 1 view to handle all the possible inputs/outcomes or should I have multiple views that handle the same template?
Thanks in advance
You can do one view, but if it starts to get complex, accounting for each possible input and output can become a headache. I suggest you use as many views as you need and then later implement AJAX to present everything as if it's only one-page
Seems like if that is the only thing that you want to do, having one FormView and handling the cases accordingly should suffice. For a given form, if it's not necessary, keeping it to one view is generally a good choice.

Customized Generated HTML + GridView Capabilities

ASP.NET's GridView controller is great, it's easy to use, it offers sorting, paging, and other stuff, but I find it difficult to customize the way it looks.
The GridView will always generated a table with headers and divided columns, but sometimes I need the users to see a better looking listed items, customized using CSS.
In other words, I don't want something like this:
I want something like this:
But when I'm going to generate the HTML and customize the way it looks, it would take time to implement the paging and sorting by myself, from scratch.
So How can I mix the Customized HTML with the Capabilities of GridView?
You are looking for the Repeater! Complete control over layout and rendering, but the downside is a lot of the built-in stuff like paging and sorting is not there.
I've actually used a Repeater combined with ASPNET Pager: http://www.codeproject.com/Articles/11418/Pager-Control-for-ASP-NET, and I also rolled my own multi-sort.
It's more work than a GridView, but if you want complete control, there's no better option.

Displaying Large Amounts of Data in an HTML Table

I am generating HTML tables based on SQL statements for a Datawarehouse created through meta table information.
One of the issues I have is some of returned Datatables have 100 plus columns. Is there a neat way of displaying this in an HTML table or a specific design solution. Please note I am looking at the display here. Changing the amount of columns available is not an option. All columns need to be rendered.
Many thanks in advance for input.
I can think of 2 good solutions:
Wrap the whole table with a fixed-width container, and set overflow-x: auto on it. That will cause the table to scroll.
Allow the user to filter out whichever columns he doesn't need to see using JavaScript/jQuery.
Both are possible, the first is obviously easier to implement, but with the second you have more control. Choose your path and if you're stuck, you can ask here on StackOverflow for help.
What you are describing is called datagrid. You definitely should not generate the HTML yourself(as you sad) and instead just bind the result set to any kind of server-side data-grid or use some kind of client-side jQuery datagrid implementation.
https://stackoverflow.com/questions/159025/jquery-grid-recommendations

What is the easiest way to add additional html to my form using the Orbeon Form Builder?

We want to use Orbeon Forms to build and run some forms, however these forms require some more explaining than is possible in the 'hint' or 'help' sections. ('hint' is supposed to be rather short, 'help' does not support any kind of formatting, as far as i can tell) Therefore, I'd like to put some HTML above or below some of the questions (controls).
Now, I know that there is an option that shows you the source and allows you to make changes. This is, however, quite complex for a non-technical person.
Is there a(nother) way of inserting pieces of HTML in a form?
Also, I have looked at ways of creating a control that outputs/shows HTML, however it seems that both XBL and the Java classes for XForms controls always assume that it should be bound to some variable that's also in the resulting XML document. (And I'd rather not have that, since it will just be clarifying text.) Though it could be that I overlooked another possible option in XBL or Java.
Is it possible to create a component that does not get bound to the XML instance? (That I can then use to create a control that provides HTML functionality.)
For HTML in help message, Form Builder supports form authors entering a help message as HTML since version 4.4.
We often get requests for a control allowing form authors to enter their own HTML from Form Builder, this isn't yet implemented, at the point of this writing, and we have an RFE (#507) to cover this.