5 Answers, 1 is accepted
0

Princy
Top achievements
Rank 2
answered on 16 May 2011, 02:46 PM
Hello Rajz,
I am not quite sure about the exact requirement. If you are using RadComboobx inside Template column, one easy approach is to hook OnClientLoading and store its client ID as a global variable as shown below.
aspx:
Javascript:
In case of controls inside Item Template column, you can use either findElement() or findControl(), based on the scenario.
findControl():This method takes control id for an argument and returns the corresponding client object of RadControl or ASP.NET AJAX control inside the grid row
findElement:This method takes control id for an argument and returns the corresponding DOM element of html or rendered server control inside the grid row.
Thanks,
Princy.
I am not quite sure about the exact requirement. If you are using RadComboobx inside Template column, one easy approach is to hook OnClientLoading and store its client ID as a global variable as shown below.
aspx:
<
telerik:GridTemplateColumn
>
<
EditItemTemplate
>
<
telerik:RadComboBox
ID
=
"RadComboBox1"
runat
=
"server"
OnClientLoad
=
"OnClientLoad"
>
<
Items
>
<
telerik:RadComboBoxItem
Text
=
"Item1"
/>
<
telerik:RadComboBoxItem
Text
=
"Item2"
/>
</
Items
>
</
telerik:RadComboBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
Javascript:
<script type=
"text/javascript"
>
var
combo;
function
OnClientLoad(sender, args)
{
combo = sender;
}
</script>
In case of controls inside Item Template column, you can use either findElement() or findControl(), based on the scenario.
findControl():This method takes control id for an argument and returns the corresponding client object of RadControl or ASP.NET AJAX control inside the grid row
findElement:This method takes control id for an argument and returns the corresponding DOM element of html or rendered server control inside the grid row.
Thanks,
Princy.
0

Rajz
Top achievements
Rank 1
answered on 17 May 2011, 05:55 AM
I am sorry, I forgot to tell, It is not rad dropdown it is ASP.net dropdown
0

Princy
Top achievements
Rank 2
answered on 17 May 2011, 06:45 AM
Hello Raj,
Here is a sample code to access the Drop Down list in RowClick event.
aspx:
Javascript:
Thanks,
Princy.
Here is a sample code to access the Drop Down list in RowClick event.
aspx:
<
RadGrid
. . . . .>
. . . . .
<
telerik:GridTemplateColumn
HeaderText
=
"Price"
>
<
ItemTemplate
>
<
asp:DropDownList
ID
=
"DropDown1"
runat
=
"server"
>
</
asp:DropDownList
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
. . . . . . . . . . .
</
MasterTableView
>
<
ClientSettings
ClientEvents-OnRowClick
=
"onRowClick"
>
</
ClientSettings
>
</
RadGrid
>
function
onRowClick(sender, args)
{
var
ddl= args.get_item().findElement(
"DropDown1"
);
alert(ddl.get_id());
}
Thanks,
Princy.
0

Rajz
Top achievements
Rank 1
answered on 17 May 2011, 07:57 AM
Thanks indeed for the response.
But the dropdown is in the grid's add new popup window
But the dropdown is in the grid's add new popup window
0

Shinu
Top achievements
Rank 2
answered on 17 May 2011, 10:37 AM
Hello Raj,
You can store the client ID of the DropDownList in window object attribute (global scope variable) and then trace the DropDownList on the client calling the document.getElementById(id) javascript method.
Check out the following code library for more on this.
Accessing server controls in a grid template on the client
Thanks,
Shinu.
You can store the client ID of the DropDownList in window object attribute (global scope variable) and then trace the DropDownList on the client calling the document.getElementById(id) javascript method.
Check out the following code library for more on this.
Accessing server controls in a grid template on the client
Thanks,
Shinu.