Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
59 views
I have a set of hierarchical data I am binding to a Tree List control. The source data contains 900 total rows with 227 of the being roots resulting in a long original list plus each branch can have sometimes 6 levels.

The tree list is:
1) very slow to load initially
2) very slow to expand children when expand button clicked (postback to server is slow but grid/page painting is instant)
3) focus does not go to the node that was expanded

Here's some info from the trace log

aspx.page Begin Load 0.000159517480573648 0.000017
Start OnNeedDataSource 0.000180190499071809 0.000021
Start database call 0.00020058415245513 0.000020
Finish database call 6.53778594765536 6.537585
Start generation of parent ids 6.53783343972488 0.000047
Finish generation of parent ids 6.56655440845135 0.028721
Finish OnNeedDataSource 6.56660441480691 0.000050
aspx.page End Load 14.5043473402346 7.937743


Please advise how i can speed up the performance of the grid. I read posts about Tree View having load on demand features but couldn't find documentation for the same feature for Tree List.
Sebastian
Telerik team
 answered on 22 Jul 2011
0 answers
97 views
Hi,

I'm only posting this to help other users on the forum.

I was using the RadGrid and I had one page out of many where calling the DataBind() method would take 30 seconds to run on 192 records. Other pages with double that and more columns wheren't taken that much.

I solved the issue when I found that one of the datafield values was "Task Name" instead of "TaskName". The real datafield name was "TaskName"  so the incorrect field name  caused it to take more time. As soon as I corrected the datafield value, the grid ran normally and was binding within 2 seconds.

Hope this helps someone. I'm using version 2011.1.519.40
Gerry
Top achievements
Rank 1
 asked on 22 Jul 2011
2 answers
289 views
Hello, all

I'm trying to tie into the OnClientKeyPressed event of the RadCombobox (really wished you had an onclientkeyup event, but...). My RadCombobox is in a grid, which makes it difficult to assess its ClientID. I've been scouring through the Client-Side-API, which implies I could just reference the ClientID, or the ID, however both of these are returning "undefined". Since it is an OnKeyPressed event, I could just set a reference to the control, and then do some jquery to tie into the OnKeyUp event on client-side, but this seems "hacky". I wanted to know if there is a more "blessed" solution. My code is as follows:

 

<script language="javascript" type="text/javascript"
  
   
  
function getAutocompleteItems(sender, eventArgs) {
  
    alert(sender.ClientID)  // returns "undefined" 
  
   
  
    alert(sender.ID) // returns "undefined" 
  
    //var cboItem = new Telerik.Web.UI.RadComboBoxItem(); 
  
    //cboItem.set_text("Help... somebody!!!"); 
  
    sender.trackChanges();
  
   
  
    var items = sender.get_items()
  
    for (var i = 0; i < items.get_count(); i++) {
  
        if (!items.getItem(i).get_text().toLowerCase().indexOf(sender.get_text().toLowerCase()) == 0) {
  
        items.remove(items.getItem(i));
  
        }
  
    }
  
    //sender.get_items().add(cboItem); 
  
    sender.commitChanges();
  
}
  
</script>
<telerik:GridTemplateColumn DataField="LineItem" UniqueName="grdColHostIDDef"
  
<HeaderStyle Width="0%" HorizontalAlign="Center"/> 
  
<ItemStyle HorizontalAlign="Center" Width="0%" VerticalAlign="Top" /> 
  
<ItemTemplate
  
<span class="validatable"><telerik:RadComboBox runat="server" ID="ddlHostValue" 
  
 CollapseAnimation-Duration="1" 
  
ExpandAnimation-Duration="1" 
  
ExpandAnimation-Type="Linear" 
  
AllowCustomText="true" 
  
CausesValidation="false" 
  
DataSourceID="HostTypeDataSource" 
  
DataTextField="Value" 
  
DataValueField="Value" 
  
OnClientKeyPressing="getAutocompleteItems" 
  
/> 
  
</telerik:GridTemplateColumn
  
  
Shinu
Top achievements
Rank 2
 answered on 22 Jul 2011
1 answer
88 views
Hi all,

According your demo on usibng web services to load data on demand:

http://demos.telerik.com/aspnet-ajax/combobox/examples/populatingwithdata/autocompletesql/defaultcs.aspx


if I remove the 'static' code from the method in the code behind CS page I get the error :

"The server method has failed' as a popup box.

Here is my code behind:

public const int ItemsPerRequest = 10;
 
       [WebMethod]
       public  RadComboBoxData GetDealNumbers(RadComboBoxContext context)
       {
           DataTable data = GetData(context.Text);
            
           RadComboBoxData comboData = new RadComboBoxData();
           int itemOffset = context.NumberOfItems;
           int endOffset = Math.Min(itemOffset + ItemsPerRequest, data.Rows.Count);
           comboData.EndOfItems = endOffset == data.Rows.Count;
 
 
           List<RadComboBoxItemData> result = new List<RadComboBoxItemData>(endOffset - itemOffset);
 
 
           for (int i = itemOffset; i < endOffset; i++)
           {
               RadComboBoxItemData itemData = new RadComboBoxItemData();
               itemData.Text = data.Rows[i]["DealNo"].ToString();
               itemData.Value = data.Rows[i]["DealNo"].ToString();
               result.Add(itemData);
           }
                       
           comboData.Message = GetStatusMessage(endOffset, data.Rows.Count);
 
 
           comboData.Items = result.ToArray();
           return comboData;
 
 
       }
 
 
       public  DataTable GetData(string text)
       {
           
           SqlDataAdapter adapter = new SqlDataAdapter("SELECT new_name as 'DealNo' from new_dealtracking WHERE new_name  LIKE @text + '%'", Properties.Settings.Default.MSCRMConnectionString);
            
           
            
           adapter.SelectCommand.Parameters.AddWithValue("@text", text);
 
 
           DataTable data = new DataTable();
           adapter.Fill(data);
 
 
           return data;
       }
 
 
       private  string GetStatusMessage(int offset, int total)
       {
           if (total <= 0)
               return "No matches";
            
           return String.Format("Items <b>1</b>-<b>{0}</b> out of <b>{1}</b>", offset, total);
       }
:

My aspx code is:

<telerik:RadComboBox ID="RadComboBox4" runat="server" Width="157px" Height="150px"
               EmptyMessage="Select a Deal" EnableLoadOnDemand="true" ShowMoreResultsBox="true"
               EnableVirtualScrolling="true">
            
               <WebServiceSettings Method="GetDealNumbers" Path="Custom_DealUI.aspx" />
           </telerik:RadComboBox>

Why is this the case??
Kevin
Top achievements
Rank 2
 answered on 22 Jul 2011
1 answer
67 views
hello,

I want to display one grid column as a sorted column since query result is sorted by that column values.

Well, i dont know the best way to display it but i found following code on the forum.
After applying that code grid appears to be hanged and then none of the column can be sorted on clicking the column header.
Protected Sub rg_Edit_Report_PreRender(ByVal sender As Object, ByVal e As EventArgs) Handles rg_Edit_Report.PreRender
    Dim SortExp As New GridSortExpression()
    SortExp.FieldName = "CASE"
    SortExp.SortOrder = GridSortOrder.Ascending
    rg_Edit_Report.MasterTableView.SortExpressions.Add(SortExp)
    rg_Edit_Report.MasterTableView.Rebind()
End Sub

Can you please suggest me the best way to display the sorted column by default without hampering other features of radGrid ?

Princy
Top achievements
Rank 2
 answered on 22 Jul 2011
1 answer
72 views
Dear,

How can I display days as boxes in Rad Calendar so I can add events ( hyperlinks) in each box.

Regards,
Andrey
Telerik team
 answered on 22 Jul 2011
2 answers
193 views

Hi,

I have to use VBScript and have to check the checkbox automatically, I mean, do smth like this:
doc.GetElementById("ResetPasswordCheckBox").Checked = True or
doc.GetElementById("saveBtn").Click
etc. where doc = ie.document

But when I try to implement these sentences, nothing works:

doc.GetElementById("UserGroupsTree").Nodes(0).Checked
doc.GetElementById("UserGroupsTree").Nodes(1).Selected
doc.GetElementById("UserGroupsTree").Nodes(2).Selected
doc.GetElementById("UserGroupsTree").SelectedNodes.Count
doc.GetElementById("UserGroupsTree").Nodes(0).Text
doc.GetElementById("UserGroupsTree").Nodes(1).Text
doc.GetElementById("UserGroupsTree").Nodes(2).Text
doc.GetElementById("UserGroupsTree").Nodes(0).Value
doc.GetElementById("UserGroupsTree").Nodes(1).Value
doc.GetElementById("UserGroupsTree").Nodes(2).Value

The html code contains smth like this:

 

<div id="UserGroupsTree"

class="RadTreeView RadTreeView_Default"

style="overflow:auto;height:100%;width:100%;">

 

<ul class="rtUL rtLines">

<li class="rtLI rtFirst rtLast">

<div class="rtTop">

<span class="rtSp"></span>

<span class="rtPlus"></span>

<input type="checkbox" class="rtChk" />

<span class="rtIn">Some Text</span>

</div>

</li>

</ul>

<input id="UserGroupsTree_ClientState" name="UserGroupsTree_ClientState" type="hidden" />

</div>

And I want  to set this checkbox to "true" automatically, by means of script, i.e. simulating user clicking

And my script can access user machine only, no access to server side.

I 'm limited to vbscript only (script which runs on client side, not server side)

Perhaps I'm trying to do smth wrong but any help is greatly appreciated,

Thanks in advance,
John

 

Dimitar Terziev
Telerik team
 answered on 22 Jul 2011
1 answer
43 views
In javascript in order to get the client-side instance of Telerik Object it's possible to use:
var tree = $find("<%= RadTreeView1.ClientID %>")

But how to do the same by means of vbscript?
Dimitar Terziev
Telerik team
 answered on 22 Jul 2011
3 answers
115 views
Dear all,

         I am using RadDateInput controls. I need "00/00/00" when focus to that controls. Am using (DisplayDateFormat="dd-MMM-yyyy" DateFormat="MM/dd/yy" ) attributes also.

thanks,
vinoth

vinoth sansar
Top achievements
Rank 2
 answered on 22 Jul 2011
6 answers
509 views
Hello,

I have a RadUpload control on a web form.  However, I'm storing a lot of additional information with regard to the file that is being uploaded in additional text boxes, combo boxes, etc.  Some of these values cause the page to post back, which normally would be fine because all of the information get's put into ViewState.  However, every time the page posts back, the Upload control loses the file that was selected and I have to select the file again.

Is there a way to preserve the value of the file selected between post backs?

Thanks,
Warren
July
Top achievements
Rank 2
 answered on 22 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?