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

Update Telerik Controls and Callback

4 Answers 171 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Pablo Alejandre del Rio
Top achievements
Rank 1
Pablo Alejandre del Rio asked on 11 Jul 2008, 02:14 PM
Hello Telerik:

I am using a few Telerik components in a panel. I am doing a callback and in this method   ( Server  Side), I want to update  all these Telerik components
 
Can i do it ?

Regards. Pablo

4 Answers, 1 is accepted

Sort by
0
Accepted
Kevin Babcock
Top achievements
Rank 1
answered on 12 Jul 2008, 05:58 AM
Hello Pablo,

Based on my understanding of what you are asking, I would say yes you can update your RadControls in a server-side event handler. However, if you could provide a few more details about which controls you are trying to update and at what point in the page lifecycle (during which event) I might be able to give you a more definitive answer.

Sincerely,
Kevin Babcock
0
Pablo Alejandre del Rio
Top achievements
Rank 1
answered on 14 Jul 2008, 08:51 AM
The Scenario is as follows :

I have a asp table create dinamically with different information inside of every cell.

Well when the user  click over a cell, I want to execute some code in javascript, after this some code in the server side and finally some code in javascript and change the appareance of this cell .

So, the best way to do it, is with callbacks, but  I can't find how to use callbacks and update some parts of the page, even using RadAjaxManager.

So this is the basic schema :

1-The user clicks over a cell.
2-Extract the cell position in JavaScript.
3-Extract all the information inside of a cell and update a panel with this information  outside of the table.
4-Execute some code in JavaScript.


By the way the information to update inside of the panel is :

    Label

    RadTextbox

    RadColorPicker



So, my problem is in the step 3 when I update the panel with this information, obiously this panel isn't updated , but i tried with RadAjaxManager  and it isn't working either.

Do you know some fiddle or trick to sort it out ?

Regards.Pablo.
0
Pablo Alejandre del Rio
Top achievements
Rank 1
answered on 14 Jul 2008, 12:05 PM
Hello Kevin :

There is a solution finally.
 
Basically I work with the callback from the  AJAX Panel in stead of my own callbacks. And I create a callback event for every cell against  a overrride RaisePostBackEvent method  :

tableCell.Attributes.Add(

"onclick", ajaxpanelproperties.ClientID + ".ajaxRequestWithTarget('" + ajaxpanelproperties.UniqueID + "','" + tableCell.ID.ToString() + "')");

And after  i check if the callback has been done by a cell and the name of this one :

(this would be a example for one standart cell)

protected override void RaisePostBackEvent(IPostBackEventHandler source, String eventArgument)

{

    base.RaisePostBackEvent(source, eventArgument);

    switch (eventArgument)

    {

        case "_tableCell1":

            Telerik.Web.UI.

RadAjaxPanel ajaxpanelproperties = (RadAjaxPanel)

             App_Code.

WebControl.Find(rpdPanel, "ajaxpanelproperties");

            System.Web.UI.WebControls.

Label _lbltypebuttton = (Label)

            App_Code.

WebControl.Find(rpdPanel, "_lbltypebuttton");

            _lbltypebuttton.Text =

"Hello";

            break;

    }

}

Thank you anyway.Pablo

0
Kevin Babcock
Top achievements
Rank 1
answered on 14 Jul 2008, 12:40 PM
Pablo,

Great! I'm glad you were able to find a solution.

Regards,
Kevin Babcock
Tags
Ajax
Asked by
Pablo Alejandre del Rio
Top achievements
Rank 1
Answers by
Kevin Babcock
Top achievements
Rank 1
Pablo Alejandre del Rio
Top achievements
Rank 1
Share this question
or