Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
824 views

Join Todd Anglin, Telerik Chief Evangelist and Microsoft MVP, for the free “RadGrid for ASP.NET AJAX Optimization: Part 1” webinar that will take place on Thursday, October 1st from 11:00 am until 12:00 pm EDT.

In this week’s webinar, we will look at how you can optimize the performance of the RadGrid for ASP.NET AJAX for data operations over the web. The following five categories will be discussed:

  • Viewstate management
  • Column editor optimization
  • Conditional rendering
  • Ajaxification
  • Resource management.

There are, of course, many other optimization strategies, and we will dive deeper in to those tips and tricks in part two of this webinar series.

The webinar will take place on October 1st , 11:00am EDT.

Book your seat now!

Sebastian
Telerik team
 answered on 27 May 2010
4 answers
109 views
I have a couple of questions on filtering and the radgrid.
1. I have a grid with a couple of the columns that aren't shown but the users want to be able to filter off of those rows. Is it possible to use a rad window to let them enter their filter criteria in textboxes and pass that to the radgrid when it closes or is there a better way to do this? Is there an example or demo I can look at for this?

2. I have another radgrid that the users want a drop down to be able to select multiple values to filter off of in a column. Can I use the radcombobox to do this or is there a better way? Is there an example or demo I can look at for this?

With both of these grids I use a webservice to return data and then put the data into a datatable and then bind a dataview of that datatable to the grid.

Thank you very much for your help.
Chris
Mira
Telerik team
 answered on 27 May 2010
1 answer
144 views
First off: Hello! this my first post here, and I have an annoying issue that arises with google chrome.

here's a screenshot: http://img208.imageshack.us/img208/448/gridproblem.png

I started out using the Web Mail demo from this site for the layout. It worked nicely. Then I decided I would to like to put some common layouts and functionality into a templated usercontrol.

I put a radsplitter, 2 panes, and 2 placeholders in the usercontrol markup. I created a page with the usercontrol on it; within one of its templates I put a radgrid. Everything worked well with IE/FireFox, but the grid got squished in chrome. After searching these forums I found some javascripts which may be outdated, but I implemented them anways and the grid actually resized in chrome onload but gets squished the moment I start resizing the window.

Here's the code

usercontrol asxc
<%@ Control Language="C#" AutoEventWireup="true" CodeFile="PanelView.ascx.cs" Inherits="PanelView" ClassName="PanelView" %> 
<%@ Register Src="HeaderBar.ascx" TagName="HeaderBar" TagPrefix="emesh" %> 
<telerik:RadScriptBlock ID="rsbChrome" runat="server" Visible="false"> 
    <script type="text/javascript"> 
            function Resize() { 
                setTimeout(function () { 
 
                    var scrollArea = null; 
 
                    for (var i = 0; i < radGrids.length; i++) { 
 
                        var scrollArea = document.getElementById(radGrids[i] + "_GridData"); 
                        if (scrollArea) { 
                            scrollArea.style.height = document.body.offsetHeight + "px"; 
                        } 
                        if (window[radGrids[i]].ClientSettings.Scrolling.UseStaticHeaders) { 
                            var header = document.getElementById(radGrids[i] + "_GridHeader"); 
                            scrollArea.style.height = document.body.offsetHeight - header.offsetHeight + "px"; 
                        } 
                    } 
                     
                }, 200); 
            } 
            windowwindow.onresize = window.onload = Resize; 
    </script> 
</telerik:RadScriptBlock> 
<telerik:RadSplitter ID="RadSplitter1" runat="server" Width="100%" BorderSize="0" BorderStyle="None" PanesBorderSize="0" Height="100%" Orientation="Horizontal"> 
    <telerik:RadPane ID="LeftPane" runat="server" Scrolling="None"> 
        <emesh:HeaderBar runat="server" ID="LeftPaneCaption" /> 
        <asp:PlaceHolder runat="server" ID="LeftPaneContent" /> 
    </telerik:RadPane> 
    <telerik:RadSplitBar ID="RadSplitBar1" runat="server"> 
    </telerik:RadSplitBar> 
    <telerik:RadPane ID="RightPane" runat="server" Scrolling="None"> 
        <emesh:HeaderBar runat="server" ID="RightPaneCaption" /> 
        <asp:PlaceHolder runat="server" ID="RightPaneContent" /> 
    </telerik:RadPane> 
</telerik:RadSplitter> 

usercontrol codebehind:
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using Telerik.Web.UI; 
using System.ComponentModel; 
using System.Web.Script.Serialization; 
 
public partial class PanelView : System.Web.UI.UserControl 
{ 
    #region ContentTemplate Code 
 
    private ITemplate leftContentTemplate = null; 
    private ITemplate rightContentTemplate = null; 
 
    public class ContentContainer : WebControl, INamingContainer { } 
 
    [TemplateContainer(typeof(ContentContainer))] 
    [PersistenceMode(PersistenceMode.InnerProperty)] 
    [TemplateInstance(TemplateInstance.Single)] 
    [Browsable(true)] 
    [Category("Behavior")] 
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] 
    public ITemplate LeftPaneContentTemplate 
    { 
        get { return leftContentTemplate; } 
        set { leftContentTemplate = value; } 
    } 
 
    [TemplateContainer(typeof(ContentContainer))] 
    [PersistenceMode(PersistenceMode.InnerProperty)] 
    [TemplateInstance(TemplateInstance.Single)] 
    [Browsable(true)] 
    [Category("Behavior")] 
    [DesignerSerializationVisibility(DesignerSerializationVisibility.Content)] 
    public ITemplate RightPaneContentTemplate 
    { 
        get { return rightContentTemplate; } 
        set { rightContentTemplate = value; } 
    } 
 
    protected override void OnInit(EventArgs e) 
    { 
        base.OnInit(e); 
 
        if (LeftPaneContentTemplate != null) 
        { 
            // Instantiate and initialize the content container class 
            ContentContainer containerLeft = new ContentContainer(); 
            LeftPaneContentTemplate.InstantiateIn(containerLeft); 
 
            // Add the content template to the placeholder so that we can see the user content 
            LeftPaneContent.Controls.Add(containerLeft); 
        } 
        else 
        { 
            LeftPaneVisible = false; 
        } 
 
        if (RightPaneContentTemplate != null) 
        { 
            // Instantiate and initialize the content container class 
            ContentContainer containerRight = new ContentContainer(); 
            RightPaneContentTemplate.InstantiateIn(containerRight); 
 
            // Add the content template to the placeholder so that we can see the user content 
            RightPaneContent.Controls.Add(containerRight); 
        } 
        else 
        { 
            RightPaneVisible = false; 
        } 
    } 
    #endregion 
    #region Properties 
 
    public bool LeftPaneVisible 
    { 
        get{ return LeftPane.Visible; } 
        set{ LeftPane.Visible = value;} 
    } 
    public bool RightPaneVisible 
    { 
        get { return RightPane.Visible; } 
        set { RightPane.Visible = value; } 
    } 
 
    public string LeftPaneTitle 
    { 
        get { return LeftPaneCaption.Text; } 
        set { LeftPaneCaption.Text = value; } 
    } 
    public string RightPaneTitle 
    { 
        get { return RightPaneCaption.Text; } 
        set { RightPaneCaption.Text = value; } 
    } 
 
    public Orientation CurrentOrientation 
    { 
        get { return RadSplitter1.Orientation; } 
        set { RadSplitter1.Orientation = value; } 
    } 
 
    public bool ChromeCompatibilityMode 
    { 
        get; 
        set; 
    } 
    #endregion 
 
    protected override void OnPreRender(EventArgs e) 
    { 
        base.OnPreRender(e); 
 
        if (!LeftPaneVisible || !RightPaneVisible) 
        { 
            RadSplitBar1.Visible = false; 
        } 
 
        if (ChromeCompatibilityMode) 
        { 
            rsbChrome.Visible = true; 
 
            List<string> IDs = new List<string>(); 
 
            FillWithGridIDs(IDs, Page.Controls); 
 
            JavaScriptSerializer js = new JavaScriptSerializer(); 
 
            ScriptManager.RegisterArrayDeclaration(Page, "radGrids", js.Serialize(IDs)); 
        } 
    } 
 
    protected void Page_Load(object sender, EventArgs e) 
    { 
 
    } 
 
    private void FillWithGridIDs(List<string> gridIDs, ControlCollection controls) 
    { 
        foreach (Control ctrl in controls) 
        { 
            if (ctrl is RadGrid) 
            { 
                gridIDs.Add(ctrl.ClientID); 
            } 
 
            FillWithGridIDs(gridIDs, ctrl.Controls); 
        } 
    } 
} 

aspx:
<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPages/EMeshMaster.master" AutoEventWireup="true" CodeFile="Roles.aspx.cs" Inherits="Roles" %> 
 
<%@ Register src="UserControls/HeaderBar.ascx" tagname="HeaderBar" tagprefix="uc1" %> 
<%@ Register src="UserControls/PanelView.ascx" tagname="PanelView" tagprefix="emesh" %> 
 
<asp:Content ID="Content1" ContentPlaceHolderID="cphHead" Runat="Server"> 
</asp:Content> 
 
<asp:Content ID="Content2" ContentPlaceHolderID="cphContent" Runat="Server"> 
 
    <asp:ObjectDataSource ID="dsRoles" runat="server" TypeName="DbHelpers" SelectMethod="GetRoles"></asp:ObjectDataSource> 
 
    <emesh:PanelView runat="server" ChromeCompatibilityMode="true"> 
        <LeftPaneContentTemplate> 
            <telerik:RadToolBar ID="tlbRoles" runat="server" Width="100%" onbuttonclick="tlbRoles_ButtonClick"> 
                <Items> 
                    <telerik:RadToolBarButton Value="tbWrapper"> 
                        <ItemTemplate> 
                            <table cellpadding="2" cellspacing="0"> 
                                <tr> 
                                    <td> 
                                        <span>New Role</span> 
                                    </td> 
                                    <td> 
                                        <telerik:RadTextBox runat="server" ID="tbRole"> 
                                        </telerik:RadTextBox> 
                                    </td> 
                                </tr> 
                            </table> 
                        </ItemTemplate> 
                    </telerik:RadToolBarButton> 
                    <telerik:RadToolBarButton Text="Create" Value="new"></telerik:RadToolBarButton> 
                    <telerik:RadToolBarButton IsSeparator="true"></telerik:RadToolBarButton> 
                    <telerik:RadToolBarButton Text="Delete Role" Value="delete"></telerik:RadToolBarButton> 
                </Items> 
            </telerik:RadToolBar> 
 
            <telerik:RadGrid ID="existingRoles" runat="server"  AllowSorting="True" AutoGenerateColumns="False" GridLines="None" Height="100%" Width="100%" DataSourceID="dsRoles" ShowHeader="True"> 
                <ClientSettings> 
                    <Selecting AllowRowSelect="True" /> 
                    <Scrolling AllowScroll="True"  /> 
                </ClientSettings> 
                 
                <MasterTableView> 
                    <RowIndicatorColumn> 
                        <HeaderStyle Width="20px"></HeaderStyle> 
                    </RowIndicatorColumn> 
                    <ExpandCollapseColumn> 
                        <HeaderStyle Width="20px"></HeaderStyle> 
                    </ExpandCollapseColumn> 
                    <Columns> 
                        <telerik:GridBoundColumn HeaderText="Roles" UniqueName="RoleName" DataField="RoleName"> 
                        </telerik:GridBoundColumn> 
                        <telerik:GridBoundColumn HeaderText="Users in Role" UniqueName="UsersInRole" DataField="UsersInRole"> 
                        </telerik:GridBoundColumn> 
                    </Columns> 
                </MasterTableView> 
            </telerik:RadGrid> 
 
        </LeftPaneContentTemplate> 
    </emesh:PanelView> 
</asp:Content> 
 
 

By the way: if I take the contents of the LeftPaneContentTemplate and just slap that into the aspx markup then the problem disappears, but then I can't use templated usercontrols. I do not use ajax or any updatepanels for this app (yet). As of this moment I will start moving the functionality from this usercontrol into a masterpage instead. Maybe I will have better luck there.

Any ideas ?

Edit: RadControls Version: v.2010.1.415.40
Dimo
Telerik team
 answered on 27 May 2010
3 answers
331 views
I am having a pretty big issue with the calendar control for my web site (http://www.rankingshq.com/public/eventcalendar.aspx).

So basically a visitor will navigate to a month and then click on the "Go" button which is meant to refresh the tournament calendar and filter by the month they have navigated to.

The issue is that the user will not select a specific day on the calendar. They only care about the month they have navigated to. So when I try to access the current month in the code behind I am unable to get the month they have navigated to, it keeps on referencing the month which has a selected day in it...I have pasted the lines of code that perform the filter below.

if (chkIncludeCalendar.Checked) 
        { 
            //DateTime selectedMonthStart = new DateTime(eventCalendar.CalendarView.ViewStartDate.Year, eventCalendar.SelectedDate.Month, 1); 
            filter.AddWithAnd(TournamentFields.StartDate >= eventCalendar.CalendarView.ViewStartDate); 
            filter.AddWithAnd(TournamentFields.StartDate <= eventCalendar.CalendarView.ViewEndDate); 
        } 

So if I want to reference the month that has been navigated to, is this possible without the user being forced to selected a specific day in that month?

Regards,
Andrew Galea
Mira
Telerik team
 answered on 27 May 2010
1 answer
216 views
Hi

It is possible to add custom querystrings to Telerik.Web.UI.DialogHandler.aspx

Example

Page with the RadEditor :
MyPage.aspx?MODE=Update&PageGUID=%7b43C05F0F-F82A-4AE4-AF06-01CF306604F6%7d

when a dialog opens the querystring need to be appended to the ex LinkManager

../Telerik.Web.UI.DialogHandler.aspx?DialogName=LinkManager&Skin=Default&Title=Hyperlink%20Manager&doid=..&MODE=Update&PageGUID=%7b43C05F0F-F82A-4AE4-AF06-01CF306604F6%7d

In the LinkManager i have placed a custom button, which need these parameters

/Erik K
Rumen
Telerik team
 answered on 27 May 2010
1 answer
48 views
Hi,

I am updating some older projects that used the 2007 Radcontrols for .Net where we had developed a custom skin.
I am now attempting to move these settings into the new skin files. I have started with the Grid - which as it's one of the most complicated probably wasn't a good idea, but at least if I can sort this one the rest should be easy!

So I used your online tool to generate me a set of skin files for all the controls based on the Office2007 skin.

I am now trying to replicate the settings from our original custom skin into this, but many of the CSS classes don't seem to exist in the new skins, and I'm getting a bit lost.
Now I'm no novice with CSS, but if someone could point me in the right direction with how to translate these to the new format I would appreciate it.

My original custom skin for the Grid is below.

Thankyou.

Paul

/* r.a.d.grid XLogixBlue skin */ 
 
div.RadGrid_XLogixBlue 
{ 
    border: solid 1px #01055f; 
    font: normal 11px Arial, Verdana, Sans-serif; 
    text-align: left; 
    cursor: default; 
    background: white; 
} 
 
.RadGrid_XLogixBlue div 
{ 
  margin-right: 0 !important ; 
} 
 
.RadGrid_XLogixBlue a 
{  
    color: #000000; 
} 
 
.MasterTable_XLogixBlue 
{ 
    border-collapse: separate !important; 
    width: 100%; 
    color: #27413e; 
    font: normal 11px arial; 
} 
 
 
.MasterTable_XLogixBlue td, 
.MasterTable_XLogixBlue th 
{ 
    padding-left: 2px; 
    padding-right: 4px; 
} 
 
 
th.GridHeader_XLogixBlue, 
th.ResizeHeader_XLogixBlue 
{ 
    font: bold 12px Arial, Verdana, Sans-serif; 
    background: #9ebeec url('Img/GridHeaderBg.gif') repeat-x; 
    padding-left: 2px; /*more than items to compensate for item borders!*/ 
    padding-right: 4px; /*more than items to compensate for item borders!*/ 
    height: 19px; 
    color: #01055f; 
    border-bottom: solid 1px #9eb6ce; 
    border-right: solid 1px #9eb6ce; 
} 
 
.GridHeader_XLogixBlue a 
{ 
    color: #01055f; 
    font: bold 12px  Arial, Verdana, Sans-serif; 
    text-decoration: none; 
 
    padding-left: 2px; /*more than items to compensate for item borders!*/ 
    padding-right: 4px; /*more than items to compensate for item borders!*/ 
} 
 
.GridRow_XLogixBlue td 
{ 
    background: transparent; 
    line-height: 19px; 
    border-bottom: 1px solid #d0d7e5; 
    border-right: 1px solid #d0d7e5; 
} 
 
.GridAltRow_XLogixBlue td 
{ 
    background-color: #e1edff; 
    line-height: 19px; 
    border-bottom: 1px solid #d0d7e5; 
    border-right: 1px solid #d0d7e5; 
} 
 
.SelectedRow_XLogixBlue td, 
.ActiveRow_XLogixBlue td 
{ 
    background: #f1c15f url('Img/gridSelectedRowBg.gif') repeat-x !important; 
    line-height: 19px; 
    border-bottom: 1px solid #f29536; 
    border-right: 1px solid #f29536; 
    color: #000000; 
} 
 
.GridPager_XLogixBlue td 
{ 
    background: #9ab5db url('Img/GriPagerBg.gif') repeat-x; 
    height: 15px; 
    color: white; 
} 
 
.GridFooter_XLogixBlue td 
{ 
    background: #fbfbfb; 
    border: solid 1px #fbfbfb; 
    border-top: 1px solid #637783; 
    height: 19px; 
    color: #666; 
} 
 
.GridFooter_XLogixBlue td a 
{ 
    color: #666; 
} 
 
.GridPager_XLogixBlue td a 
{ 
    color: white; 
} 
 
.GridPager_XLogixBlue td a:hover, 
.GridFooter_XLogixBlue td a:hover 
{ 
    color: black; 
} 
 
 
tr.GroupHeader_XLogixBlue td 
{ 
    background: #e4ecf7; 
    height: 22px; 
} 
 
.GroupPanel_XLogixBlue 
{ 
    background: #9ebde5 url('Img/GridGroupPanelBg.gif') repeat-x; 
    width: 100%; 
    height: 23px; 
    border-bottom: solid 1px #688caf; 
    border-collapse: collapse; 
} 
 
.GroupPanelItems_XLogixBlue 
{ 
    background: white; 
    color: black; 
    border: solid 1px #325373; 
    whitewhite-space:  nowrap; 
    padding-left: 4px; 
    font-size: 11px; 
    height: 19px; 
} 
 
td.GridHeader_XLogixBlue input 
{ 
    width: auto; 
    float: left; 
    border: solid 1px #3b5a82; 
    background: #fafafa; 
    font: bold 11px Arial, Verdana, Sans-serif; 
    color: #989cb0; 
    height: 19px; 
    vertical-align:middle; 
} 
 
 

Dimo
Telerik team
 answered on 27 May 2010
1 answer
93 views
I have a very basic RadGrid implemented with 1 master table and 1 detail table connected via a <ParentTableRelation>. I have the grid set to HierarchyLoadMode="Client" and the load time on the page is somewhere in the neighborhood of 1 minute plus.

Am I doing something wrong? 500+ rows doesn't seem like a ton to me for a grid to handle. Are there settings I can alter to make this work?

Paging won't work for my situation either.
Dimo
Telerik team
 answered on 27 May 2010
1 answer
88 views
Hello Team,

Is there any option like agenda view in radscheduler.( asp.net version )
i want to show the events and events with recurrence rule events based on the dates.

ex: 

event                 startdate                     enddate                   descriptin 
05/23/2010
--------------         --------------                      ------------------         ----------------

05/24/2010
--------------         --------------                      ------------------         ----------------

05/26/2010 
--------------          --------------                     ------------------         ----------------
Peter
Telerik team
 answered on 27 May 2010
6 answers
212 views
Hello, guys.
I have menu item with template. There are several controls. Among them button.
How do I make this button to close menu item it's in and then process what is aasigned to it's server OnClick part?
Now what I experience is menu item stays on util I move mouse out of the content of the template.

With respect, Sergey.
Sergey Sugak
Top achievements
Rank 1
 answered on 27 May 2010
2 answers
129 views
i am reciving an error while creating connection
protected override DbConnection MySqlConnection()
    {
        base.ConnectionString = ConfigurationManager.ConnectionStrings["ConnectionStringApp"].ToString();
        DbConnection conn =  base.DbFactory.CreateConnection();
        conn.ConnectionString = ConnectionString;
        return conn;
    }
Peter
Telerik team
 answered on 27 May 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?