Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
104 views
Hi,

I am new at Telerik Charts and i have a doubt about  positioning labels.

I have YAxis autoscale true, so when the label with the total items is in top position, the number stay inside the bar, not outside. In the picture i attach in this post, you can see how label "48" stay inside the bar, is it possible to position it outside with autoscale=true ?

Thanks in advance
Tsvetie
Telerik team
 answered on 05 Feb 2013
3 answers
246 views
Hello Telerik.

I have a problem RadCoboBox's "SelectText" function.

It can select part of text through selected length.

I tried use this function but it doesn't work.

So i have tried many test, finally getting result.

If i want to use SeelectText function , i should to set some properpties.

EnableTextSelection="true" EnableLoadOnDemand="true".

that properies are set true, selectText was worked.

Is it bug or planned scenario?

I shared download sample code, please test this.

http://www.mediafire.com/?njbisuahv0mnben


Cat Cheshire
Top achievements
Rank 1
 answered on 05 Feb 2013
3 answers
73 views
I have several RadGrid in my application. In which the pager mode is set to NextPrevNumericAndAdvanced. And upon changing the page number in text box and hitting 'Enter Key' was working fine. Same was true for page size text box. Recently we upgraded the Telerik controls from version 2008.2.723.20 to 2012.2.815.35. After the upgrade the 'Enter Key' press has stopped working. We also noticed that 'Go' and 'Change' are buttons now instead of links. Please advise.

Though I tried to induced the Enter Key functionality on paging manually through following code, but it is not working. Strangely if I put a break point or put an alert in keyDown javascript function it works. Please help me get this done. 

<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your JavaScript code here.
        function keyDown(e) {
            if (e.keyCode == 13) {
                //get text box client id to check if it's not empty 
                var tbCliendId = document.getElementById("tbId").value;
                var tb = document.getElementById(tbCliendId);
                if (tb.value.length > 0) {
 
                    //get "Go" button client ID from the hidden field value 
                    var buttonCliendId = document.getElementById("goLinkId").value;
                    var button = document.getElementById(buttonCliendId);
                
                    button.click();
                }
            }
        }
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
    </telerik:RadAjaxManager>
    <div>
        <asp:HiddenField ID="tbId" runat="server" />
        <asp:HiddenField ID="goLinkId" runat="server" />
 
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true" PageSize="2" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCreated="RadGrid1_ItemCreated">
            <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="true" />
            <MasterTableView>
                <Columns>
                    <telerik:GridBoundColumn HeaderText="Vendor" DataField="Vendor">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="Address" DataField="Address">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn HeaderText="Bank" DataField="Bank">
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    </form>
</body>

protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
{
 
    DataTable dt = new DataTable();
    dt.Columns.Add("Vendor");
    dt.Columns.Add("Address");
    dt.Columns.Add("Bank");
 
    dt.Rows.Add("ABC1", "Address1", "Bank1");
    dt.Rows.Add("ABC2", "Address2", "Bank2");
    dt.Rows.Add("ABC3", "Address3", "Bank3");
    dt.Rows.Add("ABC4", "Address4", "Bank4");
    dt.Rows.Add("ABC5", "Address5", "Bank5");
    dt.Rows.Add("ABC6", "Address6", "Bank6");
 
    RadGrid1.DataSource = dt;
 
}
 
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
    if (e.Item is GridPagerItem)
    {
        //find the text box 
        RadNumericTextBox pageNum = (RadNumericTextBox)e.Item.FindControl("GoToPageTextBox");
        tbId.Value = pageNum.ClientID;
 
        //find 'Go' link button 
        Button goLink = (Button)e.Item.FindControl("GoToPageLinkButton");
        goLinkId.Value = goLink.ClientID;
 
        //attach to onkeydown event 
        pageNum.Attributes.Add("onkeydown", "keyDown(event);");
    }
}

Andrey
Telerik team
 answered on 05 Feb 2013
1 answer
139 views
Hello.  I am using a dropdown in combination with a ListView/DataPager.  The dropdownlist does a postback which rebinds the ListView.

I problem is that I'm showing/hiding the RadDataPager using the RadDataPager on_prerender event, which does not get called when the ListView is rebound.

How can I cause this event to be called when I rebind my ListView?   Thanks!

ASP:
<telerik:RadListView ID="RadGrid_Bookmarks" runat="server"
                OnNeedDataSource="RadGrid_Bookmarks_NeedDataSource"
                 EnableViewState="true" ItemPlaceholderID="phRadListView" >
                 <LayoutTemplate>
                
               <telerik:RadDataPager ID="radPager1"  runat="server" Skin="Windows7"   OnPreRender="radPager_PreRender"   OnInit="radPager_Init"  >
                    <Fields>
                    <telerik:RadDataPagerTemplatePageField HorizontalPosition="LeftFloat">
                        <PagerTemplate>
                            <div style="float: right;color:#666666;">
                                Displaying items <asp:Label runat="server" ID="PageItemFromLabel"  /> to <asp:Label runat="server" ID="PageItemToLabel"  /> of <asp:Label runat="server" ID="TotalItemsLabel"  />
                            </div>
                        </PagerTemplate>
                    </telerik:RadDataPagerTemplatePageField>
                     <telerik:RadDataPagerButtonField FieldType="NextLast" HorizontalPosition="RightFloat" />
                      <telerik:RadDataPagerButtonField FieldType="Numeric" HorizontalPosition="RightFloat" />
                    <telerik:RadDataPagerButtonField FieldType="FirstPrev" HorizontalPosition="RightFloat" />
    </Fields>        
</telerik:RadDataPager>



Code Behind:
protected void ddlDays_SelectedIndexChanged(object sender, EventArgs e)
        {
            RadGrid_Bookmarks.Rebind();
        }
 
        protected void RadGrid_Bookmarks_NeedDataSource(object source, RadListViewNeedDataSourceEventArgs e)
        {
    DataSet dsBookmarks = GetPostsByUser(UserID, uID, SiteID, int.Parse(ddlDays.SelectedValue), RadGrid_Bookmarks.CurrentPageIndex + 1);
 
    RadGrid_Bookmarks.VirtualItemCount = int.Parse(dsBookmarks.Tables[0].Rows[0]["totalRec"].ToString());
    RadGrid_Bookmarks.PageSize = 50;
    RadGrid_Bookmarks.DataSource = dsBookmarks.Tables[1];
     }
 
        protected void radPager_PreRender(object sender, EventArgs e)
        {
            RadDataPager rdp = (RadDataPager)sender;
        
            ((Label)rdp.Controls[0].FindControl("PageItemFromLabel")).Text = (rdp.StartRowIndex + 1).ToString();
            ((Label)rdp.Controls[0].FindControl("PageItemToLabel")).Text = ((rdp.TotalRowCount < (rdp.StartRowIndex + rdp.PageSize)) ? rdp.TotalRowCount : rdp.StartRowIndex + rdp.PageSize).ToString();
            ((Label)rdp.Controls[0].FindControl("TotalItemsLabel")).Text = rdp.TotalRowCount.ToString();
 
            if (rdp.TotalRowCount <= rdp.PageSize)
                rdp.Visible = false;
 
        }
 
        protected void radPager_Init(object sender,EventArgs e)
        {
            RadDataPager rdp = (RadDataPager)sender;
            rdp.PageSize = 50;
            
        }
Kostadin
Telerik team
 answered on 05 Feb 2013
3 answers
130 views
hi
how can i dynamically show Tooltip with text on Specific Image?
like a map (not image map) , by x,y position on image.
really tanx
rdmptn
Top achievements
Rank 1
 answered on 05 Feb 2013
7 answers
166 views
I've been trying to convert a website to use the current Telerik tools but I've been unable to resolve a couple of errors.

First I cannot seem to find an alternative to RadEditorUtils.Link in the Telerik.Web.UI dll.

I am also getting some event not found errors on the SubmitClicked and CancelClicked events of the editor. I'm not sure if that will go away once I am able to compile the website.

Kate
Telerik team
 answered on 05 Feb 2013
3 answers
167 views
How  can i create a scheduler or what do I need to add to my scheduler that every user can use the same scheduler but he  cannot see what the other one is inserting / updating / deleting 

can you give me some good advise or even a solution ? 

Thanks for fast answer and help 
Plamen
Telerik team
 answered on 05 Feb 2013
1 answer
112 views
Hi,

We're using the following code to print the content of a radpane :
But the newly opened window does not close itself after printing.
Is there any way to achieve this behaviour?
function clientButtonClicking(sender, args) {
                   var toolBar = sender;
                   var button = args.get_item();
 
                   if (button.get_value() == "print") {
                       var splitter = $find('<%= RadSplitter2.ClientID%>');
                       var pane = splitter.GetPaneById('<%= RadPaneContentDetail.ClientID %>');
                       if (!pane) return;
                       pane.Print();
                   }                    }
               }
Vessy
Telerik team
 answered on 05 Feb 2013
1 answer
93 views
We are using 2 treeviews to allow users to move items from one to the other.  After moving the selected items, we are programmatically setting the next node available as selected. When we try to multi-select again after the move we get the following error:

Microsoft JScript runtime error: Unable to get value of the property 'get_nodes': object is null or undefined

Here is a snippet of our JS source.
function Left() {
    if (availableTree.get_selectedNode()) {
        var sourceNodes = availableTree.get_selectedNodes();
        var index = sourceNodes[0].get_index();
        var destNodeList = selectedTree.get_nodes();
        var destNode;
        if (destNodeList) {
            destNode = destNodeList.getNode(0);
            }
        onNodeDroppingPrivate(availableTree, sourceNodes, destNode, "add");
        if (availableTree.get_nodes().get_count() == index) {
            index = index - 1;
        }
        availableTree.get_nodes().getNode(index).set_selected(true);
    }
    else {
        alert("Please select a service level to transfer");
    }
    SetSaveToFalse();
 
}
 
function onNodeDroppingPrivate(sender, sourceNodes, destinationNode, position) {
    var retVal = dropOnTree(sourceNodes); /*gets value of dragged node*/
    if (retVal != "0") {
        clientSideEdit(sender, sourceNodes, destinationNode, position);
    }
    else {
        alert("There are no service levels to transfer.");
    }
    SetSaveToFalse();
}
 
function dropOnTree(sourceNodes) {
    var text = "";
 
    if (sourceNodes.length) {
        var i;
        for (i = 0; i < sourceNodes.length; i++) {
 
            var node = sourceNodes[i];
            if (node.get_attributes().getAttribute("Category") == "true") {
                node = node.get_nodes().getNode(0);
            }
            text = node.get_value();
            break;
        }
    }
    return text;
}
 
function clientSideEdit(sender, sourceNodes, destinationNode, position) {
    availableTree.trackChanges();
    selectedTree.trackChanges();
 
    if (destinationNode)
    {
        for (var i = 0; i < sourceNodes.length; i++) {
            var sourceNode = sourceNodes[i];
            var sourceParent = sourceNode.get_parent();
            sourceParent.get_nodes().remove(sourceNode);
 
            if (sourceParent.get_nodes().get_count() == 0) {
                var node = new Telerik.Web.UI.RadTreeNode();
                node.set_value("0");
                if (sourceParent.get_id() == availableTree.get_id())
                    {
                    node.set_text("All available service levels have been selected.");
                    }
                    else
                    {
                    node.set_text("No service levels have been selected.");
                    }
                sourceParent.get_nodes().add(node);
            }
            if (position == "over") insertAfter(destinationNode, sourceNode);
            if (position == "above") insertBefore(destinationNode, sourceNode);
            if (position == "below") insertAfter(destinationNode, sourceNode);
            if (position == "add") add(destinationNode, sourceNode);
        }
 
        destinationNode.set_expanded(true);
 
        availableTree.commitChanges();
        selectedTree.commitChanges();
    }
}
function add(destinationNode, sourceNode) {
    var destinationParent = destinationNode.get_parent();
    GetAttribute(destinationParent, sourceNode);
    /* If destination parent contains 'No Nodes exist', new node added takes its place*/
    if (destinationParent.get_nodes().getNode(0).get_value() == "0") {
        destinationParent.get_nodes().getNode(0).set_text(sourceNode.get_text());
        destinationParent.get_nodes().getNode(0).set_value(sourceNode.get_value());
        AddTheEditButton(destinationParent.get_nodes().getNode(0), destinationParent.get_nodes().getNode(0));
    }
    else {
        if (destinationParent.get_id() == selectedTree.get_id()) {
            addEditButton(destinationNode, sourceNode, "add", 0);
        }
        else {
            destinationParent.get_nodes().add(sourceNode);
            sourceNode.set_checked(true);
        }
    }
 
    return "false";
}

Kate
Telerik team
 answered on 05 Feb 2013
2 answers
122 views

Even after selecting IsCaseSensitive to false, my searches are case sensetive. For example entering "test" doesn't return me "Test"
 
Below is my code :


<
telerik:RadComboBox ID="radCombobox1" Runat="server" AutoPostBack="true" IsCaseSensitive="false"

 

 

OnSelectedIndexChanged="radCombobox1_OnSelectedIndexChanged"

 

DataSourceID="LinqDataSource_Users" DataValueField="ID"

 

DataTextField="Name" EnableAutomaticLoadOnDemand="true" RadComboBoxImagePosition="Right"

 

ShowToggleImage="false"

 

ItemsPerRequest="10" ShowMoreResultsBox="true"

 

EnableVirtualScrolling="true" CssClass="search-input" MarkFirstMatch="True" EmptyMessage="Search for contacts" SortCaseSensitive="True" Filter="StartsWith">

</telerik:RadComboBox>

 

 

 

<asp:LinqDataSource ID="LinqDataSource_Users" runat="server"

 

TableName="usp_Users"

 

ContextTypeName="MyDataContext" OrderBy="Name"

 

OnSelecting="LinqDataSource_Users_Selecting" > </asp:LinqDataSource>



Nencho
Telerik team
 answered on 05 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
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?