Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
156 views
Hello,
I create a treeview dynamically in an update panel.

<asp:UpdatePanel ID="UpdatePanel2" runat="server" onload="UpdatePanel2_Load">  
    <ContentTemplate> 
        <telerik:RadTreeView ID="rtvLayoutListe" runat="server" AutoPostBack="true" Height="450px"   
            Skin="Office2007" OnClientNodeClicking="ClientClickHandler"    
            oncontextmenuitemclick="rtvLayoutListe_ContextMenuItemClick"             
            OnNodeClick="rtvLayoutListe_NodeClick"   
            onclientcontextmenuitemclicking="ContextMenuClicking"   
            onclientnodeclicked="ClientClickedHandler" 
            onclientnodeeditstart="startEdit"   
            onnodeedit="rtvLayoutListe_NodeEdit"   
            OnClientContextMenuShowing="onClientContextMenuShowing" > 
            <ContextMenus> 
                ...  
            </ContextMenus> 
 
        </telerik:RadTreeView> 
    </ContentTemplate> 
    <Triggers> 
        <asp:AsyncPostBackTrigger ControlID="btnRefresh" /> 
    </Triggers> 
</asp:UpdatePanel> 

protected void Page_Load(object sender, EventArgs e)  
{  
    if (!IsPostBack)  
    {  
        GenerateTreeView();              
    }  

public void GenerateTreeView()  
{  
    rtvLayoutListe.Nodes.Clear();  
    layoutsql lsql = new layoutsql();  
    DataSet ds = lsql.GetLayoutsForManager();  
 
    RadTreeNode rootNode = new RadTreeNode("Layouts", "folder-0");  
    rootNode.ImageUrl = "../../images/folder.png";  
    rootNode.ToolTip = "Layouts - Please select a Layout or Container";  
    rootNode.Expanded = true;  
    rootNode.ContextMenuID = "RootMainContextMenu";  
    rtvLayoutListe.Nodes.Add(rootNode);  
 
    foreach (DataRow folderRow in ds.Tables["LayoutFolder"].Rows)  
    {              
        RadTreeNode folderNode = new RadTreeNode(folderRow["LgName"].ToString(),   
            "folder-" + folderRow["lgid"].ToString());  
        folderNode.ImageUrl = "../../images/folder.png";  
        folderNode.ToolTip = "Folder";  
        folderNode.ContextMenuID = "MainContextMenu";  
        rootNode.Nodes.Add(folderNode);  
        foreach (DataRow layoutRow in folderRow.GetChildRows("FolderLayouts"))  
        {  
            RadTreeNode layoutNode = new RadTreeNode(layoutRow["LName"].ToString(),   
                "layout-" + layoutRow["LID"].ToString());  
            layoutNode.ImageUrl = "../../images/desktop.png";  
            layoutNode.ToolTip = "Layout " + layoutRow["LName"].ToString();  
            layoutNode.ContextMenuID = "LayoutFolderCMenu";  
            folderNode.Nodes.Add(layoutNode);  
            foreach (DataRow containerRow in layoutRow.GetChildRows("LayoutContainers"))  
            {  
                RadTreeNode containerNode = new RadTreeNode(containerRow["CName"].ToString(),  
                    "container-" + containerRow["CID"].ToString());  
                containerNode.ImageUrl = "../../images/gif.png";  
                containerNode.ToolTip = "Layout Container " + containerRow["CName"].ToString();  
                containerNode.ContextMenuID = "EmptyFolderContextMenu";  
                layoutNode.Nodes.Add(containerNode);                      
            }  
        }  
          
    }  
      
 
 
    int anzahl = rtvLayoutListe.Nodes.Count;  =====>>>>>> Always 1  
 
    //if (Session["cnewvalue"] != null)  
    //{  
    //    if (int.Parse(Session["cnewvalue"].ToString()) > 0)  
    //    {  
    //        foreach (RadTreeNode node in rtvLayoutListe.Nodes)  
    //        {  
    //            if (node.Value == tempcontainer)  
    //            {  
    //                node.Selected = true;  
    //                node.Expanded = true;  
    //            }  
    //            else  
    //            {  
    //                node.Selected = false;  
    //            }  
    //        }  
    //    }  
    //}  

I get always 1 here: int anzahl = rtvLayoutListe.Nodes.Count;

Reiner
 answered on 29 Nov 2009
4 answers
140 views
Hi i want show my treeview from select ID like this:

CustomerID     parentafi
1                      NULL
2                      1
3                      2
4                      2
5                      2
6                      5

i want only show from CustomerID = 5
so like this:

CustomerID        parentafi
5                        2
6                        5

how i can do????? Thx!

Juanca
Juan Carlos Carrasco
Top achievements
Rank 1
 answered on 29 Nov 2009
8 answers
530 views
Hi,
My goal is to design such a functionality:
- there is a RadSplitter on the form filling almost 100% of the window
- I don't want to fill exactly 100% using radSplitter.Height = 100% - I want to have some margin outside the RadSplitter and I don't want to set body's margin to 0
- resizing the browser's window should force proper resizing of the RadSplitter
The idea of the solution is:
- RadSplitter.Width = 100%
- RadSplitter.Height is calculated - initially in Page_Load
- window size changes are caught by body.onresize event and sent to the codebehind via Ajax Request where the RadSplitter's height is recalculated
It's not important how the height is calculated; it works and it is not a problem.
I'm not sure if it is the easiest and most effective but it works - as long as we talk about the height.

The problem is that the RadSplitter's width doesn't want to be 100% after Ajax Request: it just remains unchanged; precisely: gets 100% and then - back to the previous width. When Ajax Request is switched off - width behaves as expected: it is 100% all the time.

Well, I've done some other experiment: I've replaced RadSplitter with a pure "div". And this pure div works as expected - tracks al the window size changes perfectly.
So, what can be the problem with the RadSplitter? I can prepare a simple project on demand..

Regards
Tomasz
tmlipinski
Top achievements
Rank 1
 answered on 29 Nov 2009
0 answers
94 views
Ch
I am currently publishing my website & none of my menus are dropping down, its coming up with the following error:-

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.0; Trident/4.0; GTB6.3; .NET CLR 3.5.30729; .NET CLR 3.0.30618; OfficeLiveConnector.1.4; OfficeLivePatch.1.3)
Timestamp: Sun, 29 Nov 2009 15:02:58 UTC

Message: 'childNodes' is null or not an object
Line: 221
Char: 1
Code: 0
URI: ScriptResource.axd?d=JNhyLrLqW0xLaIfAooEFB847ZeDVYQU53nV7V_xFiBSjA1DlaLTQMRGDmaaK8YTJNaraWW2oQrhmxoXEbDP6Lg2&t=8c4884c

 
i am going around and round in circles trying to fix this, any ideas?! my website is www.prsc.com.au

thanks in advance

rach
Top achievements
Rank 1
 asked on 29 Nov 2009
9 answers
139 views
Hi,

I apologise if this has been answered before, I have tried searching and cannot find an answer.

I have a radgrid with an itemtemplate within containing a table with labels etc etc...

I am able to select a row, but only outside the contents within the item template. Ie: where there are no table cells. This means in my scenario that the user can only click on the very edge of each row to select it.

I need users to be able to click anywhere within the row to select it. Any ideas?

Kind Regards

Jason Parsons(UK)
RayC
Top achievements
Rank 1
 answered on 28 Nov 2009
7 answers
239 views
Hi all,
        I have created a publishing site in SharePoint and I have created page layouts for creating content pages. I have used various field controls for adding contents in the pages like HTML Editor, Image Formatter,etc; I replaced the default HTML editor with Rad Editor Lite version for MOSS. Everything worked fine in my system. But some days back I had to migrate my entire web application to a different server. So, I had to carryout the installation of RadEditor Lite Version for MOSS in the new server too. But there arose a strange problem. The bullets which I have used for some contents inside the RadEditor are not appearing at all. But, when I try to edit the contents in edit mode, the bullet is appearing fine. The only thing is when I Save the contents and Check in for publishing, the bullets vanish. And also there are some minor issues like underline not appearing for urls, alignment problems,etc; What could be the root cause of such an aberrant behavior? If anybody could find a workaround for this, then let me know. Thanks in advance.

Regards,
Raghuraman.V

NLV
Top achievements
Rank 1
 answered on 28 Nov 2009
1 answer
153 views
Hi

I have a javascript function that extracts a custom attribute from a treeview node and uses this to decide whether to hide or show the expand button. This works spot on when expanding a node.

However, I also store the treeview XML in a session variable so that when user navigates back to this page the treeview will be in the same shape as they left it. I have attached a function to the treeview OnClientLoad that uses recursion to naviage through all the expanded nodes toggling the expand button as required. Again this works fine.

However - and might not be possible - when a user navigats back to the page all the nodes have an expand button until the js function runs - which is very quick - a second maybe - however this looks unprofessional as the nodes disappear down the treeview.

Is there way to get around?

As a suggestion for future releases, if I may, it would be extremely handy to be able to set this client side
 answered on 27 Nov 2009
1 answer
310 views
Hi All,

I have a RadGrid with 10 columns, but in EditForm mode i am showing only 6 fields to update.

to show these 6 fields in two columns, i wrote below

<EditFormSettings ColumnNumber="2" CaptionDataField="Period" CaptionFormatString="Edit properties of Period {0}">

but still all the fields are showing in single column in EditForm.

Please help me regarding this.
Daniel
Telerik team
 answered on 27 Nov 2009
4 answers
86 views
Hello

I have a RadGrid with a template column(imagebutton)

i want
  when i click the imagebutton execute a code behind

but i need to know a column value for Example.: an email

how can i do that?


Thanks

P.S.
Sorry about my english is not good enough :)
Luis
Top achievements
Rank 1
 answered on 27 Nov 2009
1 answer
107 views
I have a lot of Grids with default filtering: AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"

Using 2009.3.1109.35 RadGrid filtering crash when if any column that AllowFiltering="true" and not set DataField and try filter for any column.

Example:
... 
<Columns> 
<telerik:GridBoundColumn DataField="ID_ENTIDAD" HeaderText="Id." ReadOnly="True" SortExpression="ID_ENTIDAD" FilterControlWidth="50px" 
     AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="false" >
</telerik:GridBoundColumn> 
<telerik:GridTemplateColumn DataField="DSC_ENTIDAD" HeaderText="Entidad" SortExpression="DSC_ENTIDAD" FilterControlWidth="99%"  
     AutoPostBackOnFilter="true" CurrentFilterFunction="Contains" ShowFilterIcon="false"
     .....
</telerik:GridTemplateColumn> 
<telerik:GridTemplateColumn [DataField="BOL_ACTIVO"] DataType="System.Boolean" HeaderText="Activo" SortExpression="BOL_ACTIVO" 
    AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="false"
.....
</telerik:GridTemplateColumn> 
</column> 

if you forget [DataField="BOL_ACTIVO"]  any filter don't run. Lauch Postback, but OnInit of grid don´t execute.
If you mark this column AllowFiltering="false", all OK.
Daniel
Telerik team
 answered on 27 Nov 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?