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

return feedback message on remove node

3 Answers 12 Views
OrgChart
This is a migrated thread and some comments may be shown as answers.
Alaa'
Top achievements
Rank 1
Alaa' asked on 14 Apr 2014, 10:40 AM
Hi telerik ,
in my project  which like transfer employees example demo , I use remove concept
at ajaxrequest event on server before I remove node from chart i have a condition if it true i can remove the node, else i must return a message(eg:"this node can't remove") , how I can do that ? i try to use hiddenfield but it does't work correctly 

thank you 

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 16 Apr 2014, 09:24 AM
Hi Alaa,

I suggest that you can use a label to show the feedback message. Please have a look into the following sample code snippet to show the feedback message.

ASPX:
<telerik:RadOrgChart ID="RadOrgChart1" runat="server">
  ...       
</telerik:RadOrgChart>
<asp:Label ID="lblFeedbackMessage" runat="server">
</asp:Label>
<br />
<telerik:RadButton ID="btnRemoveNode" runat="server" Text="Remove" OnClick="btnRemoveNode_Click"></telerik:RadButton>

C#:
protected void btnRemoveNode_Click(object sender, EventArgs e)
{
    //your condiyion for removing the node
    if ()
    {
        //code for removing the node
         
    }
    else
    {
        //feedback message
        lblFeedbackMessage.Text = "this node can't remove";
    }
}

Please elaborate your requirement if it doesn't help.
Thanks,
Shinu.
0
Alaa'
Top achievements
Rank 1
answered on 17 Apr 2014, 06:11 AM
thnaks Shinu,
i try to apply what you say but it not work ! , in my case the delete button is an item template inside the node , and the delete operation done by RadAjaxManager_AjaxRequest event as the demo example transfer employees 
i want to ask if i should use the label in updated controls inside RadAjaxManager like the ORG chart and ListBox to be in the server at the same time .. i don't know if i understand how they work correctly !! :(
0
Shinu
Top achievements
Rank 1
answered on 17 Apr 2014, 08:17 AM
Hi Alaa,

In order to achieve your scenario you have to write both RadOrgChart and Label inside the RadAjaxManager as follows.

ASPX:
<telerik:RadAjaxManager runat="server" ID="RadAjaxManager1" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadOrgChart1" />
                <telerik:AjaxUpdatedControl ControlID="lblFeedbackMessage" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>

Hope this will helps you.
Thanks,
Shinu.
Tags
OrgChart
Asked by
Alaa'
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Alaa'
Top achievements
Rank 1
Share this question
or