Datagrid how-to question

S

Steve Chatham

I have a datagrid that I want to put sku information into.

I can load the select info there, such as:

Item# Description Weight etc.

However, in the right hand column, or maybe to the right of the datagrid,
I'd like to have a hyperlink displayed that would give me more specific
information than what I have space to show in the datagrid. An alternative
may be to have the user to click on the item number to display this info.

For instance, Say if they click on the "more info" link to the right of the
table (or the sku number) - I'd want to display maybe the UPC number, a case
quantity or something like that.

In doing this, I'd like to have the item roll up what's not clicked (i.e.
all the items above & below it), and display the "more info" in maybe a
datagrid below this one. A click on the item number (or more info link)
would restore the selections.

Any ideas?

Thanks,

Steve
 
M

Michael Mayer [C# MVP]

Steve Chatham said:
However, in the right hand column, or maybe to the right of the datagrid,
I'd like to have a hyperlink displayed that would give me more specific
information than what I have space to show in the datagrid. An alternative
may be to have the user to click on the item number to display this info.

Is this similar to what you want:
http://devx.mag37.com/dev/cswo/ProductTable.aspx
(full source code:)
http://devx.mag37.com/dev/cswo/cswo.zip
(note the use of url rewriting to make the item pages redirect to
Product.aspx?item=)

I just have a hyperlink to a separate page with all the additional
information.
In doing this, I'd like to have the item roll up what's not clicked (i.e.
all the items above & below it), and display the "more info" in maybe a
datagrid below this one. A click on the item number (or more info link)
would restore the selections.

Now I'm not so certain as to what you mean...That last paragraph doesn't
make much sense to me.

By "roll up" do you mean hide all the rows except for the single row that
was clicked for more info?

And "restore the selections" - do mean just to reshow all the rows of the
main datagrid?

You could pretty easily mimic this by having the hyperlink send you to the
same page with a querystring of, say, the sku #. If the page is loaded with
that sku #, you could bind the main datagrid to a dataview with just the
single row filtered, and enable a second part of the page to show the
details. I did a quick mock-up of this - click on the first link at the top
of ProductTable.aspx
 
B

ben

you can instead also display the details in a new pop up window by
using template column in the datagrid...something like this

<asp:TemplateColumn HeaderText="SKU">
<ItemTemplate>
<a href='details_sku.aspx?ID=<%#
DataBinder.Eval(Container.DataItem,"ID")%>' target=_blank>
<%#DataBinder.Eval(Container.DataItem,"SKU")%>
</a>
</ItemTemplate>
</asp:TemplateColumn>

HTH,
Ben
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top