Advice: datagrid for news module

A

Arjen

Hello,

I'm using a datagrid for a news module.
The datagrid only displays the news title, date and header. (this is
allready working)

Now I want to make the title clickable... if you click on it you will see
the complete news message.
When you see the complete news message you don't see the datagrid anymore.
In the news message you can click on a link with a text "back"... once you
go back then you go to the same place where you ended with the datagrid.

All this must be made in the same module.
How can I realize the this? (reading the complete news message)

Thanks!
 
S

S. Justin Gengo

I've got some sample code on how to do this on my website:
www.aboutfortunate.com.

Just click on the "code library" link in the top right corner and then use
the search box to search for: make datagrid clickable (or something similar)
and you'll have what you need.

If you have any other questions feel free to respond here or email me
directly.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
S

S. Justin Gengo

Arjen,

Another way to do this is to simply make the put a databound link button in
the title position of your datagrid. Then when that button is clicked you
would hide the grid and show the full message in a label. Give the user a
button near the message label to return to the grid and then just switch
visibility between the button and label and the grid.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
C

Curt_C [MVP]

post back, show panel with details, hide panel with grid.
Back button reversed the hide/shows.
 
A

Arjen

Hil,

Do you have a sample of this?

I'm using a <asp:TemplateColumn>, inhere I want to make a hyperlink button.
(title)
Under the datagrid I want to make a panel.
When you activate the hyperlink, you must see the pannel...
the hyperlink must have an news ID... so that the panel can load the correct
news information.

Thanks,
Arjen
 
A

Arjen

Hi,

I now think about a panel... because I can put more controls in there.

I'm using a <asp:TemplateColumn>, inhere I want to make a hyperlink button.
(title)
Under the datagrid I want to make a panel.
When you activate the hyperlink, you must see the pannel...
the hyperlink must have an news ID... so that the panel can load the correct
news information.

Do you have a sample of this?

Thanks,
Arjen
 
C

Curt_C [MVP]

which part are you stuck on? Makeing the panels, making the postback link,
getting the data?

Please try first and post with specifics

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
 
A

Arjen

Sorry,

My first problem is to make the hyperlink control with the param (newsid)
and to catch the click event.
So that I can hide/show the panels.

I now only have:
<asp:HyperLink id="hplTitle" CssClass="ItemTitle" runat="server">
<%# Server.HtmlEncode((String)
DataBinder.Eval(Container.DataItem,"Title")) %>
</asp:HyperLink>


Thanks!
Arjen
 
S

S. Justin Gengo

Arjen,

The easiest way to do this is to connect your link button up so that it runs
a specific command when it's clicked.

You'll also need to know how to find the proper row to display.

I have some code out on my site that will demonstrate this too. It uses a
checkbox, but substitute the link button object for the checkbox and the
code is identical.

Just search the code library for: "How to reference a checkbox" and you'll
have the code you need.

--
Sincerely,

S. Justin Gengo, MCP
Web Developer / Programmer

www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
 
C

Curt_C [MVP]

I use something like this, but I bind the grid and set the .Key value.

private void DataGrid1_SelectedIndexChanged(object sender, System.EventArgs
e)
{
string myID = DataGrid1.Items[DataGrid1.SelectedIndex].ToString();
}

--
Curt Christianson
Owner/Lead Developer, DF-Software
www.Darkfalz.com
 

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

Members online

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top