This is a migrated thread and some comments may be shown as answers.

[Solved] command item template client side

1 Answer 148 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Michael
Top achievements
Rank 1
Michael asked on 11 Apr 2013, 07:49 PM
Hello,

I have a user control inside an update panel with a radgrid inside of the user control. Further, the radgrid contains a command item template which contains controls such as radbutton and radcombobox. On the client, during the application load event, I $find various controls within the grid's command template and add client side event handlers (e.g. button --> add_clicking). This works perfectly on the initial page load. However, during an update panel post back, the initial user control is swapped out for a different user control by setting one control's visibility to false and the other's to true. The second control is made visible and the first is made invisible as I would expect. However, when I try to repeat this process in order to bring back the initial user control I encounter a problem. I can still $find the radgrid control located within the initial user control, but I can no longer $find the controls within the grid's command item template. It acts as though the client side initialization scripts for the command template items might not have been executed as part of the update panel post back. Does this make sense and what can I do to resolve this?

Thanks.

1 Answer, 1 is accepted

Sort by
0
Angel Petrov
Telerik team
answered on 16 Apr 2013, 12:47 PM
Hello Michael,

Could you please elaborate more on how exactly are you changing the visibility of the controls? When setting the Visible property to false the HTML will not be rendered. That said you will be prevented from obtaining a reference to the client-side objects of the controls. I suggest that you try hiding/showing the controls using CSS(you can use the display property). That way the HTML will be available and you should be able to obtain the necessary references.

All the best,
Angel Petrov
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Tags
Grid
Asked by
Michael
Top achievements
Rank 1
Answers by
Angel Petrov
Telerik team
Share this question
or