Telerik blogs

Latest

  • Web ASP.NET AJAX

    RadRotator for ASP.NET AJAX: Using dynamic templates

    My colleague Todd Anglin has already written a post about how to create a rotator control dynamically - you can read it here - How to Create RadRotator Programmatically. Unfortunately, this code in that post is for the old RadRotator control and if you try to use it in the new ASP.NET AJAX version, you will notice that it will not compile. Fortunately, you can quickly fix that. Here is what you need to change: FrameTemplate - this property has been replaced with ItemTemplate RadRotatorFrame - this object has been replaced with RadRotatorItem After you update the above names, you should be able...
    August 20, 2008
  • Web ASP.NET AJAX

    RadTips Episode 3: Client-Side Sorting in the RadGrid

    In celebration of the fact that the weekend is upon us, I'd like to leave you all with another exciting RadTips episode. This episode covers yet another client-side databinding technique: sorting. Client-side databinding is an advanced feature of the RadGrid, and something only found in the latest and greatest bits from the RadControls for ASP.NET AJAX suite. This episode walks you through how to implement sorting when using this new feature. The demo users other cool ASP.NET features like LINQ to XML and Page Methods, so be sure to check it out. As always, the video is available in WMV...
    August 16, 2008
  • Web

    Internet Explorer JavaScript Performance Tip - use the "children" property

    Today I was profiling the initialization time of RadTreeView for ASP.NET Ajax and found out that the biggest bottleneck was traversing the DOM tree. The code looks something like this: //get_childListElement() returns an HTML element  var childNodes = parent.get_childListElement().childNodes;  for (var i = 0, length = childNodes.length; i < length; i++)  {       var childNode = childNodes[i];         //Perform additional initialization  }  I tested with 10000 elements and in IE7 I got about 25000ms whilst in FireFox the total time was around 33ms (Core 2 Duo @ 2.33GHz). Quite a difference if you ask me. I thought that there may be some IE specific method/property which could perform better and I dug into MSDN. And a few minutes later I found the children property!!! Apparently the children collection contains only HTML elements (whilst childNodes is full of...
    August 14, 2008
  • Web

    How To: RadGridView for WPF paging, sorting and filtering of 1mil. records with LINQ to SQL

    I've made small example how to perform paging, sorting and filtering directly on the data-base sever using LINQ to SQL and RadGridView for WPF. The data-base is not included however you can use the same code with any data-base with following modifications: - change the connection string in the app.config file - change the table name in BindGrid() method:     IQueryable queryable = new DataClasses1DataContext().[Your Table].AsQueryable(); - define desired total number of items per page and total page count - change the filter expression in the filter button click event handler to desired (currently Contains for Name...
    August 13, 2008
  • Web

    How To: RadGrid hierarchy from objects hierarchy

    Every once in a while we receive support about how to create hierarchical grid directly from objects hierarchy and I decided to post small example how to achieve this easily:   protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)   {     RadGrid1.DataSource = MyList;   }   protected void RadGrid1_DetailTableDataBind(object source, GridDetailTableDataBindEventArgs e)   {     e.DetailTableView.DataSource = MyList.Find(          delegate(Master master)          {            return master.ID == Convert.ToInt32(e.DetailTableView.ParentItem.GetDataKeyValue("ID"));         ...
    August 11, 2008