Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
65 views
I'm seeing some weird display behavior using a ListView with a data pager on IE 9.  I've already told the clients they need to upgrade their browsers but not all of them will :)

Anyway, I've attached a PNG of what I see (unfortunately not ALL the time).  The IE 9 F12 dev tools are horrible so I can't tell from those if a style sheet isn't loading correctly or what.

This is a scenario where I have a RadWindow which contains a RadTabStrip.  The tabs' content in the strip are dynamically loaded via ASCX controls.

I'm curious if others have seen this behavior with IE 9, and if they were able to eliminate it.  

ASPX:
<telerik:radlistview id="lstViewEmployment" runat="server" datakeynames="Id" datasourceid="dsEmployments" allowpaging="True" allowcustompaging="True"
    allownaturalsort="True" pagesize="1" skin="Windows7" onitemcreated="lstViewEmployment_ItemCreated" oniteminserted="lstViewEmployment_ItemInserted"
    onitemupdated="lstViewEmployment_ItemUpdated" onitemcanceling="lstViewEmployment_ItemCanceling" onitemediting="lstViewEmployment_ItemEditing"
    onitemdatabound="lstViewEmployment_ItemDataBound">
    <LayoutTemplate>
        <div class="RadListView RadListViewFloated RadListView_Windows7">
            <div class="rlvFloated">
                <div runat="server" id="itemPlaceholder"></div>
            </div>
            <telerik:RadDataPager runat="server" SEOPagingQueryPageKey="" Skin="Windows7" ID="RadDataPager1" PageSize="1" Width="900">
                <Fields>
                    <telerik:RadDataPagerButtonField FieldType="FirstPrev" />
                    <telerik:RadDataPagerButtonField FieldType="NextLast" />
                    <telerik:RadDataPagerGoToPageField CurrentPageText="Employment Record" EnableSubmitButton="false" HorizontalPosition="RightFloat" />
                </Fields>
            </telerik:RadDataPager>
            <div style="display: none">
                <telerik:RadCalendar runat="server" ID="rlvSharedCalendar" Skin='<%#Container.Skin %>' RangeMinDate='<%#new DateTime(1900, 1, 1) %>' />
            </div>
            <div style="display: none">
                <telerik:RadTimeView runat="server" ID="rlvSharedTimeView" Skin='<%# Container.Skin %>' />
            </div>
        </div>
    </LayoutTemplate>
    <ItemTemplate>
        <div class="rlvI">
            <telerik:RadButton ID="btnEdit" runat="server" Text="Edit" ToolTip="Edit" CommandName="Edit" CausesValidation="false"></telerik:RadButton>
            <telerik:RadButton ID="btnDelete" runat="server" Text="Delete" ToolTip="Delete" CommandName="Delete" CausesValidation="false"></telerik:RadButton>
            <div class="formLine">
                <div class="formField66">
                    Name of Employer:
                    <asp:Label ID="lblEmployerName" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                </div>
            </div>
            <div class="formLine">
                <div class="formField66">
                    Employment Address:
                    <asp:Label ID="lblEmployerAddress" runat="server" Text='<%# Eval("Address") %>'></asp:Label>
                </div>
            </div>
            <div class="formLine">
                <div class="formField33">
                    City, State:
                    <asp:Label ID="lblCity" runat="server" Text='<%# Eval("City") %>'></asp:Label>,
                    <asp:Label ID="lblState" runat="server" Text='<%# Eval("State") %>'></asp:Label>
                </div>
                <div class="formField33">
                    County:
                    <asp:Label ID="lblCounty" runat="server" Text='<%# Eval("County") %>'></asp:Label>
                </div>
                <div class="formField33">
                    Zip:
                    <asp:Label ID="lblZip" runat="server" Text='<%# Eval("ZipCode") %>'></asp:Label>
                </div>
            </div>
            <div class="formLine">
                <div class="formField33">
                    Phone Number:
                    <asp:Label ID="lblPhone" runat="server" Text='<%# SorBll.Util.FormatPhoneNumber(Eval("Phone")) %>'></asp:Label>
                </div>
                <div class="formField66">
                    Employment Begin Date:
                    <asp:Label ID="lblStartDate" runat="server" Text='<%# SorBll.Util.FormatNullableDate(Eval("BeginDate")) %>'></asp:Label>
                </div>
            </div>
            <div class="formLine">
                <div class="formField66">
                    Occupation:
                    <asp:Label ID="lblOccupation" runat="server" Text='<%# Eval("Occupation") %>'></asp:Label>
                </div>
            </div>
        </div>
    </ItemTemplate>
    <AlternatingItemTemplate>
        <div class="rlvA">
            <telerik:RadButton ID="btnEdit" runat="server" Text="Edit" ToolTip="Edit" CommandName="Edit" CausesValidation="false"></telerik:RadButton>
            <telerik:RadButton ID="btnDelete" runat="server" Text="Delete" ToolTip="Delete" CommandName="Delete" CausesValidation="false"></telerik:RadButton>
            <div class="formLine">
                <div class="formField66">
                    Name of Employer:
                    <asp:Label ID="lblEmployerName" runat="server" Text='<%# Eval("Name") %>'></asp:Label>
                </div>
            </div>
            <div class="formLine">
                <div class="formField66">
                    Employment Address:
                    <asp:Label ID="lblEmployerAddress" runat="server" Text='<%# Eval("Address") %>'></asp:Label>
                </div>
            </div>
            <div class="formLine">
                <div class="formField33">
                    City, State:
                    <asp:Label ID="lblCity" runat="server" Text='<%# Eval("City") %>'></asp:Label>,
                    <asp:Label ID="lblState" runat="server" Text='<%# Eval("State") %>'></asp:Label>
                </div>
                <div class="formField33">
                    County:
                    <asp:Label ID="lblCounty" runat="server" Text='<%# Eval("County") %>'></asp:Label>
                </div>
                <div class="formField33">
                    Zip:
                    <asp:Label ID="lblZip" runat="server" Text='<%# Eval("ZipCode") %>'></asp:Label>
                </div>
            </div>
            <div class="formLine">
                <div class="formField33">
                    Phone Number:
                    <asp:Label ID="lblPhone" runat="server" Text='<%# SorBll.Util.FormatPhoneNumber(Eval("Phone")) %>'></asp:Label>
                </div>
                <div class="formField66">
                    Employment Begin Date:
                    <asp:Label ID="lblStartDate" runat="server" Text='<%# SorBll.Util.FormatNullableDate(Eval("BeginDate")) %>'></asp:Label>
                </div>
            </div>
            <div class="formLine">
                <div class="formField66">
                    Occupation:
                    <asp:Label ID="lblOccupation" runat="server" Text='<%# Eval("Occupation") %>'></asp:Label>
                </div>
            </div>
        </div>
    </AlternatingItemTemplate>
    <EditItemTemplate>
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
            <script type="text/javascript">
                function CloseCityPopUpAndRefreshEmploymentEdit() {
                    var combo = $find("<%= lstViewEmployment.EditItems[0].FindControl("cboEmploymentCity").ClientID %>");
                    combo.requestItems("", false);
                }
 
                function onEmpCityClientFocus(sender, args) {
                    var box = $find("<%= lstViewEmployment.EditItems[0].FindControl("cboEmploymentCity").ClientID %>");
                    box.showDropDown();
                }
            </script>
        </telerik:RadScriptBlock>
        <div class="rlvIEdit">
            <div class="formLine">
                <div class="formField66">
                    Name of Employer:
                    <telerik:RadTextBox ID="txtEmployerName" runat="server" MaxLength="50" Width="400" Text='<%# Bind("Name") %>' TabIndex="1">
                        <ClientEvents OnBlur="ForceUpperCase" />
                    </telerik:RadTextBox>
                </div>
            </div>
            <div class="formLine">
                <div class="formField66">
                    Employment Address:
                    <telerik:RadTextBox ID="txtEmployerAddress" runat="server" MaxLength="50" Width="400" Text='<%# Bind("Address") %>' TabIndex="2">
                        <ClientEvents OnBlur="ForceUpperCase" />
                    </telerik:RadTextBox>
                </div>
            </div>
            <div class="formLine">
                <div class="formField33">
                    City, State:
                    <asp:LinkButton ID="lnkAddEmploymentCityEdit" runat="server" OnClick="lnkAddEmploymentCityEdit_Click">ADD CITY</asp:LinkButton>
                    |
                    <asp:LinkButton ID="lnkClearCity" runat="server" OnClick="lnkClearCity_Click">CLEAR CITY</asp:LinkButton>
                    <br />
                    <telerik:RadComboBox ID="cboEmploymentCity" runat="server" EmptyMessage="Type city ..." DataValueField="IDNumber" TabIndex="3" OnItemsRequested="cboEmploymentCity_ItemsRequested"
                                            OnClientFocus="onEmpCityClientFocus" DataTextField="CITY" MarkFirstMatch="true" DropDownAutoWidth="Enabled" DataSourceID="dsCities" EnableLoadOnDemand="False">
                        <ItemTemplate>
                            <%# Eval("CITY") %>, <%# Eval("State") %>, <%# Eval("ZIPCODE1") %> <%# Eval("COUNTY") %>
                        </ItemTemplate>
                    </telerik:RadComboBox>
                    ,
                    <telerik:RadTextBox ID="txtEmploymentState" runat="server" MaxLength="2" Width="45px" Enabled="false" Text='<%# Bind("State") %>'></telerik:RadTextBox>
                </div>
                <div class="formField33">
                    County:<br />
                    <telerik:RadTextBox ID="txtEmploymentCounty" runat="server" MaxLength="50" Enabled="false" Text='<%# Bind("County") %>'></telerik:RadTextBox>
                </div>
                <div class="formField33">
                    Zip:<br />
                    <telerik:RadMaskedTextBox ID="txtEmploymentZip" runat="server" Mask="#####" Enabled="false" Text='<%# Bind("ZipCode") %>'></telerik:RadMaskedTextBox>
                </div>
            </div>
            <div class="formLine">
                <div class="formField33">
                    Phone Number:<br />
                    <telerik:RadMaskedTextBox ID="txtEmploymentPhoneNumber" runat="server" Mask="(###) ###-####" Columns="15" Text='<%# Bind("Phone") %>' TabIndex="4"></telerik:RadMaskedTextBox>
                </div>
                <div class="formField66">
                    Employment Begin Date:
                    <telerik:RadDatePicker ID="txtEmploymentStartDate" runat="server" MinDate="1/1/1900" SelectedDate='<%# Bind("BeginDate") %>' TabIndex="5"></telerik:RadDatePicker>
                </div>
            </div>
            <div class="formLine">
                <div class="formField66">
                    Occupation:
                    <telerik:RadTextBox ID="txtEmploymentOccupation" runat="server" MaxLength="255" Width="400" Text='<%# Bind("Occupation") %>' TabIndex="6">
                        <ClientEvents OnBlur="ForceUpperCase" />
                    </telerik:RadTextBox>
                </div>
            </div>
            <telerik:RadButton ID="btnUpdate" runat="server" Text="Update" ToolTip="Update" CommandName="Update"></telerik:RadButton>
            <telerik:RadButton ID="btnCancel" runat="server" Text="Cancel" ToolTip="Cancel" CommandName="Cancel" CausesValidation="false"></telerik:RadButton>
        </div>
    </EditItemTemplate>
    <InsertItemTemplate>
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
            <script type="text/javascript">
                function CloseCityPopUpAndRefreshEmploymentInsert() {
                    var combo = $find("<%= lstViewEmployment.InsertItem.FindControl("cboEmploymentCity").ClientID %>");
                    combo.requestItems("", false);
                }
 
                function onEmpCityClientFocus(sender, args) {
                    var box = $find("<%= lstViewEmployment.InsertItem.FindControl("cboEmploymentCity").ClientID %>");
                    box.showDropDown();
                }
            </script>
        </telerik:RadScriptBlock>
        <div class="rlvIEdit">
            <div class="formLine">
                <div class="formField66">
                    Name of Employer:
                    <telerik:RadTextBox ID="txtEmployerName" runat="server" MaxLength="50" Width="400" Text='<%# Bind("Name") %>' TabIndex="1">
                        <ClientEvents OnBlur="ForceUpperCase" />
                    </telerik:RadTextBox>
                </div>
            </div>
            <div class="formLine">
                <div class="formField66">
                    Employment Address:
                    <telerik:RadTextBox ID="txtEmployerAddress" runat="server" MaxLength="50" Width="400" Text='<%# Bind("Address") %>' TabIndex="2">
                        <ClientEvents OnBlur="ForceUpperCase" />
                    </telerik:RadTextBox>
                </div>
            </div>
            <div class="formLine">
                <div class="formField33">
                    City, State:
                    <asp:LinkButton ID="lnkAddEmploymentCityInsert" runat="server" OnClick="lnkAddEmploymentCityInsert_Click">ADD CITY</asp:LinkButton>
                    |
                    <asp:LinkButton ID="lnkClearCity" runat="server" OnClick="lnkClearCity_Click">CLEAR CITY</asp:LinkButton>
                    <br />
                    <telerik:RadComboBox ID="cboEmploymentCity" runat="server" EmptyMessage="Type city ..." DataSourceID="dsCities" DataValueField="IDNumber"
                        DataTextField="CITY" MarkFirstMatch="true" DropDownAutoWidth="Enabled" TabIndex="3" OnItemsRequested="cboEmploymentCity_ItemsRequested" OnClientFocus="onEmpCityClientFocus">
                        <ItemTemplate>
                            <%# Eval("CITY") %>, <%# Eval("State") %>, <%# Eval("ZIPCODE1") %> <%# Eval("COUNTY") %>
                        </ItemTemplate>
                    </telerik:RadComboBox>
                    ,
                    <telerik:RadTextBox ID="txtEmploymentState" runat="server" MaxLength="2" Width="45px" Enabled="false" Text='<%# Bind("State") %>'></telerik:RadTextBox>
                </div>
                <div class="formField33">
                    County:<br />
                    <telerik:RadTextBox ID="txtEmploymentCounty" runat="server" MaxLength="50" Enabled="false" Text='<%# Bind("County") %>'></telerik:RadTextBox>
                </div>
                <div class="formField33">
                    Zip:<br />
                    <telerik:RadMaskedTextBox ID="txtEmploymentZip" runat="server" Mask="#####" Enabled="false" Text='<%# Bind("ZipCode") %>'></telerik:RadMaskedTextBox>
                </div>
            </div>
            <div class="formLine">
                <div class="formField33">
                    Phone Number:<br />
                    <telerik:RadMaskedTextBox ID="txtEmploymentPhoneNumber" runat="server" Mask="(###) ###-####" Columns="15" Text='<%# Bind("Phone") %>' TabIndex="4"></telerik:RadMaskedTextBox>
                </div>
                <div class="formField66">
                    Employment Begin Date:
                    <telerik:RadDatePicker ID="txtEmploymentStartDate" runat="server" MinDate="1/1/1900" SelectedDate='<%# Bind("BeginDate") %>' TabIndex="5"></telerik:RadDatePicker>
                </div>
            </div>
            <div class="formLine">
                <div class="formField66">
                    Occupation:
                    <telerik:RadTextBox ID="txtEmploymentOccupation" runat="server" MaxLength="255" Width="400" Text='<%# Bind("Occupation") %>' TabIndex="6">
                        <ClientEvents OnBlur="ForceUpperCase" />
                    </telerik:RadTextBox>
                </div>
            </div>
            <telerik:RadButton ID="btnInsert" runat="server" Text="Add Employment Record" ToolTip="Add" CommandName="PerformInsert"></telerik:RadButton>
            <telerik:RadButton ID="btnCancel" runat="server" Text="Cancel" ToolTip="Cancel" CommandName="Cancel" CausesValidation="false"></telerik:RadButton>
        </div>
    </InsertItemTemplate>
    <EmptyDataTemplate>
        <div class="RadListView RadListView_Windows7">
            <div class="rlvEmpty">There are no items to be displayed.</div>
        </div>
    </EmptyDataTemplate>       
</telerik:radlistview>

Datasource:
<asp:LinqDataSource runat="server" EntityTypeName="" ID="dsEmployments" ContextTypeName="SorDal.Sor2PendingDbDataContext"
    EnableDelete="True" EnableInsert="True" EnableUpdate="True" OrderBy="Id" TableName="PendingOffenderEmployers" Where="OffenderId == @OffenderId"
    OnInserting="dsEmployments_Inserting" OnUpdating="dsEmployments_Updating">
    <WhereParameters>
        <asp:SessionParameter SessionField="CurrentPendingOffenderId" Name="OffenderId" Type="Int32"></asp:SessionParameter>
    </WhereParameters>
    <InsertParameters>
        <asp:SessionParameter SessionField="CurrentPendingOffenderId" Name="OffenderId" Type="Int32"></asp:SessionParameter>
    </InsertParameters>
</asp:LinqDataSource>


C#:
protected void lstViewEmployment_ItemCreated(object sender, RadListViewItemEventArgs e)
{
    RadComboBox cbo = e.Item.FindControl("cboEmploymentCity") as RadComboBox;
    if (cbo != null)
    {
        cbo.AutoPostBack = true;
        cbo.SelectedIndexChanged += cboEmploymentCity_SelectedIndexChanged;
    }
}
protected void lstViewEmployment_ItemInserted(object sender, RadListViewInsertedEventArgs e)
{
    btnAddEmploymentRecord.Enabled = true;
}
 
protected void lstViewEmployment_ItemUpdated(object sender, RadListViewUpdatedEventArgs e)
{
    btnAddEmploymentRecord.Enabled = true;
}
 
protected void lstViewEmployment_ItemCanceling(object sender, RadListViewCommandEventArgs e)
{
    btnAddEmploymentRecord.Enabled = true;
}
 
protected void lstViewEmployment_ItemEditing(object sender, RadListViewCommandEventArgs e)
{
    btnAddEmploymentRecord.Enabled = false;
}
 
protected void lstViewEmployment_ItemDataBound(object sender, RadListViewItemEventArgs e)
{
    if (e.Item is RadListViewEditableItem)
    {
        RadListViewEditableItem item = e.Item as RadListViewEditableItem;
        RadComboBox cboEmploymentCity = item.FindControl("cboEmploymentCity") as RadComboBox;
        PendingOffenderEmployer emp = item.DataItem as PendingOffenderEmployer;
        cboEmploymentCity.Text = emp.City;
    }
}
 
protected void lstViewEmployment_PageIndexChanged(object sender, RadListViewPageChangedEventArgs e)
{
    DisableUtilityWindows();
}

Konstantin Dikov
Telerik team
 answered on 10 Feb 2015
3 answers
166 views
Hello All,
I need to rename the existing filter menu options (EqualTo, Contains, IsNull etc), by column data types. Is there an option to that in telerik?

Please let me know, thanks!
Eyup
Telerik team
 answered on 10 Feb 2015
1 answer
94 views
Hello,

I'm creating a web application for a reservation system where i'm using the RadScheduler control in my page for managing all the reservations where the advanced form is being used to handle the insert and edit functionality.

Upon client request, I implemented the TimeLine view with resources being displayed at the left side of the control. Here a serious problem showed up where I was unable to create a new reservation in the timeline view by dragging the mouse over the time slots for selecting a specified period of time to be bind to the advanced form. When a double click is done the advanced form is called and the time shown in it is the duration of the slot (15 minutes).

I need to know how to implement this functionality in the time line view (time slot selection before insert like in Day view).

Thanks in advance.
Regards.
Hristo Valyavicharski
Telerik team
 answered on 10 Feb 2015
0 answers
92 views
Since Q1 2015 Beta/Q1 2015 the default dimensions of the SVG rendering element in RadHtmlChart have changed from pixels to percentages (i.e., width="100%" and height="100%").

The actual RadHtmlChart dimensions are now defined by its wrapper and default height of 400px.

The change may affect the appearance of a chart that has no dimensions defined which is placed inside a div element with inline-block style and no width.

Telerik Admin
Top achievements
Rank 1
Iron
 asked on 10 Feb 2015
27 answers
958 views
I have a SQL Server table with over 2 million rows.  It's well optimized and I have a stored procedure that, given the start of a word, can return 10 matching records very quickly.  However, I'm trying to see if this can be used via the RadAutoCompleteBox. 

My test page is not loading (no error but it's taking forever to load) and I am assuming this is because it's trying to look at ALL 2 million records?

<telerik:RadAutoCompleteBox runat="server" ID="RadAutoCompleteBox1" InputType="Text"
                DataSourceID="SqlDataSource1" DataTextField="Title" Filter="StartsWith">
</telerik:RadAutoCompleteBox>
 
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
   ConnectionString="<%$ ConnectionStrings:MyConnectionString%>"
   SelectCommand="SELECT Title FROM dbo.AllKeywords ORDER BY Title">
</asp:SqlDataSource>

Am I doing something wrong?  Does anyone have experience in using RadAutoCompleteBox on very large data sets?
Mohammed BENKHDAR
Top achievements
Rank 1
 answered on 10 Feb 2015
1 answer
104 views
I have other project ,It can get "FilterExpression"

code below
=========================================================================================================================
<%@ Page Language="C#" ValidateRequest="false" AutoEventWireup="true" CodeBehind="AdventureWork.aspx.cs" Inherits="Simple.RadGridSortAndPaging.Views.AdventureWork" EnableViewState="false" ViewStateMode="Disabled" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">

<head runat="server">
    <title></title>
</head>
<body>
    <script type="text/javascript">
        function onRequestStart(sender, args) {
            if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToWordButton") >= 0 ||
                    args.get_eventTarget().indexOf("ExportToCsvButton") >= 0) {
                args.set_enableAjax(false);
            }
        }
    </script>
    <form id="form1" runat="server">
        <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" />
                <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
            </Scripts>
        </telerik:RadScriptManager>

        <%--<telerik:RadSkinManager ID="QsfSkinManager" runat="server" ShowChooser="true" />--%>
        <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" />
        <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel" LoadingPanelID="RadAjaxLoadingPanel1">
        </telerik:RadAjaxPanel>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <%--<ClientEvents OnRequestStart="onRequestStart" />--%>
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGrid1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <%--<telerik:RadFormDecorator runat="server" DecorationZoneID="demo" EnableRoundedCorners="false" DecoratedControls="All" />--%>
        <asp:ValidationSummary runat="server" ID="ValidationSummary1" />
        <div>
            <div>
                <telerik:RadGrid ID="RadGrid1" runat="server" Culture="zh-TW" Width="990px"
                    AllowCustomPaging="True"
                    AllowPaging="True"
                    PageSize="12"
                    AllowSorting="True"
                    ShowFooter="True"
                    AllowAutomaticDeletes="True"
                    AllowAutomaticInserts="True"
                    AllowAutomaticUpdates="True"
                    AutoGenerateColumns="False"
                    AllowMultiRowSelection="True"
                    AllowMultiRowEdit="true"
                    OnNeedDataSource="RadGrid1_NeedDataSource">

                    <ExportSettings ExportOnlyData="True" OpenInNewWindow="True" IgnorePaging="False">
                        <Excel Format="ExcelML"></Excel>
                    </ExportSettings>
                    <ClientSettings EnableRowHoverStyle="true">
                        <Selecting AllowRowSelect="True"></Selecting>
                    </ClientSettings>
                    <EditItemStyle Wrap="False" />
                    <FilterMenu EnableImageSprites="False"></FilterMenu>
                    <MasterTableView CommandItemDisplay="Top" GridLines="none"
                        DataKeyNames="OrderID"
                        AllowFilteringByColumn="True"
                        AllowSorting="True"
                        ShowFooter="False"
                        ItemType="Simple.RadGridSortAndPaging.Models.Orders">
                        <CommandItemSettings ExportToPdfText="Export to PDF" ShowAddNewRecordButton="False" ShowRefreshButton="False" ShowExportToExcelButton="true"></CommandItemSettings>

                        <Columns>
                            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Edit" Text="Edit" HeaderText="" UniqueName="Edit" />
                            <telerik:GridTemplateColumn HeaderText="BusinessEntityID" UniqueName="BusinessEntityID"
                                DataField="BusinessEntityID" SortExpression="BusinessEntityID">
                                <ItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text="<%# BindItem.OrderID %>"></asp:Label>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:Label ID="Label2" runat="server" Text="<%# BindItem.OrderID %>"></asp:Label>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>

                            <telerik:GridBoundColumn DataField="CustomerID" AutoPostBackOnFilter="True" FilterControlAltText="Filter CustomerID column" HeaderText="CustomerID" SortExpression="CustomerID" UniqueName="CustomerID">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text=""></ModelErrorMessage>
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="CustomerID" HeaderText="CustomerID11" SortExpression="CustomerID" UniqueName="CustomerID11"
                                CurrentFilterFunction="Contains" AutoPostBackOnFilter="True" ShowFilterIcon="true" FilterDelay="2600" FilterControlAltText="Filter CustomerID column">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text=""></ModelErrorMessage>
                                </ColumnValidationSettings>
                                <HeaderStyle HorizontalAlign="Center" Width="70px"></HeaderStyle>
                                <ItemStyle HorizontalAlign="Center" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="EmployeeID" FilterControlAltText="Filter EmployeeID column" HeaderText="EmployeeID" SortExpression="EmployeeID" UniqueName="EmployeeID">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text=""></ModelErrorMessage>
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="OrderDate" DataFormatString="{0:yyyy/MM/dd}" FilterControlAltText="Filter FirstName column" HeaderText="OrderDate" SortExpression="OrderDate" UniqueName="OrderDate">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text=""></ModelErrorMessage>
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="RequiredDate" DataFormatString="{0:yyyy/MM/dd}" FilterControlAltText="Filter RequiredDate column" HeaderText="MiddleName" SortExpression="RequiredDate" UniqueName="RequiredDate">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text=""></ModelErrorMessage>
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ShippedDate" DataFormatString="{0:yyyy/MM/dd}" FilterControlAltText="Filter LastName column" HeaderText="ShippedDate" SortExpression="ShippedDate" UniqueName="ShippedDate">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text=""></ModelErrorMessage>
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ShipVia" FilterControlAltText="Filter ShipVia column" HeaderText="ShipVia" SortExpression="ShipVia" UniqueName="ShipVia">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text=""></ModelErrorMessage>
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Freight" FilterControlAltText="Filter Freight column" HeaderText="Freight" SortExpression="Freight" UniqueName="Freight">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text=""></ModelErrorMessage>
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ShipName" FilterControlAltText="Filter ShipName column" HeaderText="ShipName" SortExpression="AdditionalContactInfo" UniqueName="ShipName">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text=""></ModelErrorMessage>
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ShipAddress" FilterControlAltText="Filter ShipAddress column" HeaderText="ShipAddress" SortExpression="ShipAddress" UniqueName="ShipAddress">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text=""></ModelErrorMessage>
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ShipCity" FilterControlAltText="Filter ShipCity column" HeaderText="ShipCity" SortExpression="ShipCity" UniqueName="ShipCity">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text=""></ModelErrorMessage>
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ShipRegion" FilterControlAltText="Filter ShipRegion column" HeaderText="ShipRegion" SortExpression="ShipRegion" UniqueName="ShipRegion">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text=""></ModelErrorMessage>
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="ShipCountry" FilterControlAltText="Filter ShipCountry column" HeaderText="ShipCountry" SortExpression="ShipCountry" UniqueName="ShipCountry">
                                <ColumnValidationSettings>
                                    <ModelErrorMessage Text=""></ModelErrorMessage>
                                </ColumnValidationSettings>
                            </telerik:GridBoundColumn>

                            <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Text="Delete" HeaderText="" UniqueName="Delete" />
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
            </div>
        </div>
        <br />
    </form>
</body>
</html>

=========================================================================================================================

C# Code
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
    if (!e.IsFromDetailTable)
    {
        var radGrid = (RadGrid)sender;

        var where1 = RadGridHelper.GetFilterExpression(radGrid.MasterTableView, null);
        var orderBy1 = RadGridHelper.GetOrderBy(radGrid.MasterTableView);
        var filter = radGrid.MasterTableView.FilterExpression;
        var orderBy = radGrid.MasterTableView.SortExpressions.GetSortString();

        var skip = radGrid.MasterTableView.CurrentPageIndex * radGrid.MasterTableView.PageSize;
        var take = radGrid.MasterTableView.PageSize;
        var totalRowCount = 0;
        radGrid.DataSource = GetAllOrders(skip, take, orderBy, filter, out totalRowCount);

        if (e.RebindReason == GridRebindReason.InitialLoad
             || e.RebindReason == GridRebindReason.ExplicitRebind)
        {
            radGrid.VirtualItemCount = totalRowCount;
        }
    }
}
public IEnumerable<Orders> GetAllOrders(
    int startRowIndex, int maximumRows, string sortExpression, string filterExpression, out int totalRowCount)
{
    if (string.IsNullOrWhiteSpace(sortExpression))
    {
        sortExpression = "OrderID ASC";
    }
    NorthwindDbContext dbContext = new NorthwindDbContext();

    var query = dbContext.Orders.OrderBy(sortExpression);

    if (!string.IsNullOrWhiteSpace(filterExpression))
    {
        query = query.Where(filterExpression);
    }

    totalRowCount = query.Count();

    query = query.Skip(startRowIndex);
    query = query.Take(maximumRows);

    return query.AsNoTracking().ToList();
}
Maria Ilieva
Telerik team
 answered on 10 Feb 2015
12 answers
278 views
I am using .wav files to generate the audio. It works in all the popular browsers except Safari. I am using the latest version of safri and also have quicktime installed too but still it didn't work. Have anyone faced this issue earlier .  Can anyone help with this issue.
Slav
Telerik team
 answered on 10 Feb 2015
1 answer
182 views
Dear Friends,
I created RadGrid with Enabled = "false". The grid got disabled.

Now i want to enable Grid cells when Edit Button click through Javascript.

I tried Like this

<ClientEvents OnBatchEditOpened="OnBatchEditOpened" />

//Enable/Disable Grid cell
function OnBatchEditOpened(sender, args)
{   
    if(EventID=="EDIT") 
        args.get_cell().getElementsByTagName("input")[0].disabled = false;
}

but the grid and cells are not enabling.

How to Enable ? Or what is wrong in this code.

Regards,
Rajendran
Maria Ilieva
Telerik team
 answered on 10 Feb 2015
10 answers
1.8K+ views
Hi,
I am trying to set the width of a GridTemplateColumn from a stylesheet rather than in the aspx page but it doesnt seem to work.  For instance the below code works to set the GridTemplateColumn width to 30 pixels.


<telerik:GridTemplateColumn AllowFiltering="false" UniqueName="DeleteRecord" HeaderStyle-Width="30px" >
    <ItemTemplate>
        <asp:ImageButton ID="btnDeleteRecord" runat="server" ImageUrl="../../Common/Images/Icons/small/delete.gif" CommandName="DeleteRecord" CssClass="CursorHand"/>
    </ItemTemplate>
</telerik:GridTemplateColumn>

However, The following code does not:
<telerik:GridTemplateColumn AllowFiltering="false" UniqueName="DeleteRecord" HeaderStyle-CssClass="commandHeader" >
    <ItemTemplate>
        <asp:ImageButton ID="btnDeleteRecord" runat="server" ImageUrl="../../Common/Images/Icons/small/delete.gif" CommandName="DeleteRecord" CssClass="CursorHand"/>
    </ItemTemplate>
</telerik:GridTemplateColumn>

.commandHeader
{
    width:30px;
}


Is there a way around this problem? Or am i doing something wrong?

Thanks,
Michael
Pavlina
Telerik team
 answered on 10 Feb 2015
5 answers
534 views
Hi
I have a radgrid in which , I want to set the back color of a cell in every row of  one column . I need to compare the value of the cell in this column in every row of the grid and if its not the same value as the previous row cell value , I had to set different color . For example the column name is datayear , and the first row of the grid has 2013 as the second row has 2012 and so on in that cell . some time the same cell value will be repeated . so I have to compare each row cell value and set the color of the cell how can I achieve this asp.net.vb
thanks for your help
Rajeswari raman
​
Eyup
Telerik team
 answered on 10 Feb 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?