I have a radGrid with two LinkButtons defined in the ItemTemplate of a column.
Then I have two different panels, outside the grid, that must be updated accordingly to which LinkButton has been pressed.
In example if I press LinkButton1, only Panel1 must be updated. If I press LinkButton2 only Panel2 will be updated.
The problem is that I can't access to the LinkButtons inside the Grid, therefore in the AjaxManager, I've set:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="GrdBlogPost">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="Panel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
So I have set as control that trigger the ajax postback, the whole grid, but I can differentiate who's the real nested controls that has fired the events.
Even if I explicitly write the IDs of the nested controls:
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="LinkButton1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="Panel1" />
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="LinkButton2">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="Panel2" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>
both Panel1 and Panel2 are updated, no matter if I've clicked LinkButton1 or LinkButton2 (I think that is always the container, the RadGrid, the one that fires the event)
How can I differentiate the updated controls based on which nested control has been clicked inside the Grid?
You can't reference the link buttons in the grid like that, anything inside the grid is more or less unreachable by server side code and server controls.
What you CAN do is extract your button functionality to hidden buttons outside the grid, and click them using JavaScript calls initiated by your grid link buttons. I don't have your code to work with so this will be pseudo code.
//grid template
<RadTemplateColumn>
<asp:LinkButton ID="LinkButton1" onclick="myFunction1(); return false;" />
</RadTemplateColumn>
//javascript
<script>
function myFunction1(){
$("#hdnButton1").click();
}
</script>
//hidden button
<telerik:RadButton style="display:none;" ID="hdnButton1" ClientIDMode="Static" OnClick="ServerMethod1" />
//ajax settings referencing hidden button now
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="hdnButton1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="Panel1" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManager>