Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
98 views
Hi

I was working on having a floating div show up at the end of the tree node when the mouse hovers on the node,I was able to position the div based on the mouse position but, is there a way to get the length/width of the tree node, because I want to position my div to show up right at the point where the node ends not where my mouse is at?

I am doing all this on the client side.May be there is another way of doing this, if so please let me know.

Thanks
Rishi
Top achievements
Rank 1
 answered on 23 Apr 2010
3 answers
279 views
Hello, I implemented the "Listview/Image Gallery"-demo and it looks great (thanks for that :-)).
But in my case the pictures can be both landscape and portrait, and i'm unable to center the images in the middle of the fieldset as you can see in the attachment. What am I doing wrong?

<h2> 
            Foto's</h2> 
        <div> 
            <asp:ScriptManager EnableViewState="false" runat="server" ID="ScriptManagerPand"/> 
            <telerik:RadAjaxLoadingPanel EnableViewState="false" runat="server" ID="RadAjaxLoadingPanelPand" MinDisplayTime="200" /> 
            <telerik:RadFormDecorator EnableViewState="false" runat="server" ID="RadFormDecoratorPand" DecoratedControls="All" Skin="Outlook"/> 
            <telerik:RadAjaxPanel EnableViewState="false" runat="server" ID="RadAjaxPanelPand" LoadingPanelID="RadAjaxLoadingPanelPand"> 
                <telerik:RadListView EnableViewState="false" runat="server" ID="RadListViewPand" DataSourceID="ObjectDataSourcePand" 
                    AllowPaging="true" PageSize="20" DataKeyNames="Id" OverrideDataSourceControlSorting="true"> 
                    <LayoutTemplate> 
                        <div id="ListPand"> 
                            <asp:Panel EnableViewState="false" runat="server" ID="PanelPand" Style="float: left; margin-left: 160px" 
                                Visible="<%#Container.PageCount > 1 %>"> 
                                <asp:Button runat="server" ID="PrevButton" CommandName="Page" CommandArgument="Prev" 
                                    Text="Vorige" Enabled="<%#Container.CurrentPageIndex > 0 %>"/> 
                                <asp:Button runat="server" ID="NextButton" CommandName="Page" CommandArgument="Next" 
                                    Text="Volgende" Enabled="<%#Container.CurrentPageIndex < Container.PageCount - 1 %>"/> 
                            </asp:Panel> 
                            <div> 
                                <telerik:RadSlider runat="server" ID="RadSliderPand" MaximumValue="3" MinimumValue="1" 
                                    Value="2" LiveDrag="false" SmallChange="1" AutoPostBack="true" OnValueChanged="RadSliderPand_ValueChanged" 
                                    Width="150px" CausesValidation="false" Skin="Outlook" /> 
                            </div> 
                            <div style="clear: both;"> 
                            </div> 
                            <fieldset runat="server" id="itemPlaceholder" /> 
                            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<div style="clear: both;"> 
                            </div> 
                        </div> 
                    </LayoutTemplate> 
                    <ItemTemplate> 
                        <fieldset style="float:left; width: <%#ImageWidth.Value+4%>px; height: <%#ImageHeight.Value+4%>px; margin-bottom: 4px"> 
                            <telerik:RadBinaryImage EnableViewState="false" Style="cursor: pointer; background: #eeeeee; padding: 2px 2px 2px 2px;" runat="server" ID="RadBinaryImagePand" 
                                DataValue='<%#Eval("Data") %>' Height='<%#ImageHeight %>' Width='<%#ImageWidth %>' 
                                ResizeMode="Fit" ImageAlign="Middle" onclick="<%#CreateWindowScript(DirectCast(Container.DataItem, Photo)) %>" AlternateText="Klik om te vergroten" 
                                ToolTip="<%#DirectCast(Container.DataItem, Photo).ID %>" class="myClass" onmouseover="containerMouseover(this)" onmouseout="containerMouseout(this)" /> 
                        </fieldset> 
                    </ItemTemplate> 
                </telerik:RadListView> 
            </telerik:RadAjaxPanel> 
            <asp:ObjectDataSource runat="server" ID="ObjectDataSourcePand" SelectMethod="GetData" 
                TypeName="Data.DataProvider"> 
                <SelectParameters> 
                    <asp:Parameter Name="PandID" /> 
                </SelectParameters> 
            </asp:ObjectDataSource> 
            <telerik:RadWindowManager runat="server" ID="RadWindowManagerPand"> 
                <Windows> 
                    <telerik:RadWindow VisibleStatusbar="false" runat="server" ID="WindowHuurpandFoto" NavigateUrl="HuurpandFoto.aspx" 
                        Width="635px" Height="530px" AutoSize="false" Behaviors="Close,Move" ShowContentDuringLoad="false" 
                        Modal="true" ReloadOnShow="true"> 
                    </telerik:RadWindow> 
                </Windows> 
            </telerik:RadWindowManager> 
        </div> 

     Protected Sub RadSliderPand_ValueChanged(ByVal sender As Object, ByVal e As EventArgs) 
        Dim selectedValue As Integer = DirectCast(sender, RadSlider).Value 
 
        Select Case selectedValue 
            Case 1 
                If True Then 
                    ImageHeight = Unit.Pixel(76) 
                    ImageWidth = Unit.Pixel(76) 
                    RadListViewPand.PageSize = 20 
                    Exit Select 
                End If 
            Case 2 
                If True Then 
                    ImageHeight = Unit.Pixel(158) 
                    ImageWidth = Unit.Pixel(158) 
                    RadListViewPand.PageSize = 10 
                    Exit Select 
                End If 
            Case 3 
                If True Then 
                    ImageHeight = Unit.Pixel(287) 
                    ImageWidth = Unit.Pixel(287) 
                    RadListViewPand.PageSize = 6 
                    Exit Select 
                End If 
        End Select 
        RadListViewPand.CurrentPageIndex = 0 
        RadListViewPand.Rebind() 
    End Sub 
 
    Protected Property ImageWidth() As Unit 
        Get 
            Dim state As Object = If(ViewState("ImageWidth"), Unit.Pixel(160)) 
            Return DirectCast(state, Unit) 
        End Get 
        Private Set(ByVal value As Unit) 
            ViewState("ImageWidth") = value 
        End Set 
    End Property 
 
    Protected Property ImageHeight() As Unit 
        Get 
            Dim state As Object = If(ViewState("ImageHeight"), Unit.Pixel(160)) 
            Return DirectCast(state, Unit) 
        End Get 
        Private Set(ByVal value As Unit) 
            ViewState("ImageHeight") = value 
        End Set 
    End Property 

Thanks!

Rosen
Telerik team
 answered on 23 Apr 2010
3 answers
175 views
Hi,

I need to get a grid data when paging...actually I have this code and it works good, but may be exist a better way to do this.


            string ids = ""; 
            this.rg_lead.AllowPaging = false; 
            this.rg_lead.DataBind(); 
 
            foreach (GridDataItem item in this.rg_lead.Items) 
            { 
                if (!ids.Contains("," + item["id"].Text + ",") && ids.Split(',')[0] != item["id"].Text) 
                { 
                    ids += item["id"].Text + ","; 
                } 
            } 
 
            this.rg_lead.AllowPaging = true; 
            this.rg_lead.DataBind(); 

Thanks
Radoslav
Telerik team
 answered on 23 Apr 2010
1 answer
113 views
Hi,

are there any known issues with the Radgrid (ASP.NET AJAX Q1 2010 version) in IE8 compatibility mode in SharePoint 2010?
We sometimes encountered layout issues the the column width and the filters are rendered to the bottom of the filter row

Thanks a lot,
Michael
Sebastian
Telerik team
 answered on 23 Apr 2010
1 answer
118 views
Hello,
how can i manipulate the visual appereane from the dragged nodes in the TreeView? In the GridView all dragged items have a blue background for example while dragging. In the TreeView the background of the dragged items is only transparent. How can i set the background of dragged nodes while dragging in the TreeView?

with best regards
Meik Napierski
Dimitar Milushev
Telerik team
 answered on 23 Apr 2010
3 answers
219 views
Hello,

I'm trying to maintain the state of my RadTreeView in my master page as i navigate from content page to content page.  I have everything working except for the face that when I collapse my nodes and switch pages they open back up when I change content pages.  I know its because I'm using clientside for my TreeNodeExpandMode, but if I switch it to ServerSideCallBack once the post back is completed even though the nodes say Expanded="True" I get a '+' sign and it loads on demand again. I just have two hyperlinks on my page that switch from Page1.aspx and Page2.aspx.  Page1/2.aspx both use Site1.Master as their master page.   Any suggestions would be great!  Thank you.  

Here is my master page code:

public partial class Site1 : System.Web.UI.MasterPage 
    { 
        protected void Page_Load(object sender, EventArgs e) 
        { 
            if (!Page.IsPostBack && String.IsNullOrEmpty((string)Session["treeViewState"])) 
            { 
                LoadRootNodes(); 
                Session["treeViewState"] = RadTreeView1.GetXml(); 
            } 
            else if (!String.IsNullOrEmpty((string)Session["treeViewState"])) 
            { 
                this.RadTreeView1.LoadXml((string)Session["treeViewState"]); 
            } 
        } 
 
        private void LoadRootNodes() 
        { 
            for (int i = 0; i < 5; i++) 
            { 
                this.RadTreeView1.Nodes.Add(new RadTreeNode() 
                { 
                    Text = String.Format("Root: {0}", i.ToString()), 
                    Value = i.ToString(), 
                    ExpandMode = TreeNodeExpandMode.ServerSideCallBack 
                }); 
            } 
        } 
 
        private void AddChildNodes(RadTreeNode node) 
        { 
            for (int i = 0; i < 3; i++) 
            { 
                node.Nodes.Add(new RadTreeNode() 
                { 
                    Text = String.Format("{0}{1}",node.Level.ToString(), i.ToString()), 
                    Value = String.Format("{0}{1}",node.Level.ToString(), i.ToString()), 
                    ExpandMode = TreeNodeExpandMode.ServerSideCallBack 
                }); 
            } 
        } 
 
        protected void RadTreeView1_NodeExpand(object sender, RadTreeNodeEventArgs e) 
        { 
            AddChildNodes(e.Node); 
 
            string treeViewState = (string)Session["treeViewState"]; 
            RadTreeView cachedTreeView = new RadTreeView(); 
            cachedTreeView.LoadXmlString(treeViewState); 
            RadTreeNode cachedNodeClicked = cachedTreeView.FindNodeByValue(e.Node.Value); 
             
            AddChildNodes(cachedNodeClicked); 
            cachedNodeClicked.ExpandMode = TreeNodeExpandMode.ClientSide; 
            cachedNodeClicked.Expanded = true; 
 
            Session["treeViewState"] = cachedTreeView.GetXml(); 
        } 
    } 

T. Tsonev
Telerik team
 answered on 23 Apr 2010
2 answers
139 views
I have a couple of labels in the commanditemtemplate that I need to set during the page load event. Is this possible to do on the server side with VB.net code?
Thank you for your help.
Chris
Chris LaFrancis
Top achievements
Rank 1
 answered on 23 Apr 2010
1 answer
80 views
Hi,
We would like to allow our calendar (powered by RadScheduler) users to subscribe to the same calendar using their iPhones. What will it take to accomplish this? Has anyone done something similar to this for the iPhone before? Any input will be greatly appreciated.

Han
T. Tsonev
Telerik team
 answered on 23 Apr 2010
5 answers
161 views
I am curious as to how the DataRecurrenceParentKeyField is set in the advanced template example <here>. I am trying to replicate the example but am having a hard time figuring out how the parent key field gets set seeing as I keep getting an exception when trying to delete one ocurrence of a recurring event for example. Is there something perhaps I am missing, could someone help point me in the right direction?

Thanks
T. Tsonev
Telerik team
 answered on 23 Apr 2010
2 answers
108 views
Hello,
I know how to customize the Image Editor but I have another problem with it.
I added a button to the Image Editor that open a popup window using the following Javascript code:
function popWin() { 
            window.open("Directories.aspx", "", "width=300,height=300,location=1,status=1,scrollbars=1"); 
            return false; 
        } 
in the Directories.aspx page the following Javascript function:
function onNodeClicking(sender, args) 
    { 
        var node = args.get_node(); // You get the root node   
        var s = node.get_text(); // text of the root node   
        var currentObject = node.get_parent(); // here node.get_parent() returns treeview        
        while (currentObject != null) { 
 
            if (currentObject.get_parent() != null) // here get_parent() will return null for treeview, thus if condition  
            //is not satisfied   
            { 
                s = currentObject.get_text() + "/" + s; // not entered    
            } 
            currentObject = currentObject.get_parent(); // returns null which takes us out of while loop   
        } 
 
        var tbPath = s; // returns the root node text   
 
        window.opener.parent.Form1['NewImageName'].value = tbPath; 
        window.close(); 
    } 
"NewImageName" is the Id of the Textbox that display the name of the new image.
this code is working but in this situation it didn't work.
I need to know how to get the NewImageName textbox.

Thank you.


Amr Saafan
Top achievements
Rank 2
 answered on 23 Apr 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?