I am trying to set the attributes of an edit hyperlink in a TreeList. When you click the edit hyperlink it will execute javascript to open a RadWindow. What I would like to do is to pass the "Req #" column value when you click the hyperlink. I thought the best way would be to write that value in the onclick attribute on each hyperlink created. Although I'm having trouble getting the associated "Req #" column value.
To make it easier to understand I have attached an image. Basically I want pass the "Req #" value to the RadWindow when the "view/edit" link is clicked.
Below is my code:
ASPX
C#
To make it easier to understand I have attached an image. Basically I want pass the "Req #" value to the RadWindow when the "view/edit" link is clicked.
Below is my code:
ASPX
<
telerik:RadAjaxLoadingPanel
ID
=
"replenishmentLoadingPanel"
runat
=
"server"
Skin
=
"Simple"
/>
<
telerik:RadTabStrip
ID
=
"replenishmentTabStrip"
runat
=
"server"
Skin
=
"Simple"
MultiPageID
=
"RadMultiPage2"
SelectedIndex
=
"0"
>
<
Tabs
>
<
telerik:RadTab
Text
=
"Req"
>
</
telerik:RadTab
>
<
telerik:RadTab
Text
=
"P.O."
>
</
telerik:RadTab
>
</
Tabs
>
</
telerik:RadTabStrip
>
<
telerik:RadMultiPage
ID
=
"RadMultiPage2"
runat
=
"server"
SelectedIndex
=
"0"
>
<
telerik:RadPageView
ID
=
"replenishmentPageView1"
runat
=
"server"
>
<
telerik:RadTreeList
ID
=
"requisitionTreeList"
runat
=
"server"
AutoGenerateColumns
=
"false"
AllowSorting
=
"false"
AllowPaging
=
"false"
OnNeedDataSource
=
"requistions_needdata"
OnPreRender
=
"replenishment_PreRender"
OnItemCreated
=
"requisitons_ItemCreated"
DataKeyNames
=
"ID"
ParentDataKeyNames
=
"PID"
ShowTreeLines
=
"false"
EditMode
=
"PopUp"
>
<
Columns
>
<
telerik:TreeListEditCommandColumn
ShowEditButton
=
"false"
AddRecordText
=
"Add"
HeaderStyle-Width
=
"30px"
/>
<
telerik:TreeListBoundColumn
DataField
=
"ID"
Visible
=
"false"
/>
<
telerik:TreeListBoundColumn
DataField
=
"PID"
Visible
=
"false"
/>
<
telerik:TreeListBoundColumn
DataField
=
"ReqNum"
HeaderText
=
"Req #"
UniqueName
=
"ReqNum"
/>
<
telerik:TreeListBoundColumn
DataField
=
"PONumber"
HeaderText
=
"PO #"
/>
<
telerik:TreeListBoundColumn
DataField
=
"ReqDateTime"
HeaderText
=
"Transmit Time"
/>
<
telerik:TreeListTemplateColumn
UniqueName
=
"TemplateEditColumn"
>
<
ItemTemplate
>
<
asp:HyperLink
ID
=
"EditLink"
runat
=
"server"
Text
=
"View/Edit"
href
=
"#"
onclick
=
"openRadWin();"
></
asp:HyperLink
>
</
ItemTemplate
>
</
telerik:TreeListTemplateColumn
>
</
Columns
>
</
telerik:RadTreeList
>
</
telerik:RadPageView
>
<
telerik:RadPageView
ID
=
"repenishmentPageView2"
runat
=
"server"
>
<
telerik:RadTreeList
ID
=
"purchaseorderTreeList"
runat
=
"server"
AutoGenerateColumns
=
"false"
AllowSorting
=
"false"
AllowPaging
=
"false"
OnNeedDataSource
=
"purchaseOrders_needdata"
DataKeyNames
=
"ID"
ParentDataKeyNames
=
"PID"
ShowTreeLines
=
"false"
EditMode
=
"PopUp"
>
<
Columns
>
<
telerik:TreeListEditCommandColumn
ShowEditButton
=
"false"
AddRecordText
=
"Add"
HeaderStyle-Width
=
"50px"
/>
<
telerik:TreeListBoundColumn
DataField
=
"ID"
Visible
=
"false"
/>
<
telerik:TreeListBoundColumn
DataField
=
"PID"
Visible
=
"false"
/>
<
telerik:TreeListBoundColumn
DataField
=
"PONumber"
HeaderText
=
"PO #"
/>
<
telerik:TreeListBoundColumn
DataField
=
"ReqNum"
HeaderText
=
"Req #"
/>
<
telerik:TreeListBoundColumn
DataField
=
"PODateTime"
HeaderText
=
"Transmit Time"
/>
</
Columns
>
</
telerik:RadTreeList
>
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
C#
protected
void
requisitons_ItemCreated(
object
sender, TreeListItemCreatedEventArgs e)
{
if
(e.Item
is
TreeListDataItem)
{
HyperLink editLink = (HyperLink)e.Item.FindControl(
"EditLink"
);
editLink.Attributes[
"href"
] =
"#"
;
//editLink.Attributes["onclick"] = "openRadWin(" + value + ");";
}
}