Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
107 views
hello,
I' m new in raddevelopment and I'm trying the free Telerik's version
For some reason, I put the radMenu control in an ascx asp.net control and the ascx control is in a masterPage
The basic functions of the menu are working well
But the calling pages are heavy, and it takes several secondes/ minutes to load.
I need to put a waiting message onload
In a normal aspx page, I put the radMenu in an updatepanel, with a updateprogress and there isn't ny problem
But,in the mentioned situation, I tried onclick, onitemclick, onitemdatadound, and every onclient function. I won't be able to fire any waiting message.
Do you have some idea?
Thank you
Pierre
Top achievements
Rank 1
 answered on 09 Dec 2012
3 answers
138 views
My basic question is, every time the Count changes during client-side data binding, it jumps me back to the first page.  Is there any way to prevent this?

Here's a more in-depth description of the problem:

I'm using the RadGrid to display messages with client-side data binding.  A new message arrives on the server every few seconds.  We only keep x hundred messages on the server so once the queue is full old messages fall off the queue as new ones arrive.  Therefore using the standard startRowIndex to keep track of where we are in the grid doesn't work for us.  What is row 20 in one call might be row 19 a few seconds later as the oldest message falls off the queue.  Therefore simply want the next/previous/first/last buttons to jump to the next/previous/first/last group of messages and I'll handle the paging logic with my server code.

Toward that end, I have overridden (using OnItemCreated) the next/previous paging buttons to call my own javascript function for paging -
    function myGridPage(radGridId, dir) {
        pagingDirection = dir;
        $find(radGridId+'_ctl00').page(dir);
    }

Then on data binding I do this:
function RadGridMessages_DataBinding(sender, args) {
        var myMethodArguments = new Object();
        myMethodArguments.pagingDirection = pagingDirection;
        myMethodArguments.maximumRows = args.get_methodArguments().maximumRows;
        args.set_methodArguments(myMethodArguments);
    }

On the server-side I do this:
        [WebMethod(EnableSession = true)]
        public Dictionary<string, object> GetMessages(string pagingDirection, int maximumRows)
        {
<message logic goes here>
            Dictionary<string, object> data = new Dictionary<string, object>();
            data.Add("Data", messages);
            data.Add("Count", totalNumberOfMessages);
            return data;
        }

Everything seems to work fine, except that the "Count" changes often during the first few hours before the server message queue is full.  Every time the Count changes the Telerik client-side code calls set_virtualItemCount() which calls set_currentPageIndex(0).  This move me back to the first page (and triggers a rebind).

a. Am I handing the next/previous page in an appropriate way for my situation or is there a better way to do this.
b. How do I prevent set_virtualItemCount() from kicking me back to the first page every time the count changes?


Amjad
Top achievements
Rank 1
 answered on 09 Dec 2012
0 answers
110 views
Hi Team,

I have very peculiar process.

I am adding in my page on code-behind in the Init of the page a Radcombobox with a dynamic ID. Furthermore I am adding a RadtreeView to it on codebehind with a fix id and with only one node

using this idea:
...
 public void InstantiateIn(Control container)
        {
            RadTreeView tree = new RadTreeView();
            tree.ID = "tv";
            tree.CheckBoxes = true;
            tree.ExpandAllNodes();
            container.Controls.Add(tree);

...

Now my big deal is I want to load that RadTreeView on demand and client-side . My problem came with the JavaScript that is not fiding the controls that have been added on the code behind

I try to add on the load page using a RadCodeBlock the script to find the control but it is not working. Also I tried Sys.Application.add_load(ale)


something like this:
System.Text.StringBuilder sb = new System.Text.StringBuilder();     
            sb.Append(@"<script language='javascript'>");
            sb.Append(@"Sys.Application.add_load(ale);");
            sb.Append(@"alert('Hello World');");
            sb.Append(@"var comboBOX = document.getElementById('<%= 2.ClientID %>'); ");
            sb.Append(@"function ale(){alert(comboBOX);}");
            sb.Append(@"</script>");

Could you help me with an example or some guidance to get the ComboBox that I loaded dynamically with a dynamic ID on Java Script or JQuery. When I get the comobo box how the treeview has a predefined ID I will be able to get it on client-side.

Thank you
            LiteralControl literaJS = new LiteralControl(sb.ToString());
            RadCodeBlockFilterControl.Controls.Add(literaJS);
Denis
Top achievements
Rank 2
 asked on 09 Dec 2012
0 answers
92 views
Hello,
 I am using RadAjaxLoadingPanel to show progress bar on button click. I want to display on page based on id of control. I am using following code to remove background image from class.

  .RadAjax_Office2007 .raDiv
        {
            background-imageurl('') !important;
        }
And on id of control i am showing it like this
    #RadAjaxLoadingPaneldivVital
        {
            background-imageurl("WebResource.axd?d=WSBu9pOMHRl15KsTHWg3T0kmn2YGmMPVvRl2sILKsHrpfxNvrCzaIJl2lpa7x1j9jZKMpkIrN3swdVxt4LudmphTXALh-aA69uNkfQVAWlhNswKa8jAvmaqGRuXJBGaAwBDq-kckfrv9OfQ-kKQJYN2w2wnXp57-m4HO_IOBKP3wUlVUudTpfi9hzwtW4ZIkLXeV2RjIa9Dejcjy16e-mQ2&t=634642303574596967") !important;
            background-repeatno-repeat;
            background-positioncenter;
        }
It woks fine on my machine and progress bar is displaying on page. but on other machine it is not displaying. When i am figuring out using
fire bug it is showing that image is failed to load. I thing each machine generate different background image url. So how I will
use background image url which will be same for all machines.
Ranjan
Top achievements
Rank 1
 asked on 08 Dec 2012
0 answers
120 views

problem in left & ritgh Margin of the windows
Example photos in attach file
plz help me
komeil
Top achievements
Rank 1
 asked on 08 Dec 2012
4 answers
426 views
Hello,

I have a grid with a custom form template that I use for editing.  Inside the template are dropdownlists and textboxes and I see that there aren't any events that I can use when these controls are in the form template.  Is there a way to force an event like selectionIndexChanged or textChanged and if not what event in the grid can I use to manipulate these contols when a user does perform a textChange or selectionIndexChage?

Thanks,
Kirk
Atlas
Top achievements
Rank 1
 answered on 08 Dec 2012
6 answers
309 views
Hi!

I'm trying to get ID and Desciption values from the selected row in a grid when clicking on it, but i cant get it to work. The RadGrid_SelectedIndexChanged event is trigged but SelectedItems is always empty. Any suggestion whats wrong?

Default.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<%@ 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 runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="SpamControlRadScriptManager" runat="server"/>
    <div>
        <telerik:RadGrid runat="server" ID="RadGrid" OnSelectedIndexChanged="RadGrid_SelectedIndexChanged" AutoGenerateColumns="false" Width="300">
            <MasterTableView DataKeyNames="ID">
                <Columns>
                    <telerik:GridNumericColumn DataField="ID" UniqueName="IDGridNumericColumn" />
                    <telerik:GridBoundColumn DataField="Description" UniqueName="OverviewLanguagGridBoundColumn" />
                </Columns>
            </MasterTableView>
            <ClientSettings EnablePostBackOnRowClick="true">
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>

Default.aspx.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using Telerik.Web.UI;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        DataTable myDataTable = new DataTable();
        DataColumn myDataColumn;

        myDataColumn = new DataColumn();
        myDataColumn.DataType = Type.GetType("System.String");
        myDataColumn.ColumnName = "ID";
        myDataTable.Columns.Add(myDataColumn);

        myDataColumn = new DataColumn();
        myDataColumn.DataType = Type.GetType("System.String");
        myDataColumn.ColumnName = "Description";
        myDataTable.Columns.Add(myDataColumn);

        DataRow row;
        row = myDataTable.NewRow();
        row["ID"] = "1";
        row["Description"] = "Test1";
        myDataTable.Rows.Add(row);

        row = myDataTable.NewRow();
        row["ID"] = "2";
        row["Description"] = "Test2";
        myDataTable.Rows.Add(row);

        RadGrid.DataSource = myDataTable;
        RadGrid.DataBind();
    }

    protected void RadGrid_SelectedIndexChanged(object sender, EventArgs e)
    {
        // This is always 0
        int count = RadGrid.SelectedItems.Count;

        if (count > 0)
        {
            var dataItem = RadGrid.SelectedItems[0] as GridDataItem;
            if (dataItem != null)
            {
                var ID = dataItem["ID"].Text;
                var desc = dataItem["Description"].Text;
            }
        }
    }
}

Thanks!
Rickard
Michael
Top achievements
Rank 1
 answered on 07 Dec 2012
0 answers
47 views
Hello,
I have a Usercontrol with a RadComboBox that gets items via a webservice.
Everything is working correctly, however when I type, the search text disappears.
I had the same exact behavior with postbacks, but now its not posting back, and it is still doing the same thing.

Please take a look at the code below.
Here is the code for the RadComboBox:
<telerik:RadComboBox
    ID="cboContentProvider"
    runat="server"
    Width="225px"
    CheckBoxes="true"
    EmptyMessage="-- Select --"
    EnableLoadOnDemand="True"
    ShowMoreResultsBox="True"
    OnClientItemChecked="ItemChecked"
    EnableVirtualScrolling="True">
    <WebServiceSettings Method="GetContentProviderData" Path="../../WebService/BoomboxWs.asmx" />
    <ExpandAnimation Type="InOutElastic" />
</telerik:RadComboBox>

Here is the code for CP_ItemChecked:
function CP_ItemChecked(sender, eventArgs) {
    var data = '{ "type": "' + sender.get_id() + '", "id": "' + eventArgs.get_item().get_value() + '" }';
    $.ajax({
        type: "POST",
        url: "../../WebService/BoomboxWs.asmx/MarkSelectedItem",
        data: data,
        contentType: "application/json; charset=utf-8",
        dataType: "json",
        success: function (msg) {
        }
    });
}

Here is the WebMethod:
[WebMethod(EnableSession = true)]
public RadComboBoxData GetContentProviderData(RadComboBoxContext context)
{
    return GetRadComboBoxData(context, DtCp, DtCp.Count());
}
 
public RadComboBoxData GetRadComboBoxData(RadComboBoxContext context, List<GenericDataList> data, int itemsPerRequest = 20)
{
    var comboData = new RadComboBoxData();
 
    var itemOffset = context.NumberOfItems;
    var endOffset = itemOffset + itemsPerRequest;
 
    if (endOffset > data.Count())
    {
        endOffset = data.Count();
    }
 
    if (!string.IsNullOrEmpty(context.Text))
    {
        data = data.Where(q => q.Name.ToUpper().Contains(context.Text.ToUpper())).ToList();
    }
 
    comboData.EndOfItems = endOffset == data.Count();
 
    var result = new List<RadComboBoxItemData>(endOffset - itemOffset);
 
    result.AddRange(data.Take(endOffset).Skip(itemOffset)
        .Select(radItem => new RadComboBoxItemData {Text = radItem.Name, Value = radItem.Id.ToString(CultureInfo.InvariantCulture)}));
 
    comboData.Message = data.Any() ? String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", endOffset, data.Count()) : "No matches";
    comboData.Items = result.ToArray();
 
    return comboData;
}
Edward
Top achievements
Rank 1
 asked on 07 Dec 2012
9 answers
81 views
Hi ,

I have written a code as :

 <telerik:RadTextBox ID="txtCustomerName" runat="server" EmptyMessage="Please enter customer name"
                            CssClass="SetText" ToolTip="Please enter customer name" EnableSingleInputRendering="True"
                            MaxLength="20" Width="130" TabIndex="2">

So when i click on submit button in Opera browser a popup message shows as " The entered text is too large! You used 26 letters and the limit is 20."

How to resolve this issue.
Vasil
Telerik team
 answered on 07 Dec 2012
11 answers
510 views
Hi,
I have a Tree View with node template column.Inside of template column I have Image Button.

Problem:
I need to open a radwindow on click of Image button and it will open fine except for one scenario.

This issue is happening for only in page load.
When Initial page load if we have a subnode for  a particular node.When we expand and click on image button in subnode radwindow is not opening.
Only for the first click Radwindow is not opening from second time onwards it works fine.

Please help me.

Thanks,
A2H

Slav
Telerik team
 answered on 07 Dec 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?