<
FormTemplate
>
<
table
id
=
"table1"
cellspacing
=
"2"
cellpadding
=
"1"
width
=
"100%"
border
=
"1"
rules
=
"none"
style
=
"border-collapse: collapse;"
>
<
tr
class
=
"EditFormHeader"
>
<
td
colspan
=
"2"
>
<
b
>Product Details</
b
>
</
td
>
</
tr
>
<
tr
>
<
td
>
<
table
id
=
"table2"
cellspacing
=
"1"
cellpadding
=
"1"
width
=
"100%"
border
=
"0"
class
=
"module"
>
<
tr
>
<
td
></
td
>
<
td
></
td
>
</
tr
>
<
tr
>
<
td
>
Product Name:
</
td
>
<
td
>
<
asp:TextBox
ID
=
"TextBox7"
runat
=
"server"
Width
=
"90%"
Text='<%# Bind( "ProductName" ) %>'></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
>
Product Price:
</
td
>
<
td
>
<
asp:TextBox
ID
=
"TextBox8"
runat
=
"server"
Width
=
"90%"
Text='<%# Bind( "ProductPrice" ) %>'></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
>
Category:
</
td
>
<
td
>
<
asp:TextBox
ID
=
"TextBox9"
Enabled
=
"false"
runat
=
"server"
Width
=
"90%"
Text='<%# Bind( "CategoryName" ) %>'></
asp:TextBox
>
<
br
/>
<
asp:DropDownList
ID
=
"DropDownList1"
runat
=
"server"
DataSourceID
=
"SqlDataSource1"
Width
=
"90%"
DataTextField
=
"CategoryName"
AutoPostBack
=
"true"
>
</
asp:DropDownList
>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:ASPNETDBConnectionString %>"
SelectCommand="Select Distinct CategoryName From Categories">
</
asp:SqlDataSource
>
</
td
>
</
tr
>
<
tr
>
<
td
>
Thumb Image:
</
td
>
<
td
>
<
asp:TextBox
ID
=
"testImage"
runat
=
"server"
Text='../images/<%# Bind( "ImageName" ) %>'></
asp:TextBox
>
<
img
id
=
"ThumbImage1"
runat
=
"server"
alt
=
""
src='../images/<%# Bind( "ImageName" ) %>' />
<
asp:Image
ID
=
"Image1"
runat
=
"server"
AlternateText
=
"Thumb"
ImageUrl='../images/<%# Bind( "ImageName" ) %>'/>
</
td
>
</
tr
>
<
tr
>
<
td
>
Main Image:
</
td
>
<
td
>
<
img
id
=
"MainImage"
alt
=
""
runat
=
"server"
src='../images/<%# Bind( "ImageNameMain" ) %>' />
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"2"
>
<
telerik:RadTabStrip
runat
=
"server"
ID
=
"RadTabStrip1"
Orientation
=
"HorizontalTop"
SelectedIndex
=
"0"
MultiPageID
=
"RadMultiPage1"
Width
=
"400px"
>
<
Tabs
>
<
telerik:RadTab
Text
=
"Ingredients"
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Description"
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Overview"
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"Directions"
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
<
telerik:RadMultiPage
runat
=
"server"
ID
=
"RadMultiPage1"
SelectedIndex
=
"0"
Height
=
"218px"
Width
=
"400px"
CssClass
=
"multiPage"
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"RadPageView1"
CssClass
=
"pageView"
>
<
asp:TextBox
ID
=
"TextBox13"
runat
=
"server"
TextMode
=
"MultiLine"
Rows
=
"5"
Columns
=
"40"
Width
=
"370px"
Text='<%# Bind( "ProductIngredients" ) %>'></
asp:TextBox
>
</
telerik:RadPageView
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"RadPageView2"
CssClass
=
"pageView"
>
<
asp:TextBox
ID
=
"TextBox10"
runat
=
"server"
TextMode
=
"MultiLine"
Rows
=
"5"
Columns
=
"40"
Text='<%# Bind( "ProductDescription") %>'></
asp:TextBox
>
</
telerik:RadPageView
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"RadPageView3"
CssClass
=
"pageView"
>
<
asp:TextBox
ID
=
"TextBox11"
runat
=
"server"
TextMode
=
"MultiLine"
Rows
=
"5"
Columns
=
"40"
Text='<%# Bind( "ProductOverview" ) %>'></
asp:TextBox
>
</
telerik:RadPageView
>
<
telerik:RadPageView
runat
=
"server"
ID
=
"RadPageView4"
CssClass
=
"pageView"
>
<
asp:TextBox
ID
=
"TextBox12"
runat
=
"server"
TextMode
=
"MultiLine"
Rows
=
"5"
Columns
=
"40"
Text='<%# Bind( "ProductDirections" ) %>'></
asp:TextBox
>
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
</
td
>
</
tr
>
</
table
>
</
td
>
</
tr
>
<
tr
>
<
td
align
=
"right"
colspan
=
"2"
>
<
asp:Button
ID
=
"btUpdate"
Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' runat="server"
CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'/>
<
asp:Button
ID
=
"btnCancel"
Text
=
"Cancel"
runat
=
"server"
CausesValidation
=
"false"
CommandName
=
"Cancel"
/>
</
td
>
</
tr
>
</
table
>
</
FormTemplate
>
glc.DataNavigateUrlFormatString = "javascript:function anon(){{window.radopen('View.aspx?TID={0}&LID={1}','View');}};anon();";
---------------------------------------------------------------------
if (!Page.IsPostBack)
{
GridHyperLinkColumn glc;
glc =
new GridHyperLinkColumn();
this.rgTranslationView.MasterTableView.Columns.Add(glc);
glc.DataTextField=
"English";
glc.HeaderText=
"English";
glc.UniqueName =
"English0";
glc.FilterControlWidth=
Unit.Pixel(100);
glc.DataType= System.
Type.GetType("System.String");
glc.AutoPostBackOnFilter=
true;
glc.AllowFiltering =
true;
glc.ShowFilterIcon =
false;
glc.DataNavigateUrlFormatString =
"javascript:function anon(){{window.radopen('View.aspx?TID={0}&LID={1}','View');}};anon();";
glc.DataNavigateUrlFields =
new String[] { "TagID, LanguageID" };
glc.CurrentFilterFunction =
GridKnownFunction.Contains;
}
Can anyone help?
Thanks!
glc.DataNavigateUrlFormatString = "javascript:function anon(){{window.radopen('View.aspx?TID={0}&LID={1}','View');}};anon();";
---------------------------------------------------------------------
if (!Page.IsPostBack)
{
GridHyperLinkColumn glc;
glc =
new GridHyperLinkColumn();
this.rgTranslationView.MasterTableView.Columns.Add(glc);
glc.DataTextField=
"English";
glc.HeaderText=
"English";
glc.UniqueName =
"English0";
glc.FilterControlWidth=
Unit.Pixel(100);
glc.DataType= System.
Type.GetType("System.String");
glc.AutoPostBackOnFilter=
true;
glc.AllowFiltering =
true;
glc.ShowFilterIcon =
false;
glc.DataNavigateUrlFormatString =
"javascript:function anon(){{window.radopen('View.aspx?TID={0}&LID={1}','View');}};anon();";
glc.DataNavigateUrlFields =
new String[] { "TagID, LanguageID" };
glc.CurrentFilterFunction =
GridKnownFunction.Contains;
}
Can anyone help?
Thanks!
Hi coders,
I have a <a> tag in the AppointmentTemplate and when a user clicks on the link, I would like to extract the ID of the clicked entry and pass it to a javascript function. This is the code I am trying but it doesn't work. Please let me know how to accomplish this:
<
AppointmentTemplate
>
<
div
>
<
a
href
=
'#'
onclick='openWindow(<%# Eval("ID") %>)'><%# Eval("Subject") %></
a
>
</
div
>
</
AppointmentTemplate
>
openWindow is my JavaScript function. Please let me know where I am going wrong.
Thanks, Peterson.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication1.Default" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<
html
xmlns
=
"http://www.w3.org/1999/xhtml"
>
<
head
runat
=
"server"
>
<
title
></
title
>
</
head
>
<
body
>
<
form
id
=
"form1"
runat
=
"server"
>
<
telerik:RadScriptManager
ID
=
"RadScriptManager1"
runat
=
"server"
>
</
telerik:RadScriptManager
>
<
div
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
GridLines
=
"None"
DataSourceID
=
"SQLData"
>
<
MasterTableView
AutoGenerateColumns
=
"false"
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
UniqueName
=
"ID"
DataField
=
"ProductID"
HeaderText
=
"ID"
/>
<
telerik:GridBoundColumn
UniqueName
=
"Name"
DataField
=
"Name"
HeaderText
=
"Name"
/>
</
Columns
>
<
NestedViewTemplate
>
<
asp:Label
runat
=
"server"
ID
=
"lblProductNumber"
Text='<%#Eval("ProductNumber")%>' />
<
telerik:RadButton
runat
=
"server"
ID
=
"btn"
Text
=
"Alarm"
Icon-PrimaryIconUrl
=
"~/Images/alarm-clock.png"
/>
</
NestedViewTemplate
>
</
MasterTableView
>
<
ClientSettings
Scrolling-UseStaticHeaders
=
"true"
Scrolling-AllowScroll
=
"true"
/>
</
telerik:RadGrid
>
<
asp:SqlDataSource
runat
=
"server"
ID
=
"SQLData"
ConnectionString="<%$ ConnectionStrings:AdventureWorksConnectionString2 %>"
SelectCommand="SELECT * FROM [Production].[Product]"/>
</
div
>
</
form
>
</
body
>
</
html
>
column.ItemStyle.Width = Unit.Pixel(170);
column.HeaderStyle.Width = Unit.Pixel(170);
<
div
style
=
"width: 100%;padding-top:15px"
>
<
telerik:RadGrid
ID
=
"gridData"
runat
=
"server"
AllowPaging
=
"true"
AutoGenerateColumns
=
"true"
GridLines
=
"Both"
BorderStyle
=
"None"
Skin
=
"Office2007"
Width
=
"100%"
OnNeedDataSource
=
"gridData_NeedDataSource"
PageSize
=
"100"
ShowGroupPanel
=
"true"
OnItemCreated
=
"gridData_ItemCreated"
OnItemDataBound
=
"gridData_ItemDataBound"
OnDataBound
=
"gridData_DataBound"
OnPreRender
=
"gridData_PreRender"
AllowFilteringByColumn
=
"True"
EnableViewState
=
"False"
oncolumncreated
=
"gridData_ColumnCreated"
oncolumncreating
=
"gridData_ColumnCreating"
>
<
GroupPanel
Text
=
"Arrastre una cabecera de columna hacia ésta barra para agrupar"
>
</
GroupPanel
>
<
MasterTableView
GridLines
=
"Both"
ShowGroupFooter
=
"true"
TableLayout
=
"Auto"
EnableViewState
=
"False"
>
<
HeaderStyle
Width
=
"100%"
/>
<
RowIndicatorColumn
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
</
MasterTableView
>
<
ClientSettings
ReorderColumnsOnClient
=
"True"
AllowDragToGroup
=
"True"
AllowColumnsReorder
=
"True"
AllowColumnHide
=
"false"
>
<
Selecting
AllowRowSelect
=
"True"
></
Selecting
>
<
Resizing
AllowRowResize
=
"True"
AllowColumnResize
=
"True"
EnableRealTimeResize
=
"True"
ResizeGridOnColumnResize
=
"true"
></
Resizing
>
</
ClientSettings
>
<
GroupingSettings
ShowUnGroupButton
=
"true"
GroupContinuedFormatString
=
"... continuación del grupo de la página anterior. "
GroupContinuesFormatString
=
" El grupo continúa en la siguiente página."
GroupSplitDisplayFormat
=
"Mostrando {0} de {1} items."
UnGroupButtonTooltip
=
"Click aquà para remover grupo"
UnGroupTooltip
=
"Arrastre fuera de la barra para remover grupo"
CaseSensitive
=
"false"
/>
</
telerik:RadGrid
>
</
div
>