Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
136 views
 Hi
The Editor Lite breaks our Page Layout in Edit Mode (while in Display Mode it fits fine into the width of the surrounding div).
We tried suggested Javascript solution for resizing the Web Parts in Edit Mode and it seems to work fine with Firefox, but not with IE7 and IE8.

On the Pagelayout I added the following:

<asp:Content ContentPlaceholderID="PlaceHolderAdditionalPageHead" runat="server" >
<script type="text/javascript"> 
                function OnClientLoadResize(editor) 
                { 
                  //set the width and height of the RadEditor 
                  editor.SetSize("200","200"); 
                } 
                </script>
</asp:Content>

The script is called and it seems as if the settings get respected for a second, but then the default size is applied to the  editor.
Any hints?

Thanks
Tatjana

Stanimir
Telerik team
 answered on 19 May 2010
1 answer
109 views
I have code that loops through the grid's items and disables certain ones.
However, I also have ClientSettings-Selecting-AllowRowSelect set to true, so that I can use a Select All Header.

Problem is that when you click on a disabled row (item) it also selects. There a way to prevent this? 


Tsvetoslav
Telerik team
 answered on 19 May 2010
1 answer
81 views
Hi all,

I'm using the moss version of the rad editor in a site and I want to extend the replaces made when you paste text from Word. It now shows a popup asking the user if they want to clean the formatting, but I also want to remove the font tags and style attributes. I've seen posts using the OnClientPasteHtml event, but I don't believe it's included in this version??

Is there anybody who might know a workaround?

Thanks,

Peter
Stanimir
Telerik team
 answered on 19 May 2010
1 answer
136 views
Hi,

I have a rad grid placed in a div  so that it sits on the left hand side of the page.  The grid displays a list of activities with some corresponding basic information about each activity.  The user has control over the number of items displayed in the list, but the page needs to remain a set size.  To overcome that problem I have fixed the size of the grid but switched on the allow scrolling property, paging and fixed the headers.

However, if the item count is set to anything greater than 20 when the user moves their cursor over the grid it dissappears off down the page a few hundred pixels below the footer.  The headers remain in place, but the grid (or at least the 600px of it that are on display) move down below the footer, with the paging etc controls below that.  The distance moved looks like it changes based on the number of items to display in the grid.  If the no of items is set to 20, there are still scroll bars visible, but the grid remains in place as it should.

Does anyone have any ideas why the grid appears to 'jump' down the form on mouse-over if the item count within the grid exceeds 20?

Thanks

Peter



Dimo
Telerik team
 answered on 19 May 2010
2 answers
53 views

But I can see the other thread. Please, help me!

Daniel Cuba
Top achievements
Rank 1
 answered on 19 May 2010
5 answers
205 views
Hi,

I have a nested RadSplittter. The fist Splitter "Main splitter" is divided into two parts horizontally for title bar and  content pane.
   The content pane has RadSplitter2   
    RadSplitter2 is divided vertically for navigation pane on left and  some other stuffs on right.
          The right pane of RadSplitter2  has
           RadSplitter3  which  is divided horizontally  into panes to display map on top and datagrid at bottom.

I am having issue with my RadSplitBar  "MapRadSplitBar" on  RadSplitter3. It hides when I click the collapse button.
The strange thing is it reappears when I re size the button.

I believe  I need to fix something  in RadSplitter3 but I do not know what. I have an update panel outside RadSplitter3, to show updates in DataGrid pane on button click event .
Given below is my markup:

   <telerik:RadSplitter ID="MainSplitter" runat="server" Height="100%" Width="100%"  Orientation="Horizontal" Skin="Vista"  LiveResize="true"  VisibleDuringInit="false" ResizeWithBrowserWindow="true"   >
            <telerik:RadPane ID="TitleBarPane" runat="server"  Locked="true"  Height="94px"  CssClass="TitleBarPane"  >
                <div id="TitleBar" >
                    <img id="logoImage" src="theme/default/Logo.JPG"  alt="Company Logo" />
                    <img id="logoStretch"  src="theme/default/LogoStretch.JPG"   alt="Fill Image" />
               </div>
            </telerik:RadPane>
            <telerik:RadSplitBar ID="TitleRadSplitBar" runat="server"  Height="100%" Width="100%"  />
            <telerik:RadPane ID="ContentPane" runat="server" Scrolling="None"  >
                <telerik:RadSplitter ID="ContentRadSplitter" runat="server" Skin="Vista" >
                    <telerik:RadPane ID="LeftRadPane" runat="server"  Width="230"  BackColor="White"  Scrolling="None">
                       <asp:UpdatePanel ID="updTest" runat="server" UpdateMode="Conditional" ><ContentTemplate>
                       <ucNav:NavBox ID="navLeft" runat="server" />
                        <ucMsg:uscMsgBox ID="uscMgBox3" runat="server" />
                        <asp:Label ID="label3"  Text="XYZ"  runat="server" style="position:absolute; color:Red; left:20px;  bottom:50px; z-index:100;" />
                       </ContentTemplate></asp:UpdatePanel>
                    </telerik:RadPane>
                    <telerik:RadSplitBar ID="NavRadSplitBar" runat="server" CollapseMode="Forward"  />
                    <telerik:RadPane ID="MapRadPane" runat="server"  Scrolling="None" >
                       <asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="always" ><ContentTemplate>
                         <telerik:RadSplitter ID="MapDivSplitter" runat="server" Orientation="Horizontal" Skin="Vista"  LiveResize="true"  VisibleDuringInit="false"  >
                            <telerik:RadPane ID="MapPane" runat="server" Scrolling="None" >
                                        <ucMap:Map ID="Map" runat="server"  />
                            </telerik:RadPane>
                            <telerik:RadSplitBar ID="MapRadSplitBar" runat="server"  CollapseMode="Both""      />
                            <telerik:RadPane ID="DataGridPane" runat="server"  Height="130" Scrolling="Both" Collapsed="true" >
                            </telerik:RadPane>
                        </telerik:RadSplitter>
                       </ContentTemplate></asp:UpdatePanel>
                    </telerik:RadPane>
                </telerik:RadSplitter>
            </telerik:RadPane>
         </telerik:RadSplitter>           


Any suggestion  is appreciated.
Thanks
Prava               
   
Svetlina Anati
Telerik team
 answered on 19 May 2010
5 answers
229 views
Hello I m Using Tooltipmanger
onLoad i m calling other user control
on that usercontrol i used a RadDock and inside Raddock i m using GRID.
Problem is tooltip is not able update.

ToolTipPage
  <asp:UpdatePanel ID="upPanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
            <telerik:RadToolTipManager runat="server"   
            HideEvent="LeaveToolTip" ID="RadToolTipManager1" Width="100px"
    Height="100px" RelativeTo="Element"
            Animation="Slide" Position="BottomRight" OnAjaxUpdate="OnAjaxUpdate"
    Skin="Telerik" BorderStyle="None">           
            
            </telerik:RadToolTipManager>
               </ContentTemplate>
</asp:UpdatePanel>

ToolTipPageOn Code:-
 protected void OnAjaxUpdate(object sender, ToolTipUpdateEventArgs args)
        {
            

                this.UpdateToolTip(args.Value, args.UpdatePanel);
        }


 private void UpdateToolTip(string elementID, UpdatePanel panel)
        {
         
            if (elementID.ToString() == "Information")
            {
               
                Control ctrl = Page.LoadControl("UserControls/statusTooltip.ascx");
                panel.ContentTemplateContainer.Controls.Add(ctrl);
                statusTooltip details = (statusTooltip)ctrl;
                details.ID = elementID;
               

            }
            else if (elementID.ToString() == "Types")
            {
                panel.ContentTemplateContainer.Controls.Clear();



                Control ctrlAttendeeTypesTooltip = Page.LoadControl("UserControls/Types.ascx");
                panel.ContentTemplateContainer .Controls.Add(ctrlAttendeeTypesTooltip);
                Types detailsAttendeeTypesTooltip = (Types)ctrlAttendeeTypesTooltip;
                detailsAttendeeTypesTooltip.ID = elementID;
             
            }
}








UserControl

 <telerik:RadDock ID="RadDock2" Title="Agenda Locations" runat="server" Width="200px" Height="350px" DefaultCommands="None">
            <ContentTemplate>
                                    
                                     <table>
                                     <tr>
                                     <td>
                                     <telerik:RadGrid ID="rgds" runat="server"
                                    AllowMultiRowSelection="True"
                                    OnNeedDataSource="rgds_NeedDataSource" ShowHeader="false"
                                    AutoGenerateColumns="False"
                                              GridLines="None"
                                   PagerStyle-AlwaysVisible="true"   
                                   
                                     AllowFilteringByColumn="false"
                                    >
                                   
                                </telerik:RadGrid>
                                        
                                     
                                     </td>
                                    
                                     </tr>
                                       
                                     </table>
                                         
                                     
                                  </ContentTemplate>
        </telerik:RadDock>

UserControl.cs

 protected void rgds_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
        {

            try
            {
                this.LoadGridrg();
               
                
            }
            catch (Exception ex)
            {
            
            }
        }

Please i try all solution but still notable to update.
Svetlina Anati
Telerik team
 answered on 19 May 2010
1 answer
183 views
Hi,

I have a Jquery scrollable plugin.

In one of the scrollable divs there is a radcombo box.

Obviously I also have the script manager included in the page.

If I take the scriptmanager and combo box out then the divs scroll as they should.

If I add the scriptmanager and combo box then the divs start scrolling on tab key clicks etc.

Has anyone had any experience of this?

Thanks
T. Tsonev
Telerik team
 answered on 19 May 2010
1 answer
85 views
Hello
scrollbars appears in IE8 after expanding slidingpane, any advice how to fix this problem?  
sliding pane problem  
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml"
<head> 
    <title>test</title> 
    <style type="text/css"
        html, body, form 
        { 
            height: 100%; 
            width: 100%; 
            margin: 0; 
            padding: 0; 
        } 
    </style> 
</head> 
<body> 
    <form id="form1" runat="server"
    <asp:ScriptManager ID="ScriptManager1" runat="server" /> 
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="WebBlue"
    </telerik:RadSkinManager> 
    <telerik:RadSplitter runat="server" ID="mainSplitter" Width="100%" Height="100%" 
        Orientation="Horizontal" BorderSize="1"
        <telerik:RadPane runat="server" ID="header" Height="50px"
            header 
        </telerik:RadPane> 
        <telerik:RadPane runat="server" ID="body" Scrolling="None"
            <telerik:RadSplitter ID="rsSplitter" runat="server" Width="100%" Height="100%" VisibleDuringInit="false"
                <telerik:RadPane ID="menuPane" runat="server" Width="22px" Height="100%" Scrolling="None" 
                    BackColor="#CC3300"
                    <telerik:RadSlidingZone ID="SlidingZone" runat="server" Width="22px" Height="100%" 
                        ClickToOpen="True"
                        <telerik:RadSlidingPane ID="Menu" Title="Menu" runat="server" Width="220px" MaxWidth="220" 
                            Scrolling="Y"
                            <telerik:RadTreeView ID="TreeView_MainMenu" runat="server" ShowLineImages="false"
                            </telerik:RadTreeView> 
                        </telerik:RadSlidingPane>                                          
                    </telerik:RadSlidingZone> 
                </telerik:RadPane> 
                <telerik:RadPane ID="contentPane" runat="server" Height="100%"
                    <asp:ContentPlaceHolder ID="contentMain" runat="server"
                    </asp:ContentPlaceHolder> 
                </telerik:RadPane> 
            </telerik:RadSplitter> 
        </telerik:RadPane> 
    </telerik:RadSplitter> 
    </form> 
</body> 
</html> 
Thanks

 

Svetlina Anati
Telerik team
 answered on 19 May 2010
5 answers
165 views
Hi all,
i use the TreeView Control with templates and node expand mode ServerSide.
The problem now is that after a postback the treenodes are not the same as before added ???

For example i've got the following structure with one parent and three childs:
Main
-Val1
-Val2
-Val3
After postback i got: Main
-Val1
-Val1
-Val2
The node Val 1 is duplicated and Val 3 is missing.

Here is a sample:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="TreeLoadOnDemand.aspx.cs" Inherits="TreeLoadOnDemand" %> 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"
<head id="Head1" runat="server"
    <title></title
    <style type="text/css"
        table.stats 
        { 
            border-collapse:collapse; 
            background:#EFF4FB url(teaser.gif) repeat-x; 
            border-left:1px solid #686868; 
            border-right:1px solid #686868; 
            font:1em/145% 'Trebuchet MS',helvetica,arial,verdana; 
            color: black;            
        } 
         
       .textbox 
        { 
            font-family: Verdana, Arial, Helvetica, sans-serif; 
            font-style:normal; 
            text-align: right; 
        }                 
    </style>   
</head> 
<body> 
    <form id="form1" runat="server"
   <telerik:RadScriptManager ID="uxRadScriptManager" runat="server"></telerik:RadScriptManager>  
           <telerik:RadTreeView ID="uxRadTreeView" runat="server" OnNodeExpand="uxRadTreeView_NodeExpand" >   
         </telerik:RadTreeView>    
 
         <telerik:RadTreeView ID="uxRadTreeViewTest" runat="server" OnNodeExpand="uxRadTreeViewTest_NodeExpand" >   
         </telerik:RadTreeView>    
          
         <script type="text/javascript"
             var changedData = new Array(); 
 
             function CheckIfNumber(sender, args) { 
                 try { 
                     var el = args
                 } catch (e) { 
                     alert(e); 
                 } 
             } 
 
             function ValueChanged(sender, e) { 
                 try { 
 
                     var chngedItem = new Object(); 
                     chngedItem.oldValue = e.get_oldValue(); 
                     chngedItem.newValue = e.get_newValue(); 
                     chngedItem.id = sender.get_id(); 
 
                     changedData.push(chngedItem); 
 
                     var div = document.getElementById("div1"); 
                     div.innerHTML = 
                        "Key= " + sender.get_id() + "; OldValue=" + e.get_oldValue() + "NewValue=" + e.get_newValue() + ";"; 
                     e.set_cancel(true); 
                 } catch (e) { 
                     alert(e); 
                 } 
             } 
 
             function ButtonClick(sender, e) { 
                 var radTextBox = sender
                 radTextBox.raisePostBackEvent(); 
             } 
 
             function ShowChangedValues() { 
                 try { 
                     var txt = ''
                     debugger; 
                     for (var i = 0; i < changedData.length; i++) { 
                         txttxt = txt + 'ID: ' + changedData[i].id + '; Old: ' + changedData[i].oldValue + '; New: ' + changedData[i].newValue + '<br />'; 
                     } 
 
                     var div = document.getElementById("div1"); 
                     div.innerHTML = txt
                 } catch (e) { 
                     alert(e); 
                 } 
             } 
        </script>      
</form> 
</body> 
</html> 
 

Code Behind:
using System; 
using System.Diagnostics; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using Telerik.Web.UI; 
 
public partial class TreeLoadOnDemand : System.Web.UI.Page 
   protected void Page_Load(object sender, EventArgs e) 
    { 
        try { 
            if (!IsPostBack) { 
                Session.Clear(); 
                GenerateTreeView(); 
 
                RadTreeNode nd = new RadTreeNode("Main", "Main"); 
 
                for (int i = 0; i < 4; i++) { 
                    RadTreeNode ndChild = new RadTreeNode("Child " + i.ToString(), "Child " + i.ToString()); 
                    ndChild.ExpandMode = TreeNodeExpandMode.ServerSide; 
 
                    nd.Nodes.Add(ndChild); 
                } 
                nd.Expanded = true
                uxRadTreeViewTest.Nodes.Add(nd); 
            } else { 
                foreach (RadTreeNode node in uxRadTreeView.GetAllNodes()) { 
                    Debug.WriteLine(string.Format("Node Key:{0} Text:{1}", node.Value, node.Text)); 
 
                    BudgetNode nd = (BudgetNode)Session[node.Value]; 
 
                    if (nd != null) { 
                        MyNodeTemplate Temp = new MyNodeTemplate(); 
 
                        Temp.text = nd.Text; 
                        Temp.key = nd.Key; 
                        Temp.val1 = nd.Val1; 
                        Temp.level = nd.Level; 
                        Temp.editableVal1 = nd.IsEditable; 
 
                        Temp.val2 = nd.Val5; 
                        Temp.val3 = nd.Val6; 
                        Temp.val4 = nd.Val3; 
                        Temp.val5 = nd.Val4; 
                        Temp.val6 = nd.Val2; 
 
                        node.NodeTemplate = Temp; 
                         
                        Temp.InstantiateIn(node); 
                    } 
                } 
            } 
        } catch (Exception ex) { 
            string _err = ex.ToString(); 
        } 
    } 
 
    protected void uxRadTreeView_NodeExpand(object sender, RadTreeNodeEventArgs e) { 
        if(e.Node.Nodes.Count == 0) 
            CreateChilds(e.Node); 
    } 
 
    protected void uxRadTreeViewTest_NodeExpand(object sender, RadTreeNodeEventArgs e) { 
        if (e.Node.Nodes.Count == 0) { 
            for (int i = 0; i < 2; i++) { 
                RadTreeNode child = new RadTreeNode(e.Node.Text + " - Child " + i.ToString(), e.Node.Value + " - Child " + i.ToString()); 
                child.ExpandMode = TreeNodeExpandMode.ServerSide; 
 
                e.Node.Nodes.Add(child); 
            } 
        } 
    } 
 
    void GenerateTreeView() { 
        uxRadTreeView.Nodes.Clear(); 
        RadTreeNode main = new RadTreeNode(); 
        main.Value = "Main"
        main.Text = "Main"
 
        BudgetNode ndMain = new BudgetNode("Main", "Main", 0, 0,0,0,0,0,0,false); 
         
        MyNodeTemplate mainTemp = new MyNodeTemplate(); 
        mainTemp.text = ndMain.Text; 
        mainTemp.key = ndMain.Key; 
        mainTemp.val1 = ndMain.Val1; 
        mainTemp.level = ndMain.Level; 
        mainTemp.editableVal1 = ndMain.IsEditable; 
        mainTemp.val5 = ndMain.Val5; 
        mainTemp.val6 = ndMain.Val6; 
        mainTemp.val3 = ndMain.Val3; 
        mainTemp.val4 = ndMain.Val4; 
        mainTemp.val2 = ndMain.Val2; 
 
        Session[ndMain.Key] = ndMain; 
        main.NodeTemplate = mainTemp
 
        main.Expanded = true
 
        for (int i = 0; i < 4; i++) { 
            BudgetNode ndChild = new BudgetNode("Nd " + i.ToString(), "Main|Nd " + i.ToString(), 1, 100,55,12,14,4,58,true);            
 
            RadTreeNode sampleRadTreeNode = new RadTreeNode(); 
            sampleRadTreeNode.Value = "Main|Nd " + i.ToString(); 
            sampleRadTreeNode.Text = "Nd " + i.ToString(); 
 
            MyNodeTemplate item = new MyNodeTemplate(); 
 
            item.text = ndChild.Text; 
            item.key = ndChild.Key; 
            item.val1 = ndChild.Val1; 
            item.level = ndChild.Level; 
            item.editableVal1 = ndChild.IsEditable; 
 
            item.val5 = ndChild.Val5; 
            item.val6 = ndChild.Val6; 
            item.val3 = ndChild.Val3; 
            item.val4 = ndChild.Val4; 
            item.val2 = ndChild.Val2; 
 
            Session[ndChild.Key] = ndChild; 
            sampleRadTreeNode.NodeTemplate = item
            sampleRadTreeNode.ExpandMode = TreeNodeExpandMode.ServerSide; 
 
            main.Nodes.Add(sampleRadTreeNode); 
        } 
 
        uxRadTreeView.Nodes.Add(main); 
    } 
 
    void CreateChilds(RadTreeNode parent) { 
        try { 
            int childs = 2
 
            int level = ((MyNodeTemplate)parent.NodeTemplate).level + 1; 
 
            Console.WriteLine("Create {0} childs level {1}.", childs, level); 
            for (int i = 0; i < childs; i++) { 
                BudgetNode ndChild = new BudgetNode(parent.Value + " - Nd " + i.ToString(), parent.Value + "|Nd " + i.ToString(), level, 695, 45, 85, 898, 36, 4, true);                 
 
                RadTreeNode nd = new RadTreeNode(); 
                nd.Value = ndChild.Key; 
                nd.Text = ndChild.Text; 
 
                MyNodeTemplate item = new MyNodeTemplate(); 
 
                item.text = ndChild.Text; 
                item.key = ndChild.Key; 
                item.val1 = ndChild.Val1; 
                item.level = ndChild.Level; 
                item.editableVal1 = ndChild.IsEditable; 
 
                item.val5 = ndChild.Val5; 
                item.val6 = ndChild.Val6; 
                item.val3 = ndChild.Val3; 
                item.val4 = ndChild.Val4; 
                item.val2 = ndChild.Val2; 
 
                nd.NodeTemplate = item
 
                Session[ndChild.Key] = ndChild; 
                nd.ExpandMode = TreeNodeExpandMode.ServerSide; 
 
                parent.Nodes.Add(nd); 
            } 
        } catch (Exception ex) { 
            Console.WriteLine(ex.ToString()); 
        } 
    }         
 
 
class BudgetNode { 
    private string text; 
    private string key; 
    private int level; 
 
    private decimal val1; 
    private decimal val2; 
    private decimal val3; 
    private decimal val4; 
    private decimal val5; 
    private decimal val6; 
    private bool editableVal1 = false
 
    public string Text { 
        get { return text; } 
        set { text = value; } 
    } 
 
    public string Key { 
        get { return key; } 
        set { key = value; } 
    } 
 
    public int Level { 
        get { return level; } 
        set { level = value; } 
    } 
 
    public decimal Val6 { 
        get { return val6; } 
        set { val6 = value; } 
    } 
 
    public bool IsEditable { 
        get { return editableVal1; } 
        set { editableVal1 = value; } 
    } 
 
    public decimal Val5 { 
        get { return val5; } 
        set { val5 = value; } 
    } 
 
    public decimal Val4 { 
        get { return val4; } 
        set { val4 = value; } 
    } 
 
    public decimal Val3 { 
        get { return val3; } 
        set { val3 = value; } 
    } 
 
    public decimal Val2 { 
        get { return val2; } 
        set { val2 = value; } 
    } 
 
    public decimal Val1 { 
        get { return val1; } 
        set { val1 = value; } 
    } 
 
    public BudgetNode() {  
    } 
 
    public BudgetNode(string Txt, string Ky, int Lev, decimal val1, decimal val2, decimal val3, decimal val4, decimal val5, decimal val6, bool Val1IsEditable) { 
        this.text = Txt
        this.key = Ky
        this.level = Lev
        this.val1 = val1; 
        this.val6 = val2
        this.val5 = val3
        this.val4 = val4; 
        this.val3 = val5
        this.val2 = val6
        this.editableVal1 = Val1IsEditable
    } 
 
class MyNodeTemplate : ITemplate { 
    public RadTextBox radTxt; 
    public RadTextBox radTxtVal1; 
 
    public string text; 
    public string key; 
    public int level; 
 
    public decimal val1; 
    public decimal val2; 
    public decimal val3; 
    public decimal val4; 
    public decimal val5; 
    public decimal val6; 
    public int size = 200
    public int cellWidth = 80
    public bool editableVal1 = false
 
    public MyNodeTemplate() { 
        this.radTxt = new RadTextBox(); 
        this.radTxtVal1 = new RadTextBox(); 
    } 
 
    public MyNodeTemplate(string text, string key, int level, decimal val1, decimal val2, decimal val3, decimal val4, decimal val5, decimal val6) { 
        this.text = text; 
        this.key = key; 
        this.level = level; 
        this.val1 = val1; 
        this.val2 = val2; 
        this.val3 = val3; 
        this.val4 = val4; 
        this.val5 = val5; 
        this.val6 = val6; 
 
        this.radTxt = new RadTextBox(); 
        this.radTxtVal1 = new RadTextBox(); 
    } 
 
    public MyNodeTemplate(string text, string key, int level, decimal val1, decimal val2, decimal val3, decimal val4, decimal val5, decimal val6, bool EditablePlan) { 
        this.editableVal1 = EditablePlan
        this.text = text; 
        this.key = key; 
        this.level = level; 
        this.val1 = val1; 
        this.val2 = val2; 
        this.val3 = val3; 
        this.val4 = val4; 
        this.val5 = val5; 
        this.val6 = val6; 
 
        this.radTxt = new RadTextBox(); 
        this.radTxtVal1 = new RadTextBox(); 
    } 
 
    public void InstantiateIn(Control container) { 
        try { 
            if (this.key != "") {                         
                int coeff = 20
                Random r = new Random(6); 
 
                Table table = new Table(); 
                table.CssClass = "stats"
                table.CellPadding = 0
                table.CellSpacing = 0
 
                TableRow tableRow = new TableRow(); 
                tableRow.ID = "rw" + key; 
 
                // Tree Item 
                Label lblTitle = new Label(); 
                lblTitle.Text = text
                lblTitle.ID = "lblTitle" + key; 
 
                TableCell tableTextCell = new TableCell(); 
                tableTextCell.Width = size - coeff * level; 
 
                tableTextCell.Controls.Add(lblTitle); 
 
                tableRow.Cells.Add(tableTextCell); 
 
                if (level > 0) { 
                    tableRow.Cells.Add(GetEditTextBoxTableCell("txtPlan" + this.key, r.Next().ToString() + " â‚¬", "Val 1")); 
                    tableRow.Cells.Add(GetTextBoxTableCell("txt2" + this.key, r.NextDouble().ToString() + " â‚¬", "Val 2", false)); 
                    tableRow.Cells.Add(GetTextBoxTableCell("txt3" + this.key, r.Next().ToString() + " â‚¬", "Val 3", false)); 
                    tableRow.Cells.Add(GetTextBoxTableCell("txt4" + this.key, r.NextDouble().ToString() + " â‚¬", "Val 4", false)); 
                    tableRow.Cells.Add(GetTextBoxTableCell("txt5" + this.key, r.Next().ToString() + " â‚¬", "Val 5", false)); 
                    tableRow.Cells.Add(GetTextBoxTableCell("txt6" + this.key, r.NextDouble().ToString() + " â‚¬", "Val 6", false));                  
                } else { 
                    tableRow.Cells.Add(GetLabelTableCell("ItemLabel1" + this.key, "Val 1")); 
                    tableRow.Cells.Add(GetLabelTableCell("ItemLabel2" + this.key, "Val 2")); 
                    tableRow.Cells.Add(GetLabelTableCell("ItemLabel3" + this.key, "Val 3")); 
                    tableRow.Cells.Add(GetLabelTableCell("ItemLabel4" + this.key, "Val 4")); 
                    tableRow.Cells.Add(GetLabelTableCell("ItemLabel5" + this.key, "Val 5")); 
                    tableRow.Cells.Add(GetLabelTableCell("ItemLabel6" + this.key, "Val 6")); 
 
                    tableRow.CssClass = "hed"
                } 
 
                table.Rows.Add(tableRow); 
                container.Controls.Add(table); 
            } else { 
                Console.WriteLine("Empty Key."); 
            } 
        } catch (Exception ex) { 
            Console.WriteLine(ex.ToString()); 
        } 
    } 
 
    TableCell GetTextBoxTableCell(string id, string text, string tooltip, bool Editable) { 
        TableCell txt = new TableCell(); 
        txt.Width = cellWidth
 
        if (!Editable) { 
            TextBox txt_ = new TextBox(); 
            txt_.ID = id
            txt_.Text = text
            txt_.ToolTip = tooltip
            txt_.Enabled = Editable
            txt_.Width = cellWidth - 5; 
            txt_.CssClass = "textbox"
 
            txt.Controls.Add(txt_); 
        } else { 
            radTxtVal1.ID = id
            radTxtVal1.Text = text
            radTxtVal1.Width = cellWidth - 5; 
            radTxtVal1.InvalidStyleDuration = 100
            radTxtVal1.ClientEvents.OnButtonClick = "ButtonClick"
            radTxtVal1.ClientEvents.OnValueChanged = "ValueChanged"
            radTxtVal1.ClientEvents.OnValueChanging = "CheckIfNumber"
            radTxtVal1.CssClass = "textbox"
 
            txt.Controls.Add(radTxtVal1); 
        } 
 
        return txt; 
    } 
 
    TableCell GetEditTextBoxTableCell(string id, string text, string tooltip) { 
        TableCell txt = new TableCell(); 
        txt.Width = cellWidth
 
        radTxt.ID = id
        radTxt.Text = text
        radTxt.Width = cellWidth - 5; 
        radTxt.InvalidStyleDuration = 100
        radTxt.ClientEvents.OnButtonClick = "ButtonClick"
        radTxt.ClientEvents.OnValueChanged = "ValueChanged"
        radTxt.ClientEvents.OnValueChanging = "CheckIfNumber"
        radTxt.CssClass = "textbox"
 
        txt.Controls.Add(radTxt); 
 
        return txt; 
    } 
 
    TableCell GetLabelTableCell(string id, string text) { 
        TableCell lblCell = new TableCell(); 
        lblCell.Width = cellWidth
        Label _text = new Label(); 
        _text.ID = id
        _text.Text = "<div align='Center'>" + text + "</div>"; 
        _text.CssClass = "label"
        lblCell.Controls.Add(_text); 
 
        return lblCell; 
    } 
 

Any ideas ?







Nikolay Tsenkov
Telerik team
 answered on 19 May 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?