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

Select a Default Node and show highlightes

1 Answer 57 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Jennifer
Top achievements
Rank 1
Jennifer asked on 10 Jun 2010, 04:50 PM
Hi, I am using the tree control. When the page loads I want it to look like the 1st node is selected. I am using the Outlook skin so I want it to highlighted blue.

Basically, when the page loads, I have a tree view on the left side of the page and the data that gets displayed is on the right side of the page. So when you first come to the page, the first node needs to be selected and the right side will already have the data displayed in that area.

Can anyone help. Thanks in advance

Also, when I deployed the site, I included the Telerik DLL of course but I added this line in the web.config because I was getting a Telerik error ScriptResource.axd not found
 <!--<httpHandlers>
      <remove verb="*" path="*.asmx"/>
      <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
      <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
      <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI" validate="false" />
    </httpHandlers>
   
This helped but now another programmer is telling me I cant have this in web.config in IIS7

It works on my machine but not the deployment server.

Does anyone know the answer here

1 Answer, 1 is accepted

Sort by
0
Nikolay Tsenkov
Telerik team
answered on 15 Jun 2010, 09:28 AM
Hello Jennifer,

Well you can easily set the first node to be with property Selected="true" in the markup of your TreeView, but if on the "right side" is a page loaded all the time and all the pages have representation in the treeView (node with the url to the page), than you can put in the Page_Load of the pages something like the following that will connect the treeView's nodes selection with the currently loaded page:
string url = Request.Url.PathAndQuery;
var correspondingNode = RadTreeView1.FindNodeByUrl(url);
correspondingNode.ExpandParentNodes();
correspondingNode.Selected = true;

About the problem with the config - your colleague is right, the httpHandlers section is used only by IIS 6 and below. For IIS 7 you also need to register the handlers in the system.webServer section.

<system.webServer>
  <validation validateIntegratedModeConfiguration="false" />
  <modules>
    <remove name="ScriptModule" />
    <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  </modules>
  <handlers>
    <remove name="WebServiceHandlerFactory-Integrated" />
    <remove name="ScriptHandlerFactory" />
    <remove name="ScriptHandlerFactoryAppServices" />
    <remove name="ScriptResource" />
    <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
    <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
  </handlers>
</system.webServer>

Please see this help article for more information.

Hope this is helpful for you!


Regards,
Nikolay Tsenkov
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
TreeView
Asked by
Jennifer
Top achievements
Rank 1
Answers by
Nikolay Tsenkov
Telerik team
Share this question
or