Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
158 views
I am creating RadTreeNode as follows:

protected RadTreeNode BuildOption(Options option, string questionType)
    {
RadTreeNode nodeOption =
new RadTreeNode();
 
       nodeOption.Text = "(" + option.OrderID.ToString() + ") " + option.Name;
       nodeOption.Value = option.OptionsID.ToString();
       nodeOption.Attributes.Add(SurveyTreeNodeAttributes.SurveyTreeNodeType, ((int)EnumsBL.SurveyTreeNodeType.Option).ToString());      
       nodeOption.Attributes.Add(SurveyTreeNodeAttributes.QuestionType, questionType);
       nodeOption.ImageUrl = "~/images/ConstIcons/icon-question-option.png";
       return nodeOption;
}
I am also loading the tree nodes on demand as follows:   
Code Behind:
[WebMethod]
public static RadTreeNodeData[] LoadNodes(RadTreeNodeData node, object context)
{
    EnumsBL.SurveyTreeNodeType nodeType = (EnumsBL.SurveyTreeNodeType)Enum.Parse(typeof(EnumsBL.SurveyTreeNodeType), node.Attributes[SurveyTreeNodeAttributes.SurveyTreeNodeType].ToString());
    TreeNodeBuilder treeNodeBuilder = QuestionnaireTreeBuilderFactory.GetQuestionnaireTreeBuilder(nodeType);
    return treeNodeBuilder.BuildChildNodesData(node.Value);
}
ASCX:
<telerik:RadTreeView ID="radTree"
          Skin="Default"
          BackColor="White"
          BorderStyle="Solid"
          BorderColor="#CCCCCC"
          BorderWidth="1px"
          AllowNodeEditing="true"
          Style="cursor: hand;"
          Height="250px"
          EnableDragAndDrop="false"
          OnNodeClick="NodeClick"
           SingleExpandPath="true"
          runat="server">
         <WebServiceSettings  Path="../../Constructor/AdaptiveAnswerBuilder.aspx" Method="LoadNodes" />
      </telerik:RadTreeView>
I have debugged method "LoadNodes" and checked that RadTreeNodeData object array contains the two attributes added to the node at the top.

However when a node is selected I only get(after debugging) one node custom attributes, not two:
protected void TreeNodeClicked(object sender, RadTreeNodeEventArgs e)
   {
       RadTreeNode selectedNode = e.Node; //only one of the attributes, assigned during node creation, are present
       switch ((EnumsBL.SurveyTreeNodeType)Enum.Parse(typeof(EnumsBL.SurveyTreeNodeType), selectedNode.Attributes[SurveyTreeNodeAttributes.SurveyTreeNodeType]))
       {          
           case EnumsBL.SurveyTreeNodeType.Option:
               SetViewstateVariables(selectedNode);
               SetConditionValueHolder(int.Parse(selectedNode.Value));
               EnableSaveButton();
               break;
           default:
                pnlCondEqual.Visible = false;
                DisableSaveButton();
               break;
       }       
   }

How do I get the other attribute?

Regards,
--Fahmi
Dimitar Terziev
Telerik team
 answered on 24 Dec 2012
1 answer
189 views
Hi,

I am having an issue getting the RadGrid-MasterTableView on client-side. I have a RadGrid on the page which does not have static defined columns and I cannot get the mastertableview. Also I defined some static columns and still cannot get the MasterTableVIew.

My final goal is add columns to my RadGrid on the fly using client-side. I could defined to static columns there but other columns are going to be added on dynamically.

What I am missing in my code that I cannot get the MasterTable to add my data to the grid
Thank you in advance


This the code that I am using to get those intance and I can get the grid object but not the MasterTable
   var grid = $find("<%=RadGrid1.ClientID %>");
                       var MasterTable = grid.get_masterTableView();  
                       
//                       var tableView = $find("<%= RadGrid1.ClientID %>").get_masterTableView();

<telerik:RadGrid ID="RadGrid1" runat="server" autogeneratecolumns="false" allowsorting="true" allowpaging="true">
<PagerStyle AlwaysVisible="true" />
   <MasterTableView>
     <Columns>
       <telerik:GridBoundColumn DataField="automobile" UniqueName="automobile" HeaderText="automobile" ></telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="betrayal" UniqueName="betrayal" HeaderText="betrayal" ></telerik:GridBoundColumn>
       <telerik:GridBoundColumn DataField="DataSourceRecordID" UniqueName="DataSourceRecordID" HeaderText="DataSourceRecordID" ></telerik:GridBoundColumn>
     </Columns>
   </MasterTableView>
</telerik:RadGrid>
Jayesh Goyani
Top achievements
Rank 2
 answered on 24 Dec 2012
1 answer
56 views
Hi,

Would it be possible to implement selective drill down on RadChart?  Say, only certain chart items have sub-data behind it, while others don't.  I would like to "disable" the click event for those that don't.  Is this possible?

Thanks.


Evgenia
Telerik team
 answered on 24 Dec 2012
1 answer
65 views
Hi
I have a dynamically added UserControl inside my RadTreeView. During a serverside event, I need to get the control to extract the data inside, but I cannot seem to find the control. The binding is executed both on post and postback.

This is the binding of the control:
foreach (Event item in eventList)
{
    RadTreeNode rootNode = new RadTreeNode(item.Name, item.Id.ToString());
    rootNode.Expanded = true;
    RadTreeNode childNode = new RadTreeNode();
 
    ActorNode actorNode = (ActorNode)LoadControl("ComponentControls/ActorNode.ascx");
    actorNode.ID = ACTOR_NODE_ID + item.Id;
 
    List<Actor> actorList = Actor.GetActorList(item.Id);
    List<MunicipalityActor> munActorList = MunicipalityActor.GetMunActorList(MunCode);
 
    actorNode.InitializeControl(municipalityActorList, actorList);
 
    childNode.Controls.Add(actorNode);
    rootNode.Nodes.Add(childNode);
 
    RadTreeView_Actors.Nodes.Add(rootNode);
}

This is the serverside event, where I am trying to get hold of the data...
foreach (RadTreeNode rootNode in RadTreeView_Actors.Nodes)
{
    Control control = rootNode.Nodes[0].FindControl(ACTOR_NODE_ID + rootNode.Value);
}

Is the control-id not what i set it to?

Bozhidar
Telerik team
 answered on 24 Dec 2012
5 answers
298 views
for the example listed here http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/autogeneratedhierarchy/defaultcs.aspx

I want to hide a column in child table from code behind .. for example if I wanted to hide the order_ID in the child view how would I do that from code behind when the grid has been created programtically.
Eyup
Telerik team
 answered on 24 Dec 2012
1 answer
46 views
hi
i want to visible or invisible a radpane with javascript in my app.
but not working by collapse and expand well.
if there are a different method please help me.
Princy
Top achievements
Rank 2
 answered on 24 Dec 2012
7 answers
543 views
Hello,

I have a master page and a content page.
Is it possible to have a RadAjaxPanel on a master page and a RadAjaxManger on a content page?

Greetings,
Willem Vissser
Eyup
Telerik team
 answered on 24 Dec 2012
3 answers
71 views
While export to PDF from radgrid, it displays FALSE below header, its is due to Allow Filtering Check box column value. If i set AllowFiltering=False; then it doesn't display FALSE. But i need Allow filtering as True.
I have attached an image. How to remove False below header?
Princy
Top achievements
Rank 2
 answered on 24 Dec 2012
1 answer
80 views
Hi, I have the list of records I want to display just in the grid view column as the label or text. But when the users goes for edit or add new I want to display some columns in dropdown or combo box. Please help me if someone already have done this scenario.

I don't want to display in comboBox from the loading of the grid since it takes un-necessary resources on loading all the records for each column in each cells.

thanks
Shinu
Top achievements
Rank 2
 answered on 24 Dec 2012
2 answers
75 views
Hello,

I like this control! A question about a minor issue: I noticed that the build in buttons render (see attachment) even though I've configured custom buttons to be used (working perfectly by the way). Can I prevent those build in buttons from being rendered? It's sort of a waste to have them in the HTML if not being used.
Arno
Top achievements
Rank 2
 answered on 23 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?