Hey,
I have a Problem with following grid (trimmed down to the essential parts only). On a RadTextBox-Enter I want to call a JavaScript function, which calls the onClick function of a button with ID "btnSearch". This it how it Looks like
Unfortunately, this does not seem to work, since the $find cannot find the button. I also tried to find it like this
But I don't get down to the button. Can anyone please lend me some helping hand to find and call my Button?
I have a Problem with following grid (trimmed down to the essential parts only). On a RadTextBox-Enter I want to call a JavaScript function, which calls the onClick function of a button with ID "btnSearch". This it how it Looks like
<
script
type
=
"text/javascript"
>
function OnKeyPress(sender, args)
{
if (args.get_keyCode() == 13)
{
// find button "btnSearch" and click it
var buttonTmp = $find("<%= btnSearch.ClientID %>");
buttomTmp.click();
}
}
</
script
>
<
telerik:RadGrid
runat
=
"server"
ID
=
"grid1"
GridLines
=
"None"
ShowFooter
=
"False"
Culture
=
"de-DE"
>
<
MasterTableView
AutoGenerateColumns
=
"False"
AllowMultiColumnSorting
=
"True"
CommandItemDisplay
=
"Top"
>
<
CommandItemTemplate
>
<
telerik:RadToolBar
ID
=
"radToolBar"
Skin
=
"Windows7"
runat
=
"server"
AutoPostBack
=
"true"
Width
=
"100%"
>
<
Items
>
<
telerik:RadToolBarButton
Value
=
"section1"
CssClass
=
"rightAligned"
>
<
ItemTemplate
>
<
telerik:RadButton
runat
=
"server"
Skin
=
"Windows7"
Text
=
"ButtonText1"
CommandName
=
"ButtonCommand1"
OnClick
=
"buttonAction1_Click"
/>
</
ItemTemplate
>
</
telerik:RadToolBarButton
>
<
telerik:RadToolBarButton
IsSeparator
=
"True"
/>
<
telerik:RadToolBarButton
Value
=
"section2"
>
<
ItemTemplate
>
<
telerik:RadTextBox
ID
=
"textbox1"
runat
=
"server"
Skin
=
"Windows7"
><
ClientEvents
OnKeyPress
=
"OnKeyPress"
/></
telerik:RadTextBox
>
<
telerik:RadButton
ID
=
"btnSearch"
runat
=
"server"
Skin
=
"Windows7"
Text
=
"Search"
CommandName
=
"Search"
OnClick
=
"searchButton_Click"
/>
</
ItemTemplate
>
</
telerik:RadToolBarButton
>
</
Items
>
</
telerik:RadToolBar
>
</
CommandItemTemplate
>
</
MasterTableView
>
<
GroupingSettings
CaseSensitive
=
"False"
/>
</
telerik:RadGrid
>
Unfortunately, this does not seem to work, since the $find cannot find the button. I also tried to find it like this
var grid = $find("<%= activePassiveGrid.ClientID %>");
var MasterTable = grid.get_masterTableView();
var toolBar = MasterTable.get_dataItems()[0]......
But I don't get down to the button. Can anyone please lend me some helping hand to find and call my Button?