Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
126 views
Hi
i am having treeview which shows parent node as company name and child node as employee name
there may be 2 conditions possible
1 ] IF logged in user is COMPANY ADMIN then the parent node=Company name and Child Nodes are employees from that company 

and image is also given
2 ] IF logged in user is SUPER USER then he can view all company as parent names and the employees in that company name
image is given and also code
private void BindToDataTable(RadTreeView RadTreeView1)
   {
       RadTreeView1.DataSource = "";
       RadTreeView1.DataBind();
        
       int UserId = Convert.ToInt32(Session["UserId"].ToString());
       int RoleId = Convert.ToInt32(Session["RoleId"].ToString());
       Temp = objGlobas.BindTreeView_Test(UserId, RoleId);
 
       //Get Permission to logged in user individually and by group and combine these Entities into one datatable dt2
 
       Globas ObjGlobas = new Globas();
       DataTable dtViewPermission = new DataTable();
       dtViewPermission = ObjGlobas.ViewPermission(UserId);
 
       DataTable RootNode = new DataTable();
       RootNode = Temp;
       DataView dView = new DataView(RootNode);
       string[] arrColumns = { "CompName", "CompId" };
       RootNode = dView.ToTable(true, arrColumns);
       if (Convert.ToInt32(Session["RoleId"]) == 1)
       {
           DataTable dtchildnode = new DataTable();
            
           if (Temp.Rows.Count > 0 && Temp != null)
           {
               foreach (DataRow row in RootNode.Rows)
               {
                   RadTreeNode tnparent = null;
                   string ParentNode = row["CompName"].ToString().Trim();
                   string ParentID = row["CompId"].ToString().Trim();
                   tnparent = new RadTreeNode(ParentNode);
                   tnparent.Value = ParentID.ToString();
                   RadTreeView1.Nodes.Add(tnparent);
                   tnparent.AllowEdit = false;
                   tnparent.ContextMenuID = "contextMenu1";
 
                   int CompanyId = Convert.ToInt32(ParentID);
                   dtchildnode = ObjGlobas.BindTreeView_SuperUser(CompanyId);
                   foreach (DataRow dr in dtchildnode.Rows)
                   {
                       RadTreeNode Child = null;
                       string child = dr["EntityName"].ToString();
                       string EntityId = dr["EntityId"].ToString();
                       Child = new RadTreeNode(child);
                       Child.Value = EntityId;
                       tnparent.Nodes.Add(Child);
                       Child.ContextMenuID = "contextMenu2";
                   }
               }
           }
       }
       else
       {
           if (Temp.Rows.Count > 0 && Temp != null)
           {
               foreach (DataRow row in RootNode.Rows)
               {
                   RadTreeNode tnparent = null;
                   string ParentNode = row["CompName"].ToString().Trim();
                   string ParentID = row["CompId"].ToString().Trim();
                   tnparent = new RadTreeNode(ParentNode);
                   tnparent.Value = ParentID.ToString();
 
                   RadTreeView1.Nodes.Add(tnparent);
                   tnparent.AllowEdit = false;
                   tnparent.ContextMenuID = "contextMenu1";
 
 
                   foreach (DataRow dr in dtViewPermission.Rows)
                   {
                       RadTreeNode Child = null;
 
                       string child = dr["EntityName"].ToString();
                       string EntityId = dr["EntityId"].ToString();
                       Child = new RadTreeNode(child);
                       Child.Value = EntityId;
                       tnparent.Nodes.Add(Child);
                       Child.ContextMenuID = "contextMenu2";
                   }
               }
           }
       }
      
        
   }


my problem is while SUPER USER login for each companys child node stored procedure is executing,is there any alternative way to do this.
Thanks
Swapnil
Top achievements
Rank 1
 asked on 06 Dec 2013
1 answer
105 views
Hello,
 
I am displaying a RadWindow in modal form. Window displays fine but if I move window around and try to move it over a menu, then the menu is shown on the top, window gets below. Plus if I keep moving it then it goes under the address bar of the browser. After that there is no way to drag window back. See the screen shot attached .... Any suggestions?

Thanks in advance!
Princy
Top achievements
Rank 2
 answered on 06 Dec 2013
4 answers
186 views
Only first row RadButton in RadGrid can fire, please help.
Thanks

In Grid:
<telerik:GridTemplateColumn HeaderStyle-Width="20%" UniqueName="ButtonSet">
    <ItemTemplate>
        <telerik:RadButton runat="server" id="Button1" CommandName="Action1" AutoPostBack="true" CausesValidation="false" OnClientClicked="clientclick"></telerik:RadButton>
        <telerik:RadButton runat="server" id="Button2" CommandName="Action2" AutoPostBack="true"></telerik:RadButton>
    </ItemTemplate>
</telerik:GridTemplateColumn>

In RadAjaxManager:
<telerik:AjaxSetting AjaxControlID="Button1
"
>
    <UpdatedControls>
        <telerik:AjaxUpdatedControl ControlID="label" LoadingPanelID="RadAjaxLoadingPanel1" />
    </UpdatedControls>
</telerik:AjaxSetting>

if (e.CommandName == "Action1")
{
    //do sth
}
else if (e.CommandName == "Action1")
{
    //do sth
}










Roland
Top achievements
Rank 1
 answered on 06 Dec 2013
1 answer
303 views

Hi There

I have master/content page with two ContentPlaceHolders: Nav and Main. both Nav and Main contain UserControls, where Nav has a navigation UserControl (RadPanel with RadTreeView) and Main has a RadGrid (kind of obvious, right ;-) ).

Obviously the objective is to populate the RadGrid with data dependent on the node that is clicked.

Instead of bubbling up events from the user controls, which I find awkward, I thought I could put the NodeClick Event Handler in the code behind on the content page and assign the event handler in the page load event:



protected void Page_Load(object sender, EventArgs e)
    {
        if (!Page.IsPostBack)
        {
            ContentPlaceHolder cph = (ContentPlaceHolder)this.Master.FindControl("ContentPlaceHolderNav");
            RadPanelBar rpb = (RadPanelBar)cph.FindControl("RadPanelBar1");
            RadPanelItem itm = (RadPanelItem)rpb.Items[1];
            UserControl uc = (UserControl)itm.FindControl("Nav");
            RadTreeView rtv = (RadTreeView)uc.FindControl("RadTreeView2");
            rtv.NodeClick += RadTreeView1_NodeClick;
        }
    }


The code works - when stepping through I can see that the TreeView is found - but the event doesn't fire when clicking on a node (-> a breakpoint in RadTreeView1_NodeClick in the content page is not reached).

Is what I'm trying to do not possible? Or does this just need to go somewhere else in the page lifecycle (Page_Init?).

Thx in advance for help and/or pointers!

Rgds - Marcus.

Shinu
Top achievements
Rank 2
 answered on 06 Dec 2013
1 answer
204 views
Hi,


     I have anchor tag in my masterpage.I want to find that control.

     And want to trigger confirm alert  in onclick of that control.


Thanking you,

P.Mugil


 
Princy
Top achievements
Rank 2
 answered on 06 Dec 2013
1 answer
130 views
I have RadNumericTextBox and asp:DropDownList. How can I implement the following:
If RadNumericTextBox.value empty or 0 set asp:DropDownList enable=true
else asp:DropDownList enable=false without postback?

Shinu
Top achievements
Rank 2
 answered on 06 Dec 2013
2 answers
665 views
 
Hi ,

        I have two textbox in my apllication.

       One is inside updatepanel and another  one is outside of update panel.

       My need is when change the  textbox value which is inside update panel i want to increment the     count of textbox automatically which i have outside of update panel.

       Note:I just mentioned textbox as your reference.it may be dropdownlist  or any other controls in updatepanel but outside of updatepanel im having  textbox only.



with regards,
Mugil
Mugil
Top achievements
Rank 1
 answered on 05 Dec 2013
4 answers
149 views
Hi I have a radbutton inside content template of the raddock.. How do I get hold of raddock client object on client clicked event of radbutton? Thanks!
Chetan
Top achievements
Rank 1
 answered on 05 Dec 2013
5 answers
254 views
Hi I want to show Radwindow on submit click. can any one please send me server side code on click event.

Thanks,
Naresh
Naresh
Top achievements
Rank 1
 answered on 05 Dec 2013
3 answers
144 views
We currently have a series of hierarchical radgrids that we'd like to replace with the treelist control.  I've gotten most of the basic work done w/ regard to porting from the grid to the treelist, but I can't locate information on how to save / load user settings (e.g., column size, sort order, etc.).  (We use the TelerikGridHelper for our rad grids and it works like a champ.)  Is there an equivalent tool for saving the treelist settings?

Also, we provide our users with the ability to group columns, sort columns and show/hide columns in the radgrid using the header context menu.  How is this done for a tree list?  Again, I've looked for it in the documentation, but I'm either overlooking it or it's not there.

thanks -
matt
Eyup
Telerik team
 answered on 05 Dec 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?