I would like to see them in a new (browser!) window. Thanks.
Main Topics
Browse All TopicsDear all,
At the moment I am using something like this within a datagrid:
<asp:HyperLinkColumn DataNavigateUrlField="faq_
to enable the navigation to the details of an item. I would like to implement the same functionality with a button that has written on it: “More Details”. Any pointers would be very much appreciated. Many thanks in advance.
Chris
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
csetzkorn,
what do you mean that is not accessible? this line is taken from MSDN:
<asp:HyperLinkColumn
HeaderText="Select an Item"
DataNavigateUrlField="Inte
DataNavigateUrlFormatStrin
DataTextField="PriceValue"
DataTextFormatString="{0:c
Target="_blank"/>
also if you want to use button i'm afraid you have to use javascritp :(
B..M
This works:
<asp:HyperLinkColumn
HeaderText="Select an Item"
DataNavigateUrlField="Inte
DataNavigateUrlFormatStrin
DataTextField="PriceValue"
DataTextFormatString="{0:c
Target="_blank"/>
but your old proposal didn't work:
<asp:HyperLinkColumn DataNavigateUrlField="faq_
anyway, I guess I have to assume that the user uses javascript ...
I think some confusion has arisen here. My original code works:
<asp:HyperLinkColumn DataNavigateUrlField="faq_
However, I would like to replace the link with a button with the text ‘More Details’.
Thanks again.
csetzkorn,
check this:
<asp:TemplateColumn>
<asp:Label id="faqUid" runat="server" Text='<%# DataBinder.Eval(Container.
<asp:Button id="btnMoreDetails" Text="MoreDetails" runat="server"></asp:Butto
</asp:TemplateColumn>
create ItemDataound event for the datagrid and in it write down
if ( e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingIt
{
Button btn = (Button)e.Item.FindControl
Label lbl = (Label)e.Item.FindControl(
btn.Attributes.Add ( "onclick", "window.open('faq_details.
}
B..M
Ok, I have this:
aspx file:
<asp:TemplateColumn>
<itemTemplate>
<asp:Label id="faqUid" runat="server" Text='<%# DataBinder.Eval(Container.
<asp:Button id="more_details" Text="More Details" runat="server"></asp:Butto
</itemTemplate>
</asp:TemplateColumn>
code behind file:
public void Item_Bound(Object sender, DataGridItemEventArgs e)
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingIt
{
Button btn = (Button) e.Item.FindControl("more_d
Label lbl = (Label) e.Item.FindControl("faqUid
btn.Attributes.Add ( "onclick", "window.open('faq_details.
}
}
Unfortunately it doesn't work. I also don't understand what the ItemDataBound event has to do with my problem. As far as I understand it allows you to access the data before the item is displayed in the control.
Thanks.
Vardium,
Your code:
<asp:TemplateColumn>
<itemTemplate>
<input onclick="window.open('faq_
</itemTemplate>
</asp:TemplateColumn>
does what I want. Many thanks.
Business Accounts
Answer for Membership
by: mmarinovPosted on 2004-11-03 at 00:57:31ID: 12481035
Hi csetzkorn,
do you want to see this faq_details in a new window or you wanted to see them within the grid as nested datagrid ?
Regards!
B..M