By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
458,068 Members | 1,210 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 458,068 IT Pros & Developers. It's quick & easy.

Display 1 data row as multiple datagrid rows

P: n/a
If a row of data in a dataset has a lot of columns the row displaying the
data in a datagrid will run way off the screen. What I'd like to do is
display a row of data over several datagrid rows so the user doesn't have to
scroll horizontally. Essentially, I want to wrap a datagrid row (not text in
individual columns) with as much control as possible. Make sense?

While this seems simple enough on the surface, I can't figure out how to do
it and the scant information I've seen on the Internet says it can't be done
without buying a 3rd party datagrid -- Infragistics' NetAdvantage was
recommended. To make a long story short, I called them and it isn't clear
their NetAdvantage product supports this either.

In the past, I've done this building HTML tables on the fly but my team at
work wants to standardize on using the datagrid since most of our developers
come from a VB6, not a web development, background.

Thanks for the help!
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Thanks for the response. It validates my thoughts.
I have written a custom control before, specifically a paging control
tailored to our intranet site. But writing a functionally rich datagrid is a
whole new ballgame. Given I have ASP and ASP.Net code I can reuse for
dynamically creating HTML tables, I know doing it the old-fashioned way is
quicker (at least in the short run; it's not fun to maintain long-term). It
isn't intuitively obvious how to easily extend the Microsoft datagrid to do
what I want.

The datalist isn't really close to what I want to do but it was a good
suggestion.

Generally speaking, horizontal scrolling is consider bad design. I don't
want to make too much of it because I can't say we don't do it here from
time to time to a modest degree. The issue is usability studies indicate
users don't mind scrolling vertically within reason but they generally don't
like scrolling horizontally. In my situation, we're talking scrolling over
2-3 screens worth at 1024x768 resolution (plus, they still have to scroll
vertically as well). We've used a multiple line format in ASP and ASP.Net
pages with great success. Obviously, it depends on the nature of the data
but ours consolidates nicely (e.g., name, address) so it isn't busy. Headers
wrap too and allow for sorting of any column it's practical to sort on.

It surprises me, though, that rather fundamental functionality is overlooked
in the datagrid. I've seen a number of questions about this on the Internet
so I'm hardly the only one in this bind. As it stands, a rather nice
Microsoft datagrid is useful only in rather trivial applications where I
work. Face it, like most organizations, presenting data -- often scads of
data -- is what we code for. It's more the rule than the exception to have
to present more data than can fit in the width of a screen using a readable
font size.

Anyway, thanks again for the suggestions. Happy .Net'n.

"Suresh" <an*******@discussions.microsoft.com> wrote in message
news:99**********************************@microsof t.com...
This is not that simple to do. As you already found out DataGrid will not do this not will the Infragistics WebGrid products($$). Your best bet is do what you were doing before. You may want to look at the DataList control in .NET. It'll be much like how you did it with HTML
but you might get some additional functionality from the DataList for free.
If standardizing is your concern you can always build a custom web control(somewhat advanced programming) to do what you want. All your users
with this specific requirment can use that control like any other ASP.NET
server control.
Also if you want datarows to wrap then how do you deal with Column headers. Do you wrap them as well?? Wouldn't that be an awkward UI?? IMO
it would be easier for users to scroll horizontally than to look at wrapped
rows.
HTH,
Suresh.

----- Craig Banks wrote: -----

If a row of data in a dataset has a lot of columns the row displaying the data in a datagrid will run way off the screen. What I'd like to do is display a row of data over several datagrid rows so the user doesn't have to scroll horizontally. Essentially, I want to wrap a datagrid row (not text in individual columns) with as much control as possible. Make sense?

While this seems simple enough on the surface, I can't figure out how to do it and the scant information I've seen on the Internet says it can't be done without buying a 3rd party datagrid -- Infragistics' NetAdvantage was
recommended. To make a long story short, I called them and it isn't clear their NetAdvantage product supports this either.

In the past, I've done this building HTML tables on the fly but my team at work wants to standardize on using the datagrid since most of our developers come from a VB6, not a web development, background.

Thanks for the help!

Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.