Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
95 views
private void LoadRootNodes(RadTreeView treeView)
    {
        const string sql = "Select Name, ItemID from TNodes where ParentID IS NULL ";
        SqlConnection dbCon = new SqlConnection("Data Source=localhost;Initial Catalog=Telerik;user id=sa; password=knowdev");
        SqlDataAdapter adapter = new SqlDataAdapter(sql, dbCon);
        DataTable dataTable = new DataTable();
        adapter.Fill(dataTable);
        RadTreeNode node = new RadTreeNode();
  
  
  
          
        foreach (DataRow row in dataTable.Rows)
        {
            //RadTreeViewContextMenu contextmenu1 = new RadTreeViewContextMenu();
            //contextmenu1.ID = row["Name"].ToString();
  
            //RadTreeView2.ContextMenus.Add(contextmenu1);
  
            //contextmenu1.Items.Add(new RadMenuItem(row["Name"].ToString()));
  
  
            node.Text = row["Name"].ToString();
  
            node.Value = row["ItemID"].ToString();
  
            node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
            RadTreeView2.Nodes.Add(node);
            
  
        }
  
        foreach (RadTreeNode nd in RadTreeView2.GetAllNodes())
        {
  
            RadTreeViewContextMenu contextmenu2 = new RadTreeViewContextMenu();
            contextmenu2.ID = nd.Text;
  
            RadTreeView2.ContextMenus.Add(contextmenu2);
            nd.ContextMenuID = contextmenu2.ID;
  
            contextmenu2.Items.Add(new RadMenuItem(nd.Text));
  
  
        }
}
  
  
  
//ON Expand
  
 protected void RadTreeView2_NodeExpand(object sender, RadTreeNodeEventArgs e)
    {
  
        const string sql =
           @"
               SELECT TNodes.ItemID AS NodeId, TNodes.Name AS NodeText, COUNT(Children.ItemID) AS ChildCount
               FROM TNodes LEFT JOIN TNodes As Children
               ON TNodes.ItemID = Children.ParentId
               WHERE TNodes.ParentId = @parentId
               GROUP BY TNodes.ItemID, TNodes.Name
           ";
        SqlConnection dbCon = new SqlConnection("Data Source=localhost;Initial Catalog=Telerik;user id=sa; password=knowdev");
        SqlDataAdapter adapter = new SqlDataAdapter(sql, dbCon);
        adapter.SelectCommand.Parameters.AddWithValue("parentId", e.Node.Value);
        DataTable dataTable = new DataTable();
        adapter.Fill(dataTable);
       
        foreach (DataRow row in dataTable.Rows)
        {
            RadTreeNode node = new RadTreeNode();
            node.Text = row["NodeText"].ToString();
            node.Value = row["NodeId"].ToString();
            
          
            if (Convert.ToInt32(row["ChildCount"]) > 0)
            {
                node.ExpandMode = TreeNodeExpandMode.ServerSideCallBack;
            }
  
  
            if (!(e.Node.TreeView.ContextMenus[0].ID == "test"))
            {
                e.Node.TreeView.ContextMenus[0].Items[0].Text = "test";
                e.Node.TreeView.ContextMenus[0].Items[0].Value = "1";
  
            }
               
  
            e.Node.Nodes.Add(node);
            
              
        }
        e.Node.Expanded = true;
        //e.Node.ExpandMode = TreeNodeExpandMode.ClientSide;
        foreach (RadTreeNode nd in e.Node.GetAllNodes())
        {
            RadTreeViewContextMenu contextmenu = new RadTreeViewContextMenu();
            contextmenu.ID = nd.Text;
  
            RadTreeView2.ContextMenus.Add(contextmenu);
            nd.ContextMenuID = contextmenu.ID;
  
            contextmenu.Items.Add(new RadMenuItem(nd.Text));
  
        }
        
  
    }


Hi,

I am using RadTreeview context menu items. Issue is that after node expand context menu does not show. In above mentioned code on page load

 

 

if(!IsPostBack)

 

LoadRootNodes(RadTreeView2);
LoadRootNodes() functioned is called at that time context menu show properly. but when I expand the node it does not show.
Code is mentioned above. Please suggest.

Thanks,

Dimitar Terziev
Telerik team
 answered on 06 Dec 2010
1 answer
92 views

Guys,

I’m experimenting with rotator control, new CoverFlow functionality to be exact. I like it but there is one thing that I cannot figure out how to do. Basically I’m trying to make images progressively smaller. So selected images is the biggest, then the image on the right and on the left a bit smaller, then images behind those are smaller….  Is possible to something like this? I see that you have a transformation minScale but it’s static and only applied to a first level. I guess I’m asking if its possible to do the same thing that you do with carousel (making images progressively smaller) with CoverFlow

Thank you

Orest

Tsvetie
Telerik team
 answered on 06 Dec 2010
1 answer
1.0K+ views
At the moment, we reference Telerik.Web.UI.dll by browsing to the appropriate folder and adding the dll, so in the "Path" property of the Telerik.Web.UI reference Properties in VS we get something like:

C:\Program Files\Telerik\RadControls for ASP.NET AJAX Q3 
2010\Bin40\Telerik.Web.UI.dll

Now, we are using Team Foundation Server 2010 and it goes off and looks for Telerik.Web.UI but TFS is installed on 64-bit so the installation folder the dll will end up in is:

C:\Program Files (x86)\Telerik\RadControls for ASP.NET AJAX Q3 
2010\Bin40\Telerik.Web.UI.dll

Clearly, that's not going to work! My question is, what is the best practice method of referencing the many controls Telerik offer? If the answer can be in the scope of automated builds on TFS 2010, that would be really awesome but I'm interested regardless on what you do.

(Note: I've read that many developers create a folder in their solution and add / reference the DLLs from there. I reckon that would work but something about it doesn't gel with me. Not sure why, maybe lots of solutions having lots of copies of the DLLs).

Best,
Richard
Mira
Telerik team
 answered on 06 Dec 2010
1 answer
97 views

I have a website project and want to put a hyperlink on the web page. To do this, I created a custom namespace in Default.aspx.cs. I got errors when building the solution. Is

the namespace code in the wrong place ? or do I need to create an assembly for it to fix the errors ? What am I missing ?
Here is the namespace, other details and errors:

In Default.aspx page I put 
<%@ Register TagPrefix="study1wc" Namespace="study1.webcontrols" %>
<study1wc:popupWindow NavigateUrl="http://www.google.com" runat="server" ID="test">testing</study1wc:popupWindow>




In Default.aspx.cs page I put
namespace
study1.webcontrols { public class popupWindow : HyperLink {etc... }

 

protected override void Render(HtmlTextWriter writer)

 

{

 

HyperLink link = this;

 

writer.Write(

"&lt;a");

 

 

 

if (!string.IsNullOrEmpty(link.NavigateUrl))

 

writer.WriteAttribute(

"href", "#");

 

 

if (!string.IsNullOrEmpty(link.CssClass))

 

writer.WriteAttribute(

"class", link.CssClass);

 

 

if (_intWindowHeight <= 0 || _intWindowWidth <= 0)

 

{writer.WriteAttribute(

"onclick", "window.open('" + link.NavigateUrl + "');return false;");}

 

 

else

 

{writer.WriteAttribute(

"onclick", "window.open('" + link.NavigateUrl + "','"+ _strPopupTitle +"','width="+ _intWindowWidth +",height="+ _intWindowWidth +"');return false;");}

 

 

foreach (string key in link.Attributes.Keys)

 

{writer.WriteAttribute(key, link.Attributes[key]);}

writer.Write(

"&gt;");

 

RenderContents(writer);

 

writer.Write(

"&lt;/a>");

 

 

}

 

protected override void RenderContents(HtmlTextWriter output)

 

{output.Write(Text);}

}

}
[Note: there is a RadGrid and RadComboBoxes defined after the custom namespace]




Errors when I Build Solution:
Default.aspx - Warning  Element 'popupWindow' is not a known element. This can occur if there is a compilation error in the Web site, or the web.config file is missing. 
Default.aspx - Error   Unknown server tag 'study1:popupWindow'. 

Mira
Telerik team
 answered on 06 Dec 2010
1 answer
102 views
Folks,

I am using RAD Control from ASP.Net Ajax Q3 2010 with Vstudio 2008 SP1.

In my project, I am using similar to Window / Using the URL for Server Arguments.

I would like to see depending on the value of Country, the HREF image should show approprite Image file. For example after Grid Databound,  if the the Databound column Country value  = "France" then for that row my Href column image src be = "Images/FranceData.png". if the Databound column Country value  = "Germany" then for that row  my Href column image src be ="Images/GermanyData.png".

Ofcourse in my Images folder both FranceData.png and GermanyData.png  exists. Below is my Gridview declarations.

Thanks

GC_0620

<asp:GridView ID="GridView1" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"
CellPadding="0" GridLines="None" CellSpacing="0" runat="server" CssClass="RadGridLike">
<HeaderStyle CssClass="GridHeader"></HeaderStyle>
<Columns>
<asp:BoundField DataField="CompanyName" HeaderText="Company Name" />
<asp:BoundField DataField="Country" HeaderText="Country" />
  
<asp:TemplateField HeaderText="Details">
<ItemTemplate>
  
<a href="#" onclick="openRadWindow('<%#DataBinder.Eval(Container.DataItem,"CustomerID")%>'); return false;">
<img style="border:0px;vertical-align:middle;" alt="" src="Images/FranceData.png" /></a
  
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
ProviderName="System.Data.SqlClient" SelectCommand="SELECT TOP 10 [CompanyName], [CustomerID], [ContactName], [Country] FROM [Customers]">
</asp:SqlDataSource>
Marin
Telerik team
 answered on 06 Dec 2010
2 answers
113 views
I'm using a RadMenu verticaly and I would like to adjust its width to a specify size, I also would like to adjust the quantity of text lines in each item... the menu is filled dinamically by code??? Wich properties do I have to adjust?
Matias
Top achievements
Rank 1
 answered on 06 Dec 2010
1 answer
56 views
once the chart is plotted and after some changes i want to resize the chart from server side, i have tried the following methods

chart1.Appearance.Dimensions.SetDimentions(x,y)

also tried alot of other techniques

this is my chart tag...
<telerik:RadChart ID="chr_kgs" runat="server" Skin="DeepBlue" Visible="true" ChartImageFormat="Jpeg">
        <PlotArea Appearance-FillStyle-MainColor="#003366" XAxis-Appearance-LabelAppearance-FillStyle-FillSettings-ImageDrawMode="Align" Appearance-FillStyle-FillType="Gradient" Appearance-FillStyle-FillSettings-GradientMode="Vertical" Appearance-FillStyle-FillSettings-HatchStyle="BackwardDiagonal" Appearance-FillStyle-SecondColor="#003366" YAxis2-Appearance-MinorGridLines-Visible="True" YAxis2-Appearance-MinorTick-Visible="False" YAxis-Appearance-MinorGridLines-Visible="False" YAxis-Appearance-MinorGridLines-HideWithAxis="True" YAxis-Appearance-MajorTick-Width="1" XAxis-Appearance-MajorGridLines-HideWithAxis="True" XAxis-Appearance-MajorGridLines-Visible="False" XAxis-Appearance-MinorGridLines-Visible="False" XAxis-Appearance-MajorGridLines-Width="0" XAxis-Appearance-MajorTick-Width="1" XAxis-Appearance-MajorGridLines-Color="#003366" XAxis-Appearance-MajorTick-Color="#003366" XAxis-Appearance-MinorGridLines-Color="#003366" XAxis-Appearance-MinorTick-Color="#003366" YAxis-Appearance-MinorGridLines-Color="#003366">
             
        </PlotArea>
         
        <Appearance BarWidthPercent="10" Dimensions-AutoSize = false ></Appearance>
        </telerik:RadChart>
Yavor
Telerik team
 answered on 06 Dec 2010
1 answer
190 views
Hi

i am using radtoolbar in my page. i want to load a page inside an iframe on toolbar button's click.
here its my code:
  <apex:RadToolBarButton Text="Chat History" runat="server" ImageUrl="images/chat.png"  CommandName="reports"  Enabled="true" ImagePosition="AboveText" NavigateUrl="reports.aspx"  Target="targetFrame">
   </apex:RadToolBarButton>
  <apex:RadToolBarButton Text="Chat History" runat="server" ImageUrl="images/chat.png"  CommandName="reports"  Enabled="true" ImagePosition="AboveText" NavigateUrl="reports.aspx"  Target="targetFrame">
   </apex:RadToolBarButton>
  <apex:RadToolBarButton Text="Chat History" runat="server" ImageUrl="images/chat.png"  CommandName="reports"  Enabled="true" ImagePosition="AboveText" NavigateUrl="reports.aspx"  Target="targetFrame">
   </apex:RadToolBarButton>
<telerik: RadToolBar ID="maintoolbar" runat="server" >
<items>
<telerik:RadToolBarButton Text="chat history" NavigateUrl="reports.aspx"  Target="targetFrame"></telerik:RadToolBarButton>
</items>
</telerik:RadToolBar>

  <iframe  id="targetFrame" runat="server">
it works fine, but i want to pass arguments to the iframe from my main page. how can i do this?

thanks in advance,
geetha.
Princy
Top achievements
Rank 2
 answered on 06 Dec 2010
8 answers
78 views
I am using the RadEditor and allowing the user to switch to full screen. When the user selects the toggle icon it takes a few seconds to switch to full screen. I want to have a progress indicator. How do I do this?

Thanks,


Steve Holdorf
Rumen
Telerik team
 answered on 06 Dec 2010
4 answers
165 views
hi,

i searched the forum but none of them couldnt solve my problem. i am populating the Nodes collection in Page_Init programatically.
when a user select a node and click on a button , the Radtreeview.SelectedNode is null !!!

i tried all the solution but nothing solve it. i am using the Telerik 2010 Q2 for ASP.NET AJAX with visual C# 2008.

how can i solve it?
Dimitar Terziev
Telerik team
 answered on 06 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?