Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
139 views
Telerik support kindly provided me with this client side code for supporting PageUp and PageDown key presses
for paging after the Grid has focus.  It works for the MasterTableView level.

Perhaps one of the forum members could make a server side equivalent function in C# or VB.

  <%--Handle PageUp and PageDown key presses --%>  
  <script type="text/javascript">  
    var shouldFocus = false;  
    function gridCreated(sender,args) {  
      $addHandler(sender.get_element(),"keydown",Function.createDelegate(sender,keydownHandler));  
      if(shouldFocus){  
        sender.get_element().focus();  
        shouldFocus = false;}  
      }  
      function keydownHandler(args) {  
        if(args.keyCode==33 && this.get_masterTableView().get_currentPageIndex() > 0) {                      
          this.get_masterTableView().page("prev");  
          shouldFocus = true;}  
        else if(args.keyCode==34 ) {  
          this.get_masterTableView().page("next");  
          shouldFocus = true;}                  
      }  
  </script>  
 
 
<telerik: RadGrid ID = RadGrid1 ETC.>        
      <ClientSettings AllowKeyboardNavigation="true">  
        <Selecting AllowRowSelect="true" /> 
        <KeyboardNavigationSettings EnableKeyboardShortcuts="true" AllowActiveRowCycle="true" /> 
        <ClientEvents OnGridCreated="gridCreated" /> 
      </ClientSettings> 
Other Grid code
</telerik:RadGrid>  
Kevin Mason
Top achievements
Rank 1
 asked on 11 Sep 2009
1 answer
150 views
HI Everyone,

At the moment I have a split button on my toolbar with two options:

Format HTML
Format Text

By default the Format HTML is selected and displayed on the toolbar.
When a user selects Format Text a postback occurs and the Toolbar split button is updated to display the Format Text image.
Is there a way to stop a postback from occuring when the user clicks the split button?, I only want a postback to occur when the user makes a selection from the dropdown list.

I know that this is how the DropDown button operates but I can't use it as it does not update the Image displayed on the toolbar when a user makes a selection.

Any help would be appreciated

Antony


Yana
Telerik team
 answered on 11 Sep 2009
1 answer
175 views
Hi,

I'm using telerik controls in a project and I have a problem with circular reference in a master pages.
I have a master page (we can call "father master page") using some objects of telerik, and also I have another master page (we can call "son master page") that use telerik controls too. The "son master page" inherit "father master page" and it's in a paste (on that structure). The pages I have on that paste are using the "son master page".

So, when I try deploy the website, the visual studio indicate a problem with circular reference in a "son master page" at the first line, on MasterPageFile attribute. If I remove this attribute, I can deploy the website.

I realized a search about this subject and tried something like as you can see below:

- to remove @Register tag of master pages and pages and add the references in web.config by <controls> element;
- to put true for batch attribute of <compilation> element;
- to remove the keyword Register from the tags on master pages and pages.

I will put the html code of "father master page" and "son master page":
"FATHER MASTER PAGE":
<%@ Master Language="C#" AutoEventWireup="true" CodeFile="GENTE.master.cs" Inherits="GENTE" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="uc1" TagName="HeadTag"  Src="~/_includes/HeadTag.ascx" %>

<!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 id="Head1" runat="server">
    <title> .:: GENTE - Gestão Eletrônica Normalizada de Terceiros e Empregados ::. </title>
    
    <!-- Includes -->
    <uc1:HeadTag ID="HeadTag1" runat="server" />     
        
    <asp:ContentPlaceHolder id="head" runat="server">
    </asp:ContentPlaceHolder>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
            <Scripts>
                <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" />
            </Scripts>
        </telerik:RadScriptManager>
        
        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" Skin="Telerik" DecoratedControls="All" />
        
        <%--dsd--%>
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
          
          <!-- Cabeçalho -->
            <tr>
                <td  align="left">
                    Menu Superior -
                    <a href="/GENTEv1/Protegidos/Empresas/Default.aspx">Empresas</a>&nbsp;&nbsp;
                    <a href="/GENTEv1/Protegidos/Pessoas/Default.aspx">Pessoas</a>&nbsp;&nbsp;
                    <a href="/GENTEv1/Protegidos/Administracao/Default.aspx">Administração</a>&nbsp;&nbsp;
                </td>
                <td  align="right">
                    Patrocinador: <asp:Label ID="lblPatrocinador" runat="server" Text=""></asp:Label>
                    / Prestador: <asp:Label ID="lblPrestador" runat="server" Text=""></asp:Label>
                    &nbsp;&nbsp;&nbsp;&nbsp;<a href="<%= Page.ResolveUrl("~/SelectPatPrest.aspx") %>" >Selecionar</a>&nbsp;&nbsp;
                </td>
            </tr>
            <tr>
                <td><img src="space.jpg" width="4" height="2" /></td>
            </tr>
          <!-- Cabeçalho -->
          
          <tr>
            <td colspan="2">
                
                <!-- -->
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td id="HeadBar" colspan="4" height="5"></td>
                    </tr>
                    <tr>
                        <td width="7"></td>
                        <td width="250" height="500"  valign="top" class="BordaFundo" id="Lateralbar">
                            <div class="Collapse"></div>
                            <table width="250" align="center" cellpadding="0" cellspacing="0">
                                <tr>
                                    <td height="10"><img src="../_images/space.jpg" width="3" height="1"></td>
                                </tr>
                                <tr align="left">
                                    <td width="10"></td>
                                    <td height="30" valign="middle">
                                            
                                        <!-- INICIO - Lateral -->
                                        <asp:ContentPlaceHolder id="cphMenu" runat="server">
                                        
                                        </asp:ContentPlaceHolder>
                                        <!-- FIM - Lateral -->
                            
                                    </td>
                                    <td width="10">&nbsp;</td>
                                </tr>
                            </table>
                        
                        </td>
                        <td width="3"><img src="../_images/space.jpg" width="3" height="2"></td>
                        <td valign="top" align="left" class="Borda">
                        
                            <!-- Menu - Titulo -->
                            
                                            
                            <!-- INICIO - Conteúdo -->
                            <asp:ContentPlaceHolder id="cphConteudo" runat="server">
                            
                            </asp:ContentPlaceHolder>
                            <!-- FIM - Conteúdo -->
                            <br />
                        </td>
                    </tr>
                </table>
                <!-- -->
                
            </td>
          </tr>
        </table>
        <%--dfdsf--%>
        
    </div>
    </form>
</body>
</html>

"SON MASTER PAGE":
<%@ Master Language="C#" MasterPageFile="~/GENTE.master" AutoEventWireup="true" CodeFile="GENTE_Emp.master.cs" Inherits="Protegidos_Empresas_GENTE_Emp" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="cphMenu" Runat="Server">
    
    <asp:ContentPlaceHolder id="cphSubMenu" runat="server">
    
        <telerik:RadPanelBar id="RadPanelBar1" runat="server" style="float: left" skin="Telerik">
        </telerik:RadPanelBar>
    
    </asp:ContentPlaceHolder>

</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="cphConteudo" Runat="Server">

        <asp:ContentPlaceHolder id="cphSubConteudo" runat="server">
        
        </asp:ContentPlaceHolder>

</asp:Content>

Anyone can help me to solve this problem?







Carlos Eduardo Nogueira
Top achievements
Rank 1
 answered on 11 Sep 2009
1 answer
118 views
If I use the following syntax in a .js file to point to a page that contains a regular asp.net scriptmanager I get intellisense for asp.net ajax:

/// <reference path="ScriptManagerForIntellisense.aspx" /> 

If I use the same syntax to point to a page that contains a telerik ScriptManager I don't, even though methods such as $get and $addHandler will work on pages that has such a scriptmanager. Is there any solution to this, right now I have created a separate aspx-file that I reference from my js-file to get the intellisense...
Atanas Korchev
Telerik team
 answered on 11 Sep 2009
2 answers
358 views
Hi. I'm trying to clear filter values for all the columns in a grid view doing something like in the code below:

var col = masterTable.get_columns();

for (i = col.length - 1; i >= 0; i--) {
masterTable.filter(col[i].get_uniqueName(), "", 0);
};


but nothing happens. Only if I fill the first column's filter and other are empty, the above code snippet function.
How else could I clear all filters in a Grid on client-side?
Thanks and best regards, Frank.
 
Princy
Top achievements
Rank 2
 answered on 11 Sep 2009
5 answers
293 views
Is there a way to use a sprite for the button images and get the hover affect using another part of the sprite?  I am currently setting the ImageUrl and HoveredImageUrl properties but with 10 buttons that causes 20 images to download.  I would prefer to get that down to 1 image if possible.

Thanks.
Kamen Bundev
Telerik team
 answered on 11 Sep 2009
2 answers
86 views
Hi,
I have applied Basic filtering in the grid but it is showing error message

'Telerik.Web.UI.ParseException: Expression expected' when out of ajax panel and
when inside ajax panel , it shows the error in javascript error.

here is my grid , note that i have grids in my other screens which are working fine in filtering.

 <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" >  
      
    <telerik:RadGrid ID="GrdUsers" runat="server" AutoGenerateColumns="False" GridLines="Vertical" 
        AllowFilteringByColumn="True" AllowPaging="True" OnItemDataBound="GrdUsers_ItemDataBound" 
         OnNeedDataSource="GrdUsers_NeedDataSource" 
         Width="100%" >  
        <PagerStyle Mode="Advanced" Position="TopAndBottom"></PagerStyle>  
        <HeaderContextMenu>  
            <CollapseAnimation Type="OutQuint"></CollapseAnimation>  
        </HeaderContextMenu>  
        <MasterTableView  AllowFilteringByColumn="True" DataKeyNames="EmailAddress">  
            <Columns>  
                <telerik:GridTemplateColumn HeaderText="Email" UniqueName="column1" AllowFiltering="true" 
                    FilterControlWidth="135px">  
                    <ItemTemplate>  
                        <asp:hyperlink id="hlnkEmailAddress" runat="server" text='<%# DataBinder.Eval(Container, "DataItem.EmailAddress") %>'  
                            navigateurl='<%# DataBinder.Eval(Container, "DataItem.EmailAddress", "Details.aspx?em={0}") %>'  
                            enableviewstate="False" target="_blank">  
                        </asp:hyperlink>  
                    </ItemTemplate>  
                    <ItemStyle CssClass="smallText8" HorizontalAlign="Left" />  
                </telerik:GridTemplateColumn>  
                <telerik:GridTemplateColumn FilterControlWidth="55px" HeaderText="User Name" UniqueName="column2" 
                    AllowFiltering="true">  
                    <ItemTemplate>  
                        <asp:label id="lblUserName" runat="server" text='<%# Eval("UserName").ToString() %>'>  
                        </asp:label>  
                    </ItemTemplate>  
                    <ItemStyle CssClass="smallText8" HorizontalAlign="Left" />  
                </telerik:GridTemplateColumn>  
                <telerik:GridTemplateColumn FilterControlWidth="55px" HeaderText="Package" UniqueName="column3" 
                    AllowFiltering="true">  
                    <ItemTemplate>  
                        <a href="#">  
                            <asp:label id="lblPackage" runat="server" text='<%# GetPackage(Eval("EmailAddress").ToString()) %>'  
                                tooltip="Click to view package detail"></asp:label>  
                        </a>  
                    </ItemTemplate>  
                    <ItemStyle CssClass="smallText8" HorizontalAlign="Left" />  
                </telerik:GridTemplateColumn>  
                <telerik:GridTemplateColumn HeaderText="Registration Date" UniqueName="column4" AllowFiltering="true">  
                    <ItemTemplate>  
                        <asp:label id="lblRegistrationDate" runat="server" text='<%# Eval("RegistrationDate") %>'>  
                        </asp:label>  
                    </ItemTemplate>  
                    <ItemStyle CssClass="smallText8" />  
                </telerik:GridTemplateColumn>  
                <telerik:GridTemplateColumn FilterControlWidth="55px" HeaderText="Sig Count / Limit" 
                    UniqueName="column5" AllowFiltering="true">  
                    <ItemTemplate>  
                        <asp:label id="lblSigLimit" runat="server"><%# Eval("SignatureUsed") %> / <%# GetSum(Convert.ToInt64(Eval("SignatureUsed")), Convert.ToInt64(Eval("RemainSignatureLeft")))%> </asp:label>  
                    </ItemTemplate>  
                    <ItemStyle CssClass="smallText8" />  
                </telerik:GridTemplateColumn>  
                <telerik:GridTemplateColumn FilterControlWidth="55px" HeaderText="Account Size / Limit" 
                    UniqueName="column6" AllowFiltering="true">  
                    <ItemTemplate>  
                        <asp:label id="lblAccountLimit" runat="server"><%# Convert.ToInt64(Eval("SpaceLimitUsed"))/1024%> / <%# GetSum(Convert.ToInt64(Eval("SpaceLimitUsed")), Convert.ToInt64(Eval("RemainBalanceLeft")))/1024%> </asp:label>  
                    </ItemTemplate>  
                    <ItemStyle CssClass="smallText8" />  
                </telerik:GridTemplateColumn>  
                <telerik:GridTemplateColumn HeaderText="Enterprise / Admin" UniqueName="column7" 
                    AllowFiltering="true" FilterControlWidth="165px">  
                    <ItemTemplate>  
                        <asp:label id="lblEnt" runat="server"></asp:label>  
                        <asp:label id="lblParentUserEmailAddress" runat="server" text='<%# Eval("ParentUserEmailAddress")%> '>  
                        </asp:label>  
                    </ItemTemplate>  
                    <ItemStyle CssClass="smallText8" HorizontalAlign="Left" />  
                </telerik:GridTemplateColumn>  
                <telerik:GridTemplateColumn FilterControlWidth="35px" HeaderText="Status" UniqueName="column8" 
                    AllowFiltering="true" Visible="false">  
                    <ItemTemplate>  
                        <asp:label id="lblStatus" runat="server" text='<%# Eval("status")%>'></asp:label>  
                        <asp:label id="lblUsertypeId" runat="server" text='<%# Eval("UserTypeId")%>'></asp:label>  
                    </ItemTemplate>  
                    <ItemStyle CssClass="smallText8" />  
                </telerik:GridTemplateColumn>  
            </Columns>  
             <RowIndicatorColumn>  
                                <HeaderStyle Width="20px"></HeaderStyle>  
                            </RowIndicatorColumn>  
                            <ExpandCollapseColumn>  
                                <HeaderStyle Width="20px"></HeaderStyle>  
                            </ExpandCollapseColumn>  
        </MasterTableView>  
        <FilterMenu>  
            <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>  
        </FilterMenu>  
    </telerik:RadGrid>  
    </telerik:RadAjaxPanel> 
Here is my c# code.
        if (!IsPostBack)  
        {  
      //      lstUsers = objUserMgr.GetAllUsers();  
       //     lblTotal.Text = "Total Users : " + lstUsers.Count;           
            try { }  
            catch (Exception ex)  
            {  
                Response.Write(ex.Message.ToString());  
                  
            }  
 
 
        }  
    }  
      
    protected void GrdUsers_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e)  
    {  
           UserManager objUserMgr = new UserManager();  
           GrdUsers.DataSource = objUserMgr.GetAllUsers();  
                    
    } 

Please reply me asap, why this error is coming on fiter some data in the grid.
Regards
Muhammad Shoaib
Yavor
Telerik team
 answered on 11 Sep 2009
1 answer
112 views
WE found a wierd behaviour, with RadComboBox , tried many different thing, and are lost, need some guidence.
<telerik:RadComboBox ID="ddlDriverLastName" Runat="server" Skin="Office2007" DropDownWidth="470" Width="133"   
                                                 MarkFirstMatch="true" AllowCustomText="true" SelectOnTab="true" AutoPostBack="false"   
                                                 ShowWhileLoading="true" ToolTip="Select Driver" Sort="None" 
                                                 HighlightTemplatedItems="true" EnableItemCaching="false" Filter="Contains" 
                                                 OnClientSelectedIndexChanged="ChangeInputColor">  
 

we have multicolumn dropdown with Last Names, when i bind the dropdown i set DriverID as value, and Last Name as text.

In case when we bind list that contains identical last names, we get this wierd behaviour, when first item in the list with the same last name is selected and page is reposted, the SelectedValue that is being passed by the control is that of the previously selected item with the same Last Name.
In other words, we can never get the first Last name item in the list, to be ever recognized as the one being selected.
Does anyone esle have this issue?
Veselin Vasilev
Telerik team
 answered on 11 Sep 2009
3 answers
222 views
Would it be possible to disable the listboxes without hiding the buttons that make it possible to swap items between the lists? (in other words, some sort of "ReadOnly"-mode, without changing the look of the controls)

<telerik:RadListBox ID="DualList" runat="server" AllowTransfer="true" AllowTransferOnDoubleClick="false" 
DataSourceID="EmployeesDataSource" DataTextField="Name" DataValueField="EmployeeID" TransferToID="TransferToList" 
Width="230px" Height="200px" Culture="Dutch (Netherlands)" EnableDragAndDrop="false" SelectionMode="Multiple" 
OnDataBound="DualList_DataBound" Enabled="false">  
</telerik:RadListBox> 
<telerik:RadListBox ID="TransferToList" runat="server" DataSourceID="PreferredEngineersDataSource" DataTextField="Name" 
DataValueField="EmployeeID" Width="230px" Height="200px" AllowTransfer="false" AllowTransferOnDoubleClick="false" 
Culture="Dutch (Netherlands)" EnableDragAndDrop="false" SelectionMode="Multiple" OnDataBound="TransferToList_DataBound" 
Enabled="false">  
</telerik:RadListBox> 

http://bart.nimio.info/images/fora/listbox.JPG
Genady Sergeev
Telerik team
 answered on 11 Sep 2009
5 answers
478 views
Hi guys:

I have created a RadGrid to connect to an OLAP datasource.  That grid has three columns bounded to the following column names returned from that datasource:

[Periodo].[Periodo].[Mes].[MEMBER_CAPTION]
[Tipo Afiliado].[TipoAfiliado].[Tipo Afiliado].[MEMBER_CAPTION]
[Measures].[Total trabajadores afiliados]

When i want to click over one of the columns in the grid, i receive the following error:

Sys.WebForms.PageRequestManagerServerErrorException: Cannot find column Periodo].[Periodo].[Mes].[MEMBER_CAPTION.

Note that in the error description the column name given lacks the "[" character at the begining and the "]" character at the end.

If i configure the RadGrid to query a SQL Server database, the ordering works fine. I only have troubles with OLAP datasources.









Sebastian
Telerik team
 answered on 11 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?