Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Javascript and DataGrid 1

Status
Not open for further replies.

jkb17

Programmer
Nov 27, 2000
156
US
Hello,

I have a question regarding implementing a javascript within a DataGrid.

I have a grid that displays basic employee data. I want to have a select button\link that can be clicked for a specific employee. When that link is clicked I would like to pop-up a new window a la the javascript window.open() method.

Does anyone have any advice on how to best implement that? I am pretty sure it can be done.

I'm guessing that I do not create a bound button column but rather an html based <item template> sort of column.

thanks in advance

James
 
never mind..

i found this post:

thread855-697642 can modify accordingly
 
You could use a template column or the hyperlink column:

1. <asp:TemplateColumn>
<ItemTemplate>
<asp:HyperLink runat=&quot;server&quot; Text=&quot;View&quot; NavigateUrl='<%# &quot;tiViewTransLst.aspx?OrderID=&quot; & Container.DataItem(&quot;OrderID&quot;) & &quot;&OrderName=&quot; & Container.DataItem(&quot;OrderName&quot;) %>' ID=&quot;Hyperlink1&quot; NAME=&quot;Hyplnk1&quot;/>
</ItemTemplate>
</asp:TemplateColumn>

2. <asp:HyperLinkColumn DataNavigateUrlField=&quot;TranId&quot; DataNavigateUrlFormatString=&quot;javascript:Transaction_window=window.open('newpage.aspx?TranId={0}','Transaction_window','width=700, height=475, location=no, menubar=no, titlebar=yes, toolbar=no');Transaction_window.focus()&quot; DataTextField=&quot;TranId&quot; DataTextFormatString=&quot;View&quot;></asp:HyperLinkColumn>

Hope this helps,
NatGreen
 
i figured that there was a way via the a column setting.

i just didn't exactly know how to do it.

thanks

NatGreen
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top