Telerik Forums
UI for ASP.NET AJAX Forum
8 answers
213 views

Telerik team,


I have radtreeview in radsplitter.[Telerik DLL V2012.1.411.40]

I have a requirement where on a selected index change of RadCombobox a radtree control should be generated. Now if I have selected a value say A from Combobox, the Tree will be generated. Now I select a Node say Node1 from the Tree and then select a different value from Picklist to regenerate the Tree. Now I want that if Node1 is again present as a Node in the new Tree generated, it should be selected and have focus on the respected Node i.e. Node1.

Following is my code

<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true" MaintainScrollPositionOnPostback="true"
    CodeFile="Default.aspx.cs" Inherits="_Default" %>
    <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<asp:Content ID="HeaderContent" runat="server" ContentPlaceHolderID="HeadContent">
<script type="text/javascript">
 
    function OnClientClicking_RadButton(splitter, arg) {
        var RadTreeView1 = $find("<%=RadTreeView1.ClientID %>");
        var Selectednode = RadTreeView1.get_selectedNode();
        if (Selectednode != null) {
            Selectednode.scrollIntoView();
            alert(Selectednode.get_text());
        }
    }
 
    function splitter(splitter, arg) {
        var RadTreeView1 = $find("<%=RadTreeView1.ClientID %>");
        var Selectednode = RadTreeView1.get_selectedNode();
        if (Selectednode != null) {
            Selectednode.scrollIntoView();
            alert(Selectednode.get_text());
        }
    }
 
</script>
 
</asp:Content>
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
 <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
           <telerik:AjaxSetting AjaxControlID="RadComboBox">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="radsplitter" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
           </telerik:AjaxSetting>
 
           </AjaxSettings>
           </telerik:RadAjaxManager>
 
            <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1">
    </telerik:RadAjaxLoadingPanel>
 
   <telerik:RadSplitter ID ="radsplitter" runat="Server" Width="100%" >
    <telerik:RadPane ID="Radpane" runat="server" Width="30%">
    <telerik:RadTreeView ID="RadTreeView1" runat="server" CheckBoxes="false" AllowNodeEditing="True" Skin="Vista"
                 EnableDragAndDrop="true" >
            </telerik:RadTreeView>
    </telerik:RadPane>
    <telerik:RadSplitBar ID="Splitbar" runat="server" CollapseMode="Forward" ></telerik:RadSplitBar>
      <telerik:RadPane ID="Radpane1" runat="server">
      <telerik:RadComboBox ID="RadComboBox" runat="server" AutoPostBack="true"  OnSelectedIndexChanged="RadComboBox_SelectedIndexChanged" >
      <Items>
      <telerik:RadComboBoxItem Text ="Tree1" Value="1" />
      <telerik:RadComboBoxItem Text ="Tree2" Value="2" />
      </Items>
      </telerik:RadComboBox>
      </telerik:RadPane>
     
   </telerik:RadSplitter>
 
</asp:Content>

using System;
using Microsoft.VisualBasic;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Diagnostics;
using Telerik.Web.UI;
using System.Web.UI;
using System.Xml.Linq;
using System.ComponentModel;
using System.Drawing;
using System.Web;
using System.Web.SessionState;
using System.Web.UI.WebControls;
using System.Web.UI.HtmlControls;
using System.Xml;
using System.Text;
using System.Linq;
using System.Configuration;
using System.Security.Cryptography;
using System.IO;
using System.Drawing;
using System.Text.RegularExpressions;
public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
 
    }
 
    protected void RadComboBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
    {
        DataTable dt = new DataTable();
        DataRow dr ;
        String selectednode = "";
        if (RadTreeView1.SelectedNode != null)
            selectednode = RadTreeView1.SelectedNode.Value;
 
        if (RadComboBox.SelectedValue == "1")
        {
            dt.Columns.Add("NODE_ID", typeof(int));
            dt.Columns.Add("PARENT_NODE_ID", typeof(int));
            dt.Columns.Add("NODE_NAME", typeof(String));
 
            for (int i = 1; i < 100; i++)
            {
                dr = dt.NewRow();
                dr["NODE_ID"] = i;
                if (i != 1)
                    dr["PARENT_NODE_ID"] = 1;
                dr["NODE_NAME"] = i.ToString() + " Operating costs";
                dt.Rows.Add(dr);
            }
 
            RadTreeView1.DataFieldID = "NODE_ID";
            RadTreeView1.DataFieldParentID = "PARENT_NODE_ID";
            RadTreeView1.DataTextField = "NODE_NAME";
            RadTreeView1.DataValueField = "NODE_ID";
            RadTreeView1.DataSource = dt;
            RadTreeView1.DataBind();
            RadTreeView1.ExpandAllNodes();
            RadTreeView1.EnableViewState = true;
            
        }
 
        if (RadComboBox.SelectedValue == "2")
        {
            dt.Columns.Add("NODE_ID", typeof(int));
            dt.Columns.Add("PARENT_NODE_ID", typeof(int));
            dt.Columns.Add("NODE_NAME", typeof(String));
 
            for (int i = 1; i < 100; i++)
            {
                dr = dt.NewRow();
                dr["NODE_ID"] = i;
                if (i != 1)
                    dr["PARENT_NODE_ID"] = 1;
                dr["NODE_NAME"] = i.ToString() + " Report whether management has quantitatively estimated the financial implications (e.g., cost of insurance and carbon credits) of climate change for the organization. Where possible, quantification would be beneficial. If quantified, disclose financial implications and the tools used to quantify";
                dt.Rows.Add(dr);
            }
 
            RadTreeView1.DataFieldID = "NODE_ID";
            RadTreeView1.DataFieldParentID = "PARENT_NODE_ID";
            RadTreeView1.DataTextField = "NODE_NAME";
            RadTreeView1.DataValueField = "NODE_ID";
            RadTreeView1.DataSource = dt;
            RadTreeView1.DataBind();
            RadTreeView1.ExpandAllNodes();
            RadTreeView1.EnableViewState = true;
 
        }
 
        if (selectednode != "")
        {
            RadTreeNode node = RadTreeView1.FindNodeByValue(selectednode);
            node.Selected = true;
        }
    }
 
}


Thanks

Sampada


Plamen
Telerik team
 answered on 06 Jun 2013
2 answers
60 views
Hello,

i am using fulltextsqlquery to get result in share point search and binding results into a grid.

The query returns "ID" and "StaffID".I would like to format those 2 values as mentioned below in gridtemplatecolumn.

and i would like to use that formatted values which is say for ex - (1-33333) as my clientdatakeynames.

Please suggest how could i achieve this?

 <telerik:GridTemplateColumn HeaderText="UniqueID" UniqueName="UniqueID" ItemStyle-CssClass="grid_column"
                                                    Visible="true" ItemStyle-Width="10%" >
                                                    <ItemTemplate>
                                                    <%# String.Format("{0}-{1}", Eval("ID"), Eval("StaffID"))%>    
                                                    </ItemTemplate>
                                                </telerik:GridTemplateColumn>

Thanks in advance.
Sreenivas
Top achievements
Rank 1
 answered on 06 Jun 2013
0 answers
48 views
Hi,
I am working with an application using ASP.NET. In my application i want to concurrently accessing and modifying the documents(files) in an application similar to googledocs. 
In the same way i want to implementing in my application. All files are stored in company server and I am not intreseted to store the files in Google docs. I will access those files from company sever not google server. 

can any one knows the code plz tell me asap. If any tools are available plz tell me. 
Harikrishna
Top achievements
Rank 1
 asked on 06 Jun 2013
3 answers
188 views

I have broken down the site I am developing into multiple files developed as user controls. It makes more sense to simply add a single usercontrol than to add half a dozen or more other controls to multiple pages, plus when I need to edit the item it gets applied site-wide. However, there seems to be an issue that I am not sure how to handle.

I have a user control "header.ascx" that is included on several webpages.

<%@ Register Src="menu.ascx" TagName="menu" TagPrefix="uc1" %>
<div id="header">

    <div id="orgname" class="headerinfo" style="position: relative; z-index: 1500; text-align: right">
        <asp:Label ID="lblOrganizationName" runat="server" Font-Names="Arial Black" ForeColor="Gray" Text="Organization Name"
            Font-Size="Large"></asp:Label>
    </div>
    <div id="logindetails" class="headerinfo" style="text-align: right; position: relative;
        z-index: 1500; top: 0px; left: 0px;">
        <asp:Label ID="lblUser" runat="server" Font-Names="Arial" ForeColor="Gray" Text="User Name"
            Font-Size="Small"></asp:Label
        <asp:LoginStatus ID="LoginStatus1" runat="server" Font-Names="Tahoma,Arial" ForeColor="#FF6600" />
           
        <asp:Label ID="lblPage" runat="server" Font-Names="Arial Black" ForeColor="Gray"
            Text="" Font-Size="Small"></asp:Label>   
        <uc1:menu ID="menu1" runat="server" />
    </div>
</div>

As you can see, I have also included a user control "menu.ascx" that is part of the header as well as part of other pages that don't include the full header.

When I view menu.ascx in the IDE, the menu is rendered correctly. If I view header.ascx in the IDE the menu is rendered correctly, however, whenever I view any page in the IDE that has a header user control, I get an error "Unknown server tag 'telerik:RadMenu'" and the menu isn't rendered.

When the menu isn't nested in another user control, it displays correctly. However, when it is included as part of a larger user control, it does not.

I can build the site and it renders correctly in the browser, however, I cannot see how it interacts with the design when it will not show on the main page.

Am I missing a directive or something so this will display?

Boyan Dimitrov
Telerik team
 answered on 06 Jun 2013
1 answer
43 views

Hello, I have some content which needs to be extracted as a PDF and right now I'm able to achieve this by Using RadEditor Export to PDF functionality.

Today We have observed that the extracted PDF is not getting displayed in Windows 8 PDF reader. Is it anything that can be fixed from the Editor itself ?

Danail Vasilev
Telerik team
 answered on 06 Jun 2013
2 answers
45 views
Hello all,

I have the ASP.NET Telerik controls and would like to do something using the AJAX controls, but I need some direction to get started.  I have a RadGrid that's pulling back data from a database.  In each row, there's an asp.net checkbox control and a text box (both within separate GridTemplateColumn rows).  Outside of the grid there is an asp.net label that contains the sum of each text box.  (This was a requirement of the solution).  What I'd like to have happen is, whenever a user checks/unchecks the checkbox, the value within the text box of that row toggles between 0 and the value of another gridrow.  At the same time, the label displays the updated total of all textboxes within the grid.

I know this can be done through javascript, but I was hoping I could take advantage of Telerik controls and the AJAX capabilities to do this without having to write code.  Is this possible with, say, Telerik update panels, Ajax Manager and other controls?

Thank you in advance.
Eyup
Telerik team
 answered on 06 Jun 2013
1 answer
262 views
Hello ,

I want to change mouse cursor when i perform drag and drop functionality in radtreeview control ,
actually i show validation image  with cursor that this is valid drag and drop or not 
Please give solution as soon as 

Thanks Regards
Rakesh Jogani
Shinu
Top achievements
Rank 2
 answered on 06 Jun 2013
25 answers
1.9K+ views
Hey,

Here is what I got:

<asp:RadGrid id="r1" runat="server"..>
  <MasterTableView ..>
    <Columns>
      <tel:GridTemplateColumn ..>
         <asp:Label id="l1" runat="server" Text='<%# Eval("Name") %>' />
       </tel:GridTemplateColumn>
      <tel:GridTemplateColumn ..>
         <asp:Label id="l2" runat="server" Text='<%# Eval("Address") %>' />
       </tel:GridTemplateColumn>
    </Columns>
  </MasterTableView>
</asp:RadGrid>

JS Scripts for binding.

//Loading script - this works in that it binds the objects

var

 

radGrid = $find("<%= rg.ClientID %>");

 

 

var view = radGrid.get_masterTableView();

 

view.set_dataSource(results);

view.dataBind();

I tapped into RowDataBound client event so that I may be able to bind it, but I don't know how I can bind to the label in the template.  The issue is, on the server side, I bind an empty array on load server side, so that the mastertableview gets created:

rg.DataSource = new object[] { };
rg.DataBind();

BUt, the no records template appears, and not my template, so I don't know how to bind to the labels....

Any advice would help.

Thanks.

Pavlina
Telerik team
 answered on 06 Jun 2013
5 answers
657 views
Hello,

I have a GridDateTimeColumn in a radgrid that displays the date in yyyyMMdd format. In my SQL Server db the format is in yyyy-mm-dd. 
This is my current aspx on that column:

<telerik:GridDateTimeColumn DataField="DateCode" DataType="System.DateTime" ItemStyle-HorizontalAlign="center" ItemStyle-Wrap="true" DataFormatString="{0:yyyyMMdd}" FilterControlWidth="70%" AllowSorting="true"  AutoPostBackOnFilter="true" HeaderText="DateCode" SortExpression="DateCode"  UniqueName="DateCode"  FilterListOptions="AllowAllFilters" PickerType="None" AllowFiltering="true" FilterDateFormat="yyyyMMdd">
 </telerik:GridDateTimeColumn>

This one is commented out, but I tried this as well:
<%--    <telerik:GridBoundColumn DataField="DateCode" DataType="System.Datetime" ItemStyle-HorizontalAlign="center" ItemStyle-Wrap="true" DataFormatString="{0:yyyyMMdd}"  FilterControlWidth="70%" AllowSorting="true"  AutoPostBackOnFilter="true" HeaderText="DateCode" SortExpression="DateCode" AllowFiltering="true"  UniqueName="DateCode">
             </telerik:GridBoundColumn>--%>

And when I try to filter the column, the filter control gets highlighted in red and a warning sign appear inside of it, but does not have any message. Do you know what is going on? Is it because the format is different from how it is in SQL db? If so, what else do I need to add/change/remove for it to work?

Attached is an image of what I get when I use the filter control.
Vasil
Telerik team
 answered on 06 Jun 2013
4 answers
50 views
Hi,

when a Grid is configured with the AllowKeyboardNavigationSettings="true", AllowMultiRowSelection="true" and AllowScroll="true" the Select All button of the GridClientSelectColumn behaves oddly in Internet Explorer. It seems that each row is checked/unchecked individually and the grid is scrolled to show the row that is being checked.

I made a screencast of the odd behavior: http://screencast.com/t/GkyzR8ACa

To reproduce configure a Grid with the above mentioned settings, klick inside the grid and use the arrow keys to navigate between rows, then click on the Select All Button in the Grid Header.

The problem probably exists in other browsers as well. In Chrome the grid ends up being scrolled all the way to the bottom after Selecting/Deselecting All, but the effect is less visible probably because Chrome's Javascript performance is better.


Constantin
Top achievements
Rank 1
 answered on 06 Jun 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?