Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
90 views
Hi,
I am using Radeditor with EditorDropDown on toolbar. I need to bind data to the EditorDropDown client side or using web method,  if there any option for add  Clinet events for EditorDropDown.  I need a quick reply.






Thanks





Dhamodharan
Top achievements
Rank 1
 answered on 19 Feb 2013
1 answer
116 views
Hi All,
I'm having trouble with Form Validation when using the MetroTouch skin. I'm using a mix of RequiredFieldValidator/RequiredExpressionValidator controls for my RadTextBox's on a simple registration page. On all the other skins if a user enters text that doesn't meet the validation criteria the error is displayed immediately to the right hand side of the RadTextBox.

However, with the MetroTouch skin nothing is displayed until the RadButton is hit to postback. Also, when you fix something unless you click on another control the error does not go away.

I can reproduce this behaviour on all skins by simply adding this to the style sheet as well:

body

{

font-size:smaller;

}

 


I'll post my code here so you can test. You shouldn't need the style sheet as the functionality remains broken without it.
Register.aspx
<head runat="server">
    <title></title>
 
    <link rel="stylesheet" type="text/css" href="styles.css"/>
</head>
<body>
    <form id="form1" runat="server">  
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"></telerik:RadScriptManager>
    <telerik:RadSkinManager ID="RadSkinManager1" runat="server" Skin="Hay" ShowChooser="True"></telerik:RadSkinManager>
    <telerik:RadFormDecorator runat="server" ID="RadFormDecorator1" DecoratedControls="All"></telerik:RadFormDecorator>
 
    <div class="exampleWrapper">
        <telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="0" MultiPageID="RadMultiPage1" >
            <Tabs>
                <telerik:RadTab runat="server" Selected="True" Text="Registration" PageViewID="Registration">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="How it works" PageViewID="HowitWorks">
                </telerik:RadTab>
                <telerik:RadTab runat="server" Text="Prizes" PageViewID="Prizes">
                </telerik:RadTab>
            </Tabs>
        </telerik:RadTabStrip>
        <telerik:RadMultiPage ID="RadMultiPage1" runat="server" SelectedIndex="0" CssClass="multiPage">
 
            <telerik:RadPageView ID="Registration" runat="server">                          
                 <br />
                 <telerik:RadTextBox runat="server" ID="Email" Label="Email:" Width="400px" ></telerik:RadTextBox>
                 <asp:RegularExpressionValidator ID="emailValidator" ValidationGroup="Registration" runat="server" Display="Dynamic" ErrorMessage="Please, enter valid e-mail address." ValidationExpression="^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$" ControlToValidate="Email" CssClass="RegularExpressionValidator"></asp:RegularExpressionValidator>
                 <asp:RequiredFieldValidator ID="TextBoxRequiredFieldValidator" ValidationGroup="Registration" runat="server" Display="Dynamic" ControlToValidate="Email" ErrorMessage="Please enter a valid email address!" CssClass="RegularExpressionValidator"></asp:RequiredFieldValidator>
                 <br /><br />
                 <telerik:RadTextBox runat="server" ID="Password" Label="Password:" Width="400px" TextMode="Password"></telerik:RadTextBox>
                 <br /><br />
                 <telerik:RadTextBox runat="server" ID="ConfirmPassword" Label="Confirm Password:" Width="400px" TextMode="Password"></telerik:RadTextBox>
                 <asp:CompareValidator ID="valCompPassword" runat="server" ValidationGroup="Registration" ControlToValidate="ConfirmPassword" ControlToCompare="Password" Display="Dynamic" ErrorMessage="Please make sure your passwords match!" CssClass="RegularExpressionValidator" />
                 <br /><br />
                 <telerik:RadTextBox runat="server" ID="Firstname" Label="First name:" Width="400px"></telerik:RadTextBox>
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ValidationGroup="Registration" runat="server" Display="Dynamic" ControlToValidate="Firstname" ErrorMessage="Please enter your first name!" CssClass="RegularExpressionValidator"></asp:RequiredFieldValidator>
                 <br /><br />
                 <telerik:RadTextBox runat="server" ID="Surname" Label="Surname:" Width="400px"></telerik:RadTextBox>
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ValidationGroup="Registration" runat="server" Display="Dynamic" ControlToValidate="Surname" ErrorMessage="Please enter your surname!" CssClass="RegularExpressionValidator"></asp:RequiredFieldValidator>
                 <br /><br />
                 <telerik:RadMaskedTextBox runat="server" ID="PhoneNumber" Label="Mobile number:" Width="400px" Mask="####-###-###"></telerik:RadMaskedTextBox>
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ValidationGroup="Registration" runat="server" Display="Dynamic" ControlToValidate="PhoneNumber" ErrorMessage="Please enter your mobile number!" CssClass="RegularExpressionValidator"></asp:RequiredFieldValidator>
                 <asp:RegularExpressionValidator ID="RegularExpressionValidator1" ValidationGroup="Registration" runat="server" Display="Dynamic" ErrorMessage="Please enter valid mobile number." ValidationExpression="^[0]\d{3}-\d{3}-\d{3}$" ControlToValidate="PhoneNumber" CssClass="RegularExpressionValidator"></asp:RegularExpressionValidator>
                 <br /><br />
                 <telerik:RadMaskedTextBox runat="server" ID="AlternatePhoneNumber" Label="Alternate number:" Width="400px" Mask="####-###-###"></telerik:RadMaskedTextBox>                
                 <br /><br />
                 <telerik:RadTextBox runat="server" ID="Address" Label="Street Address:" Width="400px"></telerik:RadTextBox>
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator4" ValidationGroup="Registration" runat="server" Display="Dynamic" ControlToValidate="Address" ErrorMessage="Please enter your address!" CssClass="RegularExpressionValidator"></asp:RequiredFieldValidator>
                 <br /><br />
                 <telerik:RadTextBox runat="server" ID="City" Label="City/Suburb:" Width="400px"></telerik:RadTextBox>
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator5" ValidationGroup="Registration" runat="server" Display="Dynamic" ControlToValidate="City" ErrorMessage="Please enter your city/suburb!" CssClass="RegularExpressionValidator"></asp:RequiredFieldValidator>
                 <br /><br />
                 <telerik:RadTextBox runat="server" ID="Country" Label="Country:" Width="400px"></telerik:RadTextBox>
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator6" ValidationGroup="Registration" runat="server" Display="Dynamic" ControlToValidate="Country" ErrorMessage="Please enter your country!" CssClass="RegularExpressionValidator" InitialValue="Australia"></asp:RequiredFieldValidator>
                 <br /><br />
                 <telerik:RadTextBox runat="server" ID="PostCode" Label="Post Code:" Width="400px"></telerik:RadTextBox>
                 <asp:RequiredFieldValidator ID="RequiredFieldValidator7" ValidationGroup="Registration" runat="server" Display="Dynamic" ControlToValidate="PostCode" ErrorMessage="Please enter your post code!" CssClass="RegularExpressionValidator" InitialValue="Australia"></asp:RequiredFieldValidator>
                 <br /><br />
                 <telerik:RadButton ID="btnRegister" runat="server" Text="Register Now" ValidationGroup="Registration" ButtonType="StandardButton" BackColor="#F9F9F9"></telerik:RadButton>
                 <p></p>
            </telerik:RadPageView>
 
            <telerik:RadPageView ID="HowItWorks" runat="server" ForeColor="White">
                <p>HowItWorks</p>
            </telerik:RadPageView>
            <telerik:RadPageView ID="Prizes" runat="server">
                <p>Prizes</p>
            </telerik:RadPageView>
        </telerik:RadMultiPage>       
    </div>
    </form>
</body>
</html>
Vasil
Telerik team
 answered on 19 Feb 2013
3 answers
330 views
I have a page where I have a number of sitemap controls.  Each one may have a different background color.  For some of the sitemaps, I can use the default font, color, background hover color, etc.  For the others, I need to change different attributes.  I tried using the CssClass to override the color as well as the ForeColor attribute on the control and the nodes but alas, it did not work.  I know I can override the group css class, but that's not an option as far as I can see, it would override all of my sitemap controls.

Please advise if there is a solution to my issue.  I can supply a screenshot if that is helpful to understanding what I am trying to accomplish.
Kate
Telerik team
 answered on 19 Feb 2013
3 answers
114 views

I have  a GridTemplateColumn bind to “State” data field and the values are fixed or Enum type:

<telerik:GridTemplateColumn DataField="State" DataType="System.Byte" DefaultInsertValue="1"

    UniqueName="StateColumn" GroupByExpression="State Group By State">

    <EditItemTemplate>

        <telerik:RadComboBox ID="StateRadComboBox" runat="server"

SelectedValue='<%#Bind("State")%>'>

            <Items>

                <telerik:RadComboBoxItem runat="server" Text="Active" Value="1" />

                <telerik:RadComboBoxItem runat="server" Text="Inactive" Value="2" />

                <telerik:RadComboBoxItem runat="server" Text="Erased" Value="3" />

                <telerik:RadComboBoxItem runat="server" Text="Pendent" Value="4" />

            </Items>

        </telerik:RadComboBox>

    </EditItemTemplate>

    <ItemTemplate>

        <asp:Label ID="StateLabel" runat="server"

Text='<%# … a logic to get text based on numeric value '></asp:Label>

    </ItemTemplate>

</telerik:GridTemplateColumn>

When forms a group show the numerical value (State: 1, State: 2, State: 3 or State: 4). How can I show your description instead of the numerical value (State: Active, State: Inactive, State: Erased or State: Pendent)?

 

I have the same problem when use GridDropDownColumn and ObjectDataSource:

<telerik:GridDropDownColumn DataField="State" DataSourceID="StateObjectDataSource"

    ListTextField="TextValue" ListValueField="ByteValue" UniqueName="StateColumn"

    DataType="System.Byte">

</telerik:GridDropDownColumn>

Any help?
Kostadin
Telerik team
 answered on 19 Feb 2013
1 answer
64 views
Hi I have two date selectors using the RadDate control I would like to set the first date selector to be from today and not allow previous dates to be selected the second date control should only allow dates from the date selected in the first date box onward 

datebox 1 date = 21/02/2013
datebox 2 date => 21/02/2013 or later 
with 
<telerik:RadDatePicker ID="dpRequired1" runat="server" SelectedDate='<%# Bind("Required") %>'></telerik:RadDatePicker>

any suggestions thanks
Vasil
Telerik team
 answered on 19 Feb 2013
1 answer
130 views
Hi, when i press enter in the Textbox (input), I wan't the default button (in the Panel) to hit, so I jump in to the "SearchOnClick" method on enter press, but i can't get it to work. When i press enter nothing happens. How can i solve this?

<asp:Panel runat="server" ID="SearchPanel" DefaultButton="BtnSearch" CssClass="search-box">
    <telerik:RadAutoCompleteBox runat="server" ID="RadAutoCompleteBox2" AllowCustomEntry="true" TextSettings-SelectionMode="Single"
        OnClientDropDownOpened="GUI.AutoCompletedOpened" OnClientRequestFailed="GUI.SearchRequestFailed"
        OnClientTextChanged="GUI.SearchInputChanged" InputType="Text" Filter="StartsWith" Width="180px" DropDownWidth="300px" 
        CssClass="telerik-search"  EnableEmbeddedSkins="False" EnableEmbeddedBaseStylesheet="False" OnEntryAdded="Search_Entry">
        <WebServiceSettings Path="~/Views/Search/SearchResult.aspx" Method="GetSearchResult"></WebServiceSettings>
        <ClientDropDownItemTemplate>
                <div style="display: #= Attributes.DisplayMode #">
                    <a href="#= Attributes.ProductUrl #">
                        <span class="image-holder">
                            <img src="#= Attributes.ImageUrl # " alt=" #= Text # " width="50" height="50" />
                        </span>
                        #= Text # <br />
                        <span>#= Attributes.Identifier #</span>
                    </a>
                    #= Attributes.SearchUrl #
                </div>
        </ClientDropDownItemTemplate>
    </telerik:RadAutoCompleteBox>
    <asp:HiddenField runat="server" ID="hSearchValue" ClientIDMode="Static" />
    <asp:Button id="BtnSearch" runat="server" OnClick="SearchOnClick" CssClass="search"  />
</asp:Panel>
Kate
Telerik team
 answered on 19 Feb 2013
4 answers
186 views
hi

i wonder if you can help

i have set up a radgrid with the google style filtering as explained here google like filter

and i have combined it with drag and drop rows like here http://demos.telerik.com/aspnet-ajax/grid/examples/programming/draganddrop/defaultcs.aspx

fyi i have both grids in a RadAjaxPanel which seems ok as ive tried it with and without it.

the problem i am having is that when i apply a filter and then drag one of the filtered rows to the new grid the actual item that turns up in the

e.DraggedItems collection of RadGrid1_RowDrop(object sender, GridDragDropEventArgs e) event is the wrong one.

if you imagine the grid as the following items
a b
1 1
1 2
2 1
2 2

and i filter on b = 2 i only see
a b
1 2
2 2

and then i select 2 2 to drag and drop , the recieving grid actually gets 1 2 , this is because the source grid has lost its filter at some point during the drag and drop process.

i hope this makes sense , and i am hoping someone can help.

thanks alot in advance.

Peter

 
Peter
Top achievements
Rank 1
 answered on 19 Feb 2013
1 answer
172 views
Hi, I am using the Telerik 2011 Q2 in my application. This application is working fine on localhost but when i host this application on the Web server it generates the following error on frequent basis. Pls guide me as i get different Telerik errors on different time.

Message: Sys.InvalidOperationException: Type Telerik.Web.UI.Orientation has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.
Line: 2466
Char: 38
Code: 0
URI: http://db.nwtltd.net/ScriptResource.axd?d=c4Ftygkbe8gSekcXuHqgZVqH4P6_5qKuAWp1Lc-ZCEPyiypgS0_9IjAkiNnMQsSmK3g0--MxmfwNMpwkeUGw-ME77EUuNDaJYQUrOtEOYOJ7x41AhJxJRs-HgvvjSc5EKQm0A57VsM9ZH8Zhf2R6Yg2&t=3a1336b1

this is another error i get.

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; BTRS102569; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Timestamp: Thu, 14 Feb 2013 18:53:19 UTC

Message: Sys.InvalidOperationException: Type Telerik.Web.UI.Orientation has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.
Line: 2466
Char: 38
Code: 0
URI: http://db.nwtltd.net/ScriptResource.axd?d=4ewKTCJBo2j59UFab78bgCAYeUrQNTGTJPA2KwF54J-q38mz0nD-rkzsIvsRYcLQsCdcRmj42AMZbi7v2ayOt7HuGoIsdoa36Shfp231vwxxwqW0M_Fqf-zXRMdBeH1S6tWD6oufVvLbYZjtpY_WOw2&t=3a1336b1

Message: Sys.InvalidOperationException: Type Telerik.Web.UI.ScrollerOrientation has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.
Line: 2466
Char: 38
Code: 0
URI: http://db.nwtltd.net/ScriptResource.axd?d=4ewKTCJBo2j59UFab78bgCAYeUrQNTGTJPA2KwF54J-q38mz0nD-rkzsIvsRYcLQsCdcRmj42AMZbi7v2ayOt7HuGoIsdoa36Shfp231vwxxwqW0M_Fqf-zXRMdBeH1S6tWD6oufVvLbYZjtpY_WOw2&t=3a1336b1

Message: Sys.InvalidOperationException: Type Telerik.Web.UI.AttributeCollection has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.
Line: 1439
Char: 42
Code: 0
URI: http://db.nwtltd.net/ScriptResource.axd?d=4ewKTCJBo2j59UFab78bgCAYeUrQNTGTJPA2KwF54J-q38mz0nD-rkzsIvsRYcLQsCdcRmj42AMZbi7v2ayOt7HuGoIsdoa36Shfp231vwxxwqW0M_Fqf-zXRMdBeH1S6tWD6oufVvLbYZjtpY_WOw2&t=3a1336b1

Message: Sys.InvalidOperationException: Type Telerik.Web.UI.RadTab has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.
Line: 1439
Char: 42
Code: 0
URI: http://db.nwtltd.net/ScriptResource.axd?d=4ewKTCJBo2j59UFab78bgCAYeUrQNTGTJPA2KwF54J-q38mz0nD-rkzsIvsRYcLQsCdcRmj42AMZbi7v2ayOt7HuGoIsdoa36Shfp231vwxxwqW0M_Fqf-zXRMdBeH1S6tWD6oufVvLbYZjtpY_WOw2&t=3a1336b1

Message: Sys.InvalidOperationException: Type Telerik.Web.UI.RadPageViewCollection has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.
Line: 1439
Char: 42
Code: 0
URI: http://db.nwtltd.net/ScriptResource.axd?d=4ewKTCJBo2j59UFab78bgCAYeUrQNTGTJPA2KwF54J-q38mz0nD-rkzsIvsRYcLQsCdcRmj42AMZbi7v2ayOt7HuGoIsdoa36Shfp231vwxxwqW0M_Fqf-zXRMdBeH1S6tWD6oufVvLbYZjtpY_WOw2&t=3a1336b1

Message: Sys.InvalidOperationException: Type Telerik.Web.RadDatePickerPopupDirection has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.
Line: 2466
Char: 38
Code: 0
URI: http://db.nwtltd.net/ScriptResource.axd?d=4ewKTCJBo2j59UFab78bgCAYeUrQNTGTJPA2KwF54J-q38mz0nD-rkzsIvsRYcLQsCdcRmj42AMZbi7v2ayOt7HuGoIsdoa36Shfp231vwxxwqW0M_Fqf-zXRMdBeH1S6tWD6oufVvLbYZjtpY_WOw2&t=3a1336b1

Message: Sys.InvalidOperationException: Type Telerik.Web.UI.RadDatePicker has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.
Line: 1439
Char: 42
Code: 0
URI: http://db.nwtltd.net/ScriptResource.axd?d=4ewKTCJBo2j59UFab78bgCAYeUrQNTGTJPA2KwF54J-q38mz0nD-rkzsIvsRYcLQsCdcRmj42AMZbi7v2ayOt7HuGoIsdoa36Shfp231vwxxwqW0M_Fqf-zXRMdBeH1S6tWD6oufVvLbYZjtpY_WOw2&t=3a1336b1

Message: Sys.InvalidOperationException: Type Telerik.Web.UI.PasswordStrengthChecker has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.
Line: 1439
Char: 42
Code: 0
URI: http://db.nwtltd.net/ScriptResource.axd?d=4ewKTCJBo2j59UFab78bgCAYeUrQNTGTJPA2KwF54J-q38mz0nD-rkzsIvsRYcLQsCdcRmj42AMZbi7v2ayOt7HuGoIsdoa36Shfp231vwxxwqW0M_Fqf-zXRMdBeH1S6tWD6oufVvLbYZjtpY_WOw2&t=3a1336b1

Message: Sys.InvalidOperationException: Type Telerik.Web.UI.DateParsing.DateEvaluator has already been registered. The type may be defined multiple times or the script file that defines it may have already been loaded. A possible cause is a change of settings during a partial update.
Line: 1439
Char: 42
Code: 0
URI: http://db.nwtltd.net/ScriptResource.axd?d=4ewKTCJBo2j59UFab78bgCAYeUrQNTGTJPA2KwF54J-q38mz0nD-rkzsIvsRYcLQsCdcRmj42AMZbi7v2ayOt7HuGoIsdoa36Shfp231vwxxwqW0M_Fqf-zXRMdBeH1S6tWD6oufVvLbYZjtpY_WOw2&t=3a1336b1

I did not get these error on localhost.  

Antonio Stoilkov
Telerik team
 answered on 19 Feb 2013
3 answers
210 views
Hi,

I am trying to implement enhanced filtering as described on this page http://www.telerik.com/help/aspnet-ajax/grid-basic-filtering.html and in this video http://www.telerikwatch.com/2008/09/telerik-watch-minute-enhancing-radgrid.html.

The idea is to allow the user to enter filter expressions like >=27, *ed and <>100 then hit Enter to execute the filter.  My problem is with numeric fields which don't allow non numeric characters to be entered in the filter text box so you can't enter <>= characters.  

I am using version 2011.3.1115.35

I have created a very simple page that demonstrates the problem. (see below) The page has a grid that uses the Products table in the Northwind sql database as a datasource.  Any advice would begreatly appreciated.

Thanks 

Terry

Here is the code for an example page that demonstrates the problem:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Filters1.aspx.vb" Inherits="FramesAndCasesWebApp.Filters1" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title>FilterOnEnter</title>
 
    <script type="text/javascript">
        var tableView = null;
        var cancelFilterMenu = false;
 
        function filterOnEnter(sender, e, gridId, columnName) {
 
            //Only filter on Enter (check keyCode)
            if (e.keyCode == 13) {
 
                //Disable filter menu from showing [BROWSER BUG FIX]
                cancelFilterMenu = true;
 
                if (tableView == null)
                    tableView = $find(gridId).get_masterTableView();
 
                //Try to auto set the filter function
                var filter = Telerik.Web.UI.GridFilterFunction.Contains;  //Default
 
                var query = sender.value;
                if (query.endsWith("*") && query.startsWith("*")) {
                    filter = Telerik.Web.UI.GridFilterFunction.Contains;
                    query = query.substr(1, query.length - 2);
                }
                else if (query.startsWith("*")) {
                    filter = Telerik.Web.UI.GridFilterFunction.EndsWith;
                    query = query.substr(1, query.length - 1);
                }
                else if (query.endsWith("*")) {
                    filter = Telerik.Web.UI.GridFilterFunction.StartsWith;
                    query = query.substr(0, query.length - 1);
                }
                else if (query.startsWith("=")) {
                    filter = Telerik.Web.UI.GridFilterFunction.EqualTo;
                    query = query.substr(1, query.length - 1);
                }
                else if (query.startsWith("<>")) {
                    filter = Telerik.Web.UI.GridFilterFunction.NotEqualTo;
                    query = query.substr(2, query.length - 2);
                }
                else if (query.startsWith("<")) {
                    filter = Telerik.Web.UI.GridFilterFunction.LessThan;
                    query = query.substr(1, query.length - 1);
                }
                else if (query.startsWith("<=")) {
                    filter = Telerik.Web.UI.GridFilterFunction.LessThanOrEqualTo;
                    query = query.substr(2, query.length - 2);
                }
                else if (query.startsWith(">")) {
                    filter = Telerik.Web.UI.GridFilterFunction.GreaterThan;
                    query = query.substr(1, query.length - 1);
                }
                else if (query.startsWith(">=")) {
                    filter = Telerik.Web.UI.GridFilterFunction.GreaterThanOrEqualTo;
                    query = query.substr(2, query.length - 2);
                }
 
                var column = tableView.getColumnByUniqueName(columnName);
 
                //Execute filter
                tableView.filter(columnName, query, filter);
            }
        }
 
        //Handle browser inconsistencies that cause
        //the filter menu to be displayed on enter key press
        function filterMenuShowing(menu, args) {
            if (cancelFilterMenu)
                args.set_cancel(true);
 
            cancelFilterMenu = false;
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
     
        <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
        </telerik:RadScriptManager>
        <telerik:RadGrid ID="RadGrid1" runat="server"
            AllowFilteringByColumn="true"
            AllowPaging="true"
            AllowSorting="true"
            DataSourceID="SqlDataSource1" EnableLinqExpressions="False">
            <MasterTableView AutoGenerateColumns="True" DataKeyNames="ProductID"
                DataSourceID="SqlDataSource1"/>
 
            <FilterMenu EnableImageSprites="False" OnClientShowing="filterMenuShowing">
            </FilterMenu>
        </telerik:RadGrid>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="Data Source=SQL\SQL2008;Initial Catalog=Northwind;Integrated Security=True"
            ProviderName="System.Data.SqlClient"
            SelectCommand="SELECT Products.* FROM Products"></asp:SqlDataSource>
     
    </div>
    </form>
</body>
</html>

and here is the code behind

Imports Telerik.Web.UI
 
Public Class Filters1
    Inherits System.Web.UI.Page
 
    Private Sub RadGrid1_ItemCreated(sender As Object, e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
        If TypeOf e.Item Is GridFilteringItem Then
 
            Dim filterItem As GridFilteringItem = e.Item
 
            ' Add client-side event handlers for the filter textbox in each data column
            For Each col As GridColumn In RadGrid1.MasterTableView.RenderColumns
 
                ' Ignore non-data columns
                If col.UniqueName = "ExpandColumn" Or col.UniqueName = "RowIndicator" Then
                    Continue For
                End If
 
                ' Get the column name
                Dim columnName As String = col.UniqueName
 
                ' If this column filter has a textbox ...
                Debug.Print(columnName & ": " & TypeName(filterItem(columnName).Controls(0)))
                If TypeOf filterItem(columnName).Controls(0) Is TextBox Then
                    ' Get a reference to the filter textbox for this column
                    Dim textBox As TextBox = filterItem(columnName).Controls(0)
 
                    If textBox IsNot Nothing Then
                        ' Add the event handler
                        textBox.Attributes.Add("onkeypress", String.Format("filterOnEnter(this, event, ""{0}"", ""{1}"");", RadGrid1.ClientID, columnName))
                    End If
                End If
            Next
        End If
    End Sub
End Class


Kostadin
Telerik team
 answered on 19 Feb 2013
1 answer
211 views
Hi,

We have discovered a really nasty thing with the RadListBox. In my sample below, the CPU will hit 100% and memory will go up to about 2GB (happens in both IE10 and Firefox, Chrome seems unaffected) for about 10 seconds. Will often crash the browser since we hit the 2GB limit if other tabs are open...

This only occurs when the listbox is located inside an iframe, in my example I did this using a RadWindow, but a normal IFrame would do the same...

Here is the main page:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="window.aspx.vb" Inherits="TestaTredjepartWeb.window" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="s" runat="server">
    </asp:ScriptManager>
    <div>
        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
            <Windows>
                <telerik:RadWindow ID="RadWindow1" runat="server" VisibleOnPageLoad="true" AutoSize="true" NavigateUrl="listbox.aspx">
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>
    </div>
    </form>
</body>
</html>

And here is the content page:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="listbox.aspx.vb" Inherits="TestaTredjepartWeb.listbox" %>
 
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="s" runat="server">
        </asp:ScriptManager>
        <div>
            <asp:UpdatePanel ID="up" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <telerik:RadListBox ID="rlb" runat="server" Width="330px" AllowReorder="true" AutoPostBackOnReorder="true" EnableDragAndDrop="true">
                        <Items>
                            <telerik:RadListBoxItem Text="aaa" />
                            <telerik:RadListBoxItem Text="bbb" />
                            <telerik:RadListBoxItem Text="ccc" />
                            <telerik:RadListBoxItem Text="ddd" />
                            <telerik:RadListBoxItem Text="eee" />
                            <telerik:RadListBoxItem Text="fff" />
                            <telerik:RadListBoxItem Text="ggg" />
                            <telerik:RadListBoxItem Text="hhh" />
                        </Items>
                    </telerik:RadListBox>
                </ContentTemplate>
            </asp:UpdatePanel>
        </div>
    </form>
</body>
</html>

The listbox need to have autopostbackonreorder and be located in an updatepanel.
To get this behavior:
1. Move one item up or down by drag and drop.
2. Move the cursor outside the radwindow (the mousout of the window will trigger this behavior)

When profiling the script, it is the following function that is the problem:
RadListBox._onDocumentMouseOut

Regards
Caesar
Bozhidar
Telerik team
 answered on 19 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?