Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
79 views
 please remove...
Vit
Top achievements
Rank 1
 asked on 23 Apr 2013
1 answer
208 views
I'm using Export to excel feature in my Telerik Radgrid, for this i'm using UseAllDataFields="true" 
<MasterTableView CommandItemDisplay="Top" UseAllDataFields="true">  and working fine,
also the paging is working fine with internal filtering  but the panel which shows ' 10 items in 1 Pages' after filtering i have only 1 record in Radgrid but the panel again shows  ' 10 items in 1 Pages'
also if i change UseAllDataFields="false" then it works fine but then the export to excel feature stops.
Enclosed is my project. Can you help me?

Dll Telerik Version: 2012.3.1308.40

Thanks
Gianluca

Project
File: RadGrid.aspx
----------------------------------------------------------------------------------------------------------------------------------------------
ASPX
----------------------------------------------------------------------------------------------------------------------------------------------
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadGrid.aspx.cs" Inherits="TestTelerikAspxGrid.Web.RadGrid" %>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN">
 
<html>
<head runat="server">
    <title>RadGrid</title>
    <script language="javascript" type="text/javascript">
        function RequestStart(sender, args) {
            if (args.get_eventTarget().indexOf("ExportToExcelButton") >= 0) {
                args.set_enableAjax(false);
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGridFootballPlayers">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadAjaxPanel"></telerik:AjaxUpdatedControl>
                        <telerik:AjaxUpdatedControl ControlID="RadGridFootballPlayers"></telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>
            </AjaxSettings>
        </telerik:RadAjaxManager>
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default">
        </telerik:RadAjaxLoadingPanel>
        <telerik:RadAjaxPanel runat="server" ID="RadAjaxPanel" LoadingPanelID="RadAjaxLoadingPanel1"
            ClientEvents-OnRequestStart="RequestStart">
            <br/>
            <input id="Button1" type="button" value="button" runat="server" />
            <br/>
            <telerik:RadGrid ID="RadGridFootballPlayers" runat="server" Skin="WebBlue"
                    PageSize="10" GridLines="None" AutoGenerateColumns="false"
                    AllowSorting="True" AllowPaging="True" AllowMultiRowSelection="True"
                    AllowFilteringByColumn="True"
                    EnableLinqExpressions="false">
                    <ExportSettings ExportOnlyData="true" IgnorePaging="true" OpenInNewWindow="true">
                        <Excel Format="ExcelML"></Excel>
                    </ExportSettings>
                    <groupingsettings casesensitive="false"></groupingsettings>
                    <MasterTableView TableLayout="Fixed" CommandItemDisplay="Top" UseAllDataFields="true">
                    <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false"></CommandItemSettings>
                    <Columns>
                        <telerik:GridBoundColumn UniqueName="Id" DataField="Id" HeaderText="Id" SortExpression="Id" AutoPostBackOnFilter="true" ShowFilterIcon="false" CurrentFilterFunction="Contains">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="Name" DataField="Name" HeaderText="Name" SortExpression="Name" AutoPostBackOnFilter="true" ShowFilterIcon="false" CurrentFilterFunction="Contains">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="Surname" DataField="Surname" HeaderText="Surname" SortExpression="Surname" AutoPostBackOnFilter="true" ShowFilterIcon="false" CurrentFilterFunction="Contains">
                        </telerik:GridBoundColumn>
                        <telerik:GridDateTimeColumn UniqueName="FirstSubscriptionDate" DataField="BirthDate" DataType="System.DateTime" DataFormatString="{0:dd/MM/yyyy HH:mm:ss}" HeaderText="First Sub Date" SortExpression="FirstSubscriptionDate" HeaderStyle-Width="150" AutoPostBackOnFilter="true" EnableTimeIndependentFiltering="true" AllowFiltering="false">
                        </telerik:GridDateTimeColumn>
                        <telerik:GridBoundColumn UniqueName="FootballClub" DataField="FootballClub" HeaderText="FootballClub" SortExpression="FootballClub" AutoPostBackOnFilter="true" ShowFilterIcon="false" CurrentFilterFunction="Contains">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="Role" DataField="Role" HeaderText="Role" SortExpression="Role" AutoPostBackOnFilter="true" ShowFilterIcon="false" CurrentFilterFunction="Contains">
                        </telerik:GridBoundColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings AllowDragToGroup="True"> 
                    <Selecting AllowRowSelect="True" />
                </ClientSettings>
                <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
            </telerik:RadGrid>
        </telerik:RadAjaxPanel>
    </form>
</body>
</html>
----------------------------------------------------------------------------------------------------------------------------------------------
CS
----------------------------------------------------------------------------------------------------------------------------------------------
using System;
using System.Collections.Generic;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using Telerik.Web.UI.GridExcelBuilder;
using TestTelerikAspxGrid.Web.Bm;
using TestTelerikAspxGrid.Web.Entities;
 
namespace TestTelerikAspxGrid.Web
{
    public partial class RadGrid : System.Web.UI.Page
    {
        private bool _isConfigured;
 
        protected void Page_Load(object sender, EventArgs e)
        {
            Button1.ServerClick += RadButton1Click;
            RadGridFootballPlayers.NeedDataSource += RadGridPendingFootballPlayersNeedDataSource;
            RadGridFootballPlayers.PageSizeChanged += RadGridPendingFootballPlayersPageSizeChanged;
            RadGridFootballPlayers.PageIndexChanged += RadGridPendingFootballPlayersPageIndexChanged;
            RadGridFootballPlayers.SortCommand += RadGridPendingFootballPlayersSortCommand;
            RadGridFootballPlayers.ExcelMLExportRowCreated += RadGridExcelMlExportRowCreated;
            RadGridFootballPlayers.ExcelMLExportStylesCreated += RadGridExcelMlExportStylesCreated;
 
            if (IsPostBack) return;
            Session["GridData"] = new List<EntityFootballPlayer>();
        }
 
        protected void RadButton1Click(object sender, EventArgs e)
        {
            LoadData();
        }
 
        private void LoadData()
        {
            var footballPlayers = new ManagerRadGrid().GetFootballPlayers();
            Session["GridData"] = footballPlayers;
            RadGridFootballPlayers.DataSource = footballPlayers;
            RadGridFootballPlayers.DataBind();
        }
 
        private void LoadDataEventRadGridPendingFootballPlayers()
        {
            RadGridFootballPlayers.DataSource = Session["GridData"];
            RadGridFootballPlayers.DataBind();
        }
 
        protected void RadGridPendingFootballPlayersNeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            RadGridFootballPlayers.MasterTableView.DataSource = Session["GridData"];
        }
 
        protected void RadGridPendingFootballPlayersPageSizeChanged(object source, GridPageSizeChangedEventArgs e)
        {
            LoadDataEventRadGridPendingFootballPlayers();
        }
 
        protected void RadGridPendingFootballPlayersPageIndexChanged(object source, GridPageChangedEventArgs e)
        {
            LoadDataEventRadGridPendingFootballPlayers();
        }
 
        protected void RadGridPendingFootballPlayersSortCommand(object source, GridSortCommandEventArgs e)
        {
            LoadDataEventRadGridPendingFootballPlayers();
        }
 
        #region Export
 
        protected void RadGridExcelMlExportRowCreated(object sender, GridExportExcelMLRowCreatedArgs e)
        {
            if (e.RowType == GridExportExcelMLRowType.DataRow)
            {
                if (e.Row.Cells.Count == 0)
                    return;
 
                if (!_isConfigured)
                {
                    //Set Worksheet name
                    e.Worksheet.Name = "Order Details Extended";
 
                    //Set Column widths
                    foreach (ColumnElement column in e.Worksheet.Table.Columns)
                    {
                        if (e.Worksheet.Table.Columns.IndexOf(column) == 2)
                            column.Width = Unit.Point(180); //set width 180 to ProductName column
                        else
                            column.Width = Unit.Point(80); //set width 80 to the rest of the columns
                    }
 
                    //Set Page options
                    var pageSetup = e.Worksheet.WorksheetOptions.PageSetup;
                    pageSetup.PageLayoutElement.IsCenteredVertical = true;
                    pageSetup.PageLayoutElement.IsCenteredHorizontal = true;
                    pageSetup.PageMarginsElement.Left = 0.5;
                    pageSetup.PageMarginsElement.Top = 0.5;
                    pageSetup.PageMarginsElement.Right = 0.5;
                    pageSetup.PageMarginsElement.Bottom = 0.5;
                    pageSetup.PageLayoutElement.PageOrientation = PageOrientationType.Landscape;
 
                    //Freeze panes
                    e.Worksheet.WorksheetOptions.AllowFreezePanes = true;
                    e.Worksheet.WorksheetOptions.LeftColumnRightPaneNumber = 1;
                    e.Worksheet.WorksheetOptions.TopRowBottomPaneNumber = 1;
                    e.Worksheet.WorksheetOptions.SplitHorizontalOffset = 1;
                    e.Worksheet.WorksheetOptions.SplitVerticalOffest = 1;
 
                    e.Worksheet.WorksheetOptions.ActivePane = 2;
                    _isConfigured = true;
                }
            }
        }
 
        protected void RadGridExcelMlExportStylesCreated(object sender, GridExportExcelMLStyleCreatedArgs e)
        {
            //Add currency and percent styles
            var priceStyle = new StyleElement("priceItemStyle");
            priceStyle.NumberFormat.FormatType = NumberFormatType.Currency;
            priceStyle.FontStyle.Color = System.Drawing.Color.Red;
            e.Styles.Add(priceStyle);
 
            var alternatingPriceStyle = new StyleElement("alternatingPriceItemStyle");
            alternatingPriceStyle.NumberFormat.FormatType = NumberFormatType.Currency;
            alternatingPriceStyle.FontStyle.Color = System.Drawing.Color.Red;
            e.Styles.Add(alternatingPriceStyle);
 
            var percentStyle = new StyleElement("percentItemStyle");
            percentStyle.NumberFormat.FormatType = NumberFormatType.Percent;
            percentStyle.FontStyle.Italic = true;
            e.Styles.Add(percentStyle);
 
            var alternatingPercentStyle = new StyleElement("alternatingPercentItemStyle");
            alternatingPercentStyle.NumberFormat.FormatType = NumberFormatType.Percent;
            alternatingPercentStyle.FontStyle.Italic = true;
            e.Styles.Add(alternatingPercentStyle);
 
            //Apply background colors
            foreach (StyleElement style in e.Styles)
            {
                if (style.Id == "headerStyle")
                {
                    style.InteriorStyle.Pattern = InteriorPatternType.Solid;
                    style.InteriorStyle.Color = System.Drawing.Color.Gray;
                }
                if (style.Id == "alternatingItemStyle" || style.Id == "alternatingPriceItemStyle" || style.Id == "alternatingPercentItemStyle" || style.Id == "alternatingDateItemStyle")
                {
                    style.InteriorStyle.Pattern = InteriorPatternType.Solid;
                    style.InteriorStyle.Color = System.Drawing.Color.LightGray;
                }
                if (style.Id.Contains("itemStyle") || style.Id == "priceItemStyle" || style.Id == "percentItemStyle" || style.Id == "dateItemStyle")
                {
                    style.InteriorStyle.Pattern = InteriorPatternType.Solid;
                    style.InteriorStyle.Color = System.Drawing.Color.White;
                }
            }
        }
 
        #endregion
    }
}
Eyup
Telerik team
 answered on 23 Apr 2013
7 answers
166 views
Hi

I have a grid with Grouping and GroupsDefaultExpanded="false"  to colaspe the groups when the grid loads.

In each group section I have checkboxes to allow users to make selections, what I want to do is when the user re opens the grid, those groups that have previously had a selection made are not colapsed,

Or some other way to let the user know which group has selections made.

Andy
Eyup
Telerik team
 answered on 23 Apr 2013
2 answers
111 views
Hi,

I use a RadSplitter to show some filter options for my pages,  The Filter options button when hovered shows the filter pane.  All great.  I have an issue with the button though.  On Chrome the text is more of less in the vertical middle,  on IE (someone please scrap IE) it goes to the top.  See the attached image, IE on the left, Chrome on the right.  I've looked at the CSS and found the rspPaneTabText style, having applied a "vertical-align:middle ! important;" style to it I still don't get anywhere.

Any suggestions?

Regards

Jon

Code for my splitter is below: 

<telerik:RadSplitter ID="uxRadSplitter" runat="server" Width="788" Height="543" Orientation="Horizontal" VisibleDuringInit="false" BorderSize="0"  >
            <telerik:RadPane ID="uxRadPaneTop" runat="server" >
                Sample
            </telerik:RadPane>
            <telerik:RadPane ID="uxRadPaneBottom" runat="server" Height="25px" Scrolling="none" CssClass="SlidingPaneFilterTitle" >
                <telerik:RadSlidingZone ID="uxRadSlidingZone" runat="server" Height="25px" SlideDirection="Top">
                    <telerik:RadSlidingPane ID="uxRadSlidingPaneFilter" Title="Filter Options" runat="server" Height="175px"
                    EnableDock="false" EnableResize="false" IconUrl="/Images/Icons/16/search.png">
 
                                <telerik:RadToolBar ID="uxRadToolBar" runat="server" OnClientButtonClicking="clientButtonClicking" style="margin-top:5px;">
                                    <items>
                                        <telerik:RadToolBarButton Value="Filter" Text="Apply" ImageUrl="/Images/Icons/16/search.png" CausesValidation="False" />
                                    </items>
                                </telerik:RadToolBar>
                    </telerik:RadSlidingPane>
                 </telerik:RadSlidingZone>
            </telerik:RadPane>
        </telerik:RadSplitter>
Jon
Top achievements
Rank 1
 answered on 23 Apr 2013
1 answer
114 views
when using the RadEditor in Firefox, when you click within a cell, little circles with x in them appear to the left and above the table cell can be clicked to delete either the row or column. However, sometime recently, the one on the left has stopped working to delete the row.  Actually there are many instances where it does work, but i can very easily find a html document with table rows where it doesn't work.  Can you tell me under what circumstances, pressing the red circle/X doesn't cause any change in the html document.  This functionality appears to only be present in Firefox (v20.0.1).  I am using telerik controls v 2013.1.403.40.

Regards,
-Mark
Rumen
Telerik team
 answered on 23 Apr 2013
3 answers
174 views

We have a web page which has a Telerik RadGrid control inside a table structure. We represent text data on the radgrid and the users have the ability to export the data to an excel.

While exporting the data if any of the cells contains a text ( <number > <letter E > < number) example as '3E7'
, the exported excel displays this as 3.00E+04 (in excels scientific representation). We tried to address this issue by capturing OnExcelExportCellFormatting method of the radgrid excel export and injecting custom style to the cell.

Example code below:

            if (e.FormattedColumn.UniqueName == "TierModel")
                e.Cell.Style["mso-number-format"] = @"00000000";


Still whenever the radgrid cell contains a data like ( <number > <letter E > < number) , it’s still represented in the scientific way. Is there any way to control the export of these specific text into excel? Any other styles which will solve this issue?

Also if you have any alternate approaches please let us know.

Thanks !!

Kostadin
Telerik team
 answered on 23 Apr 2013
3 answers
82 views
The GridButtonColumn throws a javascript error in IE 10 when the data field included in the confirmation text includes certain characters.

With this markup I get a javascript error for an unterminated string (in the VS 2012 debugger) when the confirmation text data field (sessionName in the markup) has this value:
Surface Analysis of Biological Materials Using Vibrational & Non Linear Optical Spectroscopy Techniques (8:00-10:00 am) / 3D Imaging & Nanochemical Analysis - Part 1 (10:40 am-12:00 pm)

I'm guessing it's the / character that causes the problem, or the ampersand? Is there any way for me to force html-encoding for the confirmation text data string? Doesn't the control do that by default since it allows data field usage?
<telerik:GridButtonColumn UniqueName="DeleteColumn" ButtonType="ImageButton"
CommandName="Delete" Text="Delete Session" ImageUrl="~/Images/Delete.gif"
HeaderText="Delete" HeaderStyle-Width="40"
ConfirmTitle="Delete" ConfirmDialogType="RadWindow"
ConfirmTextFields="sessionName" ConfirmTextFormatString="Delete session '{0}'?"
>


Angel Petrov
Telerik team
 answered on 23 Apr 2013
1 answer
238 views
Here is my code.  Any help would be greatly appreciated.

ASPX:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="AMEC_DCR.aspx.cs" Inherits="eB.PlugIn.AMEC.AMEC_DCR"
    MaintainScrollPositionOnPostback="true" MasterPageFile="~/Framework/MasterPages/ObjectDisplay.Master"
    ResponseEncoding="utf-8" %>
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI, Version=2013.1.403.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" %>
<asp:Content runat="server" ID="titleC" ContentPlaceHolderID="headerContents">
</asp:Content>
<asp:Content ID="body" ContentPlaceHolderID="bodyContents" runat="server">
    <asp:Table ID="Table1" runat="server">
        <asp:TableRow ID="head" runat="server">
            <asp:TableCell ID="TableCell1" runat="server" Width="137px">
                <asp:Image ID="Image1" runat="server" ImageUrl="./images/amec_logo.png" />
            </asp:TableCell>
            <asp:TableCell runat="server"><asp:Image runat="server" ID="OrgLogo"/></asp:TableCell>
            <asp:TableCell ID="TableCell2" runat="server" HorizontalAlign="Left" VerticalAlign="Middle">
                <asp:Label ID="Label1" runat="server" Font-Size="16" Text="Supplier Data Collection System" />
                <br />
                <asp:Label ID="Label5" runat="server" Text="Project: " />
                <asp:Label ID="lblProjectNameValue" runat="server" Text="TO DO" />
                <br />
                <asp:Label ID="Label6" runat="server" Text="Supplier: " />
                <asp:Label ID="lblSupplierValue" runat="server" />
                <br />
                <asp:Label ID="Label2" runat="server" Text="PO Number: " />
                <asp:Label ID="lblPoNameValue" runat="server" ForeColor="red" />
                <br />
                <br />
            </asp:TableCell></asp:TableRow>
        <asp:TableRow ID="TableRow7" runat="server">
            <asp:TableCell ID="RadGridTagsCell" runat="server" ColumnSpan="3" Visible="True">
                <telerik:RadGrid ID="RadGridTags" runat="server" AllowPaging="True" PageSize="10" OnNeedDataSource="TagDataNeedsDataSource"
                AllowFilteringByColumn="True">
                    <groupingsettings casesensitive="false"></groupingsettings>
                    <ClientSettings AllowKeyboardNavigation="true" EnablePostBackOnRowClick="true">
                        <Selecting AllowRowSelect="true"></Selecting>
                    </ClientSettings>
                    <MasterTableView Width="100%" AutoGenerateColumns="False" DataKeyNames="Tag" HeaderStyle-HorizontalAlign="Center">
                        <Columns>
                            <%--{"Discipline", "Tag", "Tag Status", "Service Description", "Functional Type", "Physical Tag Type"}--%>
                            <telerik:GridBoundColumn DataField="Discipline" DataType="System.String" HeaderText="Discipline"
                                ReadOnly="True" SortExpression="Discipline" UniqueName="Discipline">
                                </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Tag" DataType="System.String" HeaderText="Tag"
                                ReadOnly="True" SortExpression="Tag" UniqueName="Tag" ItemStyle-HorizontalAlign="Center">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="TagStatus" DataType="System.String" HeaderText="Tag Status"
                                ReadOnly="True" SortExpression="Tag Status" UniqueName="TagStatus" ItemStyle-HorizontalAlign="Center">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Service Description" DataType="System.String"
                                HeaderText="Service Description" ReadOnly="True" SortExpression="Service Description"
                                UniqueName="ServiceDescription">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="FunctionalType" DataType="System.String" HeaderText="Functional Type"
                                ReadOnly="True" SortExpression="Functional Type" UniqueName="FunctionalType" ItemStyle-HorizontalAlign="Center">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="PhysicalType" DataType="System.String" HeaderText="Physical Type"
                                ReadOnly="True" SortExpression="Physical Type" UniqueName="PhysicalType">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Tag Maturity Level" DataType="System.String" HeaderText="Tag Maturity Level"
                                ReadOnly="True" SortExpression="Tag Maturity Level" UniqueName="TagMaturityLevel" ItemStyle-HorizontalAlign="Center">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                </telerik:RadGrid>
                <br/>
            </asp:TableCell>
            </asp:TableRow>
            <asp:TableRow ID="TableRow1" runat="server">
            <asp:TableCell ID="RadGridTagDetailCell" runat="server" ColumnSpan="3" Visible="True">
                <telerik:RadGrid ID="RadGridTagDetail" runat="server" AllowPaging="True" PageSize="20" AllowMultiRowEdit="True" OnNeedDataSource="TagDetailDataNeedsDataSource" OnItemCreated="RadGridTagDetail_ItemCreated"
                MasterTableView-DataKeyNames="Tag" AllowFilteringByColumn="True" OnItemEvent="RadGridTagDetail_ItemEvent" AllowAutomaticUpdates="False" OnItemCommand="RadGridTagDetail_ItemCommand" OnPreRender="RadGridTagDetail_PreRender"
                AllowSorting="True">
                    <GroupingSettings CaseSensitive="false"></GroupingSettings>
                    <MasterTableView Width="100%" AutoGenerateColumns="False" DataKeyNames="Tag" EditMode="InPlace"
                        HeaderStyle-HorizontalAlign="Center" AllowAutomaticUpdates="False" CommandItemDisplay="Top">
                        <CommandItemTemplate>
                            <asp:LinkButton runat="server" ID="UpdateAll" Text="Save Changes" CommandName="UpdateAll">Save Changes</asp:LinkButton>
                        </CommandItemTemplate>
                        <Columns>
                            <%--"Attribute", "Value", "Unit Of Measure","Type", "Category", "Review Status"--%>
                            <telerik:GridBoundColumn DataField="Attribute" DataType="System.String" HeaderText="Attribute"
                                ReadOnly="True" SortExpression="Attribute" UniqueName="Attribute">
                                </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn DataField="Value" DataType="System.String" HeaderText="Value"
                                SortExpression="Value" UniqueName="Value">
                                <ItemTemplate>
                                    <telerik:RadTextBox runat="server" Text='<%# Eval("Value")%>'></telerik:RadTextBox>
                                    </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn HeaderText="Unit Of Measure"
                                SortExpression="Unit Of Measure" UniqueName="UnitOfMeasure">
                                <ItemTemplate>
                                    <telerik:RadComboBox ID="radComboUOM" runat="server">
                                    </telerik:RadComboBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="Type" DataType="System.String" HeaderText="Type"
                                SortExpression="Type" UniqueName="Type">
                                <ItemTemplate>
                                    <asp:Label ID="lblType" runat="server" Text='<%# Eval("Type")%>'></asp:Label></ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="Category" DataType="System.String" HeaderText="Category"
                                SortExpression="Category" UniqueName="Category">
                                <ItemTemplate>
                                    <asp:Label ID="lblCategory" runat="server" Text='<%# Eval("Category")%>'></asp:Label>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn DataField="Review Status" DataType="System.String" HeaderText="Review Status"
                                SortExpression="Review Status" UniqueName="ReviewStatus">
                                <ItemTemplate>
                                    <telerik:RadComboBox ID="radComboReviewStatus" runat="server">
                                        <Items>
                                            <telerik:RadComboBoxItem Text="Not Started" Value="0" Selected="true"></telerik:RadComboBoxItem>
                                            <telerik:RadComboBoxItem Text="Incomplete" Value="1"></telerik:RadComboBoxItem>
                                            <telerik:RadComboBoxItem Text="Requires Revision" Value="2"></telerik:RadComboBoxItem>
                                            <telerik:RadComboBoxItem Text="Complete" Value="3"></telerik:RadComboBoxItem>
                                        </Items>
                                    </telerik:RadComboBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings AllowKeyboardNavigation="true">
                        <Selecting AllowRowSelect="true"></Selecting>
                    </ClientSettings>
                    <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                </telerik:RadGrid>
            </asp:TableCell>
            </asp:TableRow>
    </asp:Table>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
        <%--<img alt="Loading..." src="./images/loading.gif" style="border: 0;" />--%>
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <telerik:RadScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <telerik:RadScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <telerik:RadScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <telerik:RadSkinManager ID="QsfSkinManager" runat="server" Skin="MetroTouch" Visible="True" />
        <telerik:RadFormDecorator ID="QsfFromDecorator" runat="server" DecoratedControls="All" EnableRoundedCorners="false" Skin="MetroTouch" Visible="False" />
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="RadGridTags">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGridTags" />
                    </UpdatedControls>
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGridTagDetail" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="RadGridTagDetail">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGridTagDetail" />
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <%--<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="RadGridTagDetail" LoadingPanelID="RadAjaxLoadingPanel1">
                        </telerik:AjaxUpdatedControl>
                    </UpdatedControls>
                </telerik:AjaxSetting>--%>
            </AjaxSettings>
        </telerik:RadAjaxManager>
</asp:Content>
Code Behind:
using System;
using System.Collections;
using System.Data;
using System.Globalization;
using System.Web.UI;
using Telerik.Web.UI;
using eB.Library.Web.UI;
 
namespace eB.PlugIn.AMEC
{
    public partial class AMEC_DCR : ObjectSpecificPage
    {
        private Utils.Data _mData;
        private string _mSPoCode;
        private DataTable _dtTagDetailData;
 
        protected void Page_Init(object sender, EventArgs e)
        {
            _mData = new Utils.Data(eBContext.eBSession);
            _mSPoCode = Request.QueryString["pocode"];
            RadGridTagDetail.ItemCommand += RadGridTagDetail_ItemCommand;
            LoadGui();
        }
 
        protected void Page_Load(object sender, EventArgs e)
        {
            for (int i = 0; i < RadGridTagDetail.PageSize; i++)
            {
                RadGridTagDetail.EditIndexes.Add(i);
            }
        }
 
        protected void RadGridTagDetail_PreRender(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                foreach (GridItem item in RadGridTagDetail.MasterTableView.Items)
                {
                    if (item is GridEditableItem)
                    {
                        GridEditableItem editableItem = item as GridDataItem;
                        editableItem.Edit = true;
                    }
                }
                RadGridTagDetail.Rebind();
            }
        }
 
        protected void Page_PreRender(object sender, EventArgs e)
        {
            if (RadGridTags.SelectedIndexes.Count == 0)
                RadGridTags.SelectedIndexes.Add(0);
 
            RadGridTagDetail.Rebind();
        }
 
        private void LoadGui()
        {
            var personNameSplit = eBContext.PersonName.Split(',');
            var currentUser = personNameSplit[1].Trim(' ');
            lblSupplierValue.Text = string.Format(" {0}", currentUser);
            lblPoNameValue.Text = _mSPoCode;
            lblProjectNameValue.Text = "Mad Dog 2";
 
            OrgLogo.ImageUrl = _mData.GetOrganizationLogo(Server.MapPath(@"~\PlugIns\AMEC\images"));
            //lblProjectNameValue.Text = _mData.GetPoPrimaryPi(_mSPoCode);
        }
 
        int _totalItemCount;
        protected void RadGridTagDetail_ItemCreated(object sender, GridItemEventArgs e)
        {
            var gridPagerItem = e.Item as GridPagerItem;
            if (gridPagerItem != null)
            {
                var pagerItem = gridPagerItem;
                var pageSizeCombo = (RadComboBox)pagerItem.FindControl("PageSizeComboBox");
                var item1 = new RadComboBoxItem("All", _totalItemCount.ToString(CultureInfo.InvariantCulture));
                item1.Attributes.Add("ownerTableViewId", gridPagerItem.OwnerTableView.ClientID);
                pageSizeCombo.Items.Add(item1);
            }
 
            if (e.Item.ItemType != GridItemType.Item && e.Item.ItemType != GridItemType.AlternatingItem) return;
 
            var item = (GridDataItem)e.Item;
            item.Edit = true;
 
            var comboBoxUom = (RadComboBox)(item.FindControl("radComboUOM"));
            var comboBoxReviewStatus = (RadComboBox) (item.FindControl("radComboReviewStatus"));
            comboBoxReviewStatus.SelectedIndex = 0;
 
            if (comboBoxUom == null) return;
 
            var dataRow = item.DataItem as DataRowView;
            if (dataRow == null) return;
 
            var attName = dataRow["Attribute"].ToString();
            var currentVal = dataRow["Unit Of Measure"].ToString();
            var values = _mData.GetUomValueList(item.GetDataKeyValue("Tag").ToString(), attName);
 
            if (values.Count == 0)
                return;
 
            comboBoxUom.DataSource = values;
            comboBoxUom.SelectedValue = currentVal;
        }
 
        protected void RadGridTagDetail_ItemEvent(object sender, GridItemEventArgs e)
        {
            if (e.EventInfo is GridInitializePagerItem)
            {
                _totalItemCount = (e.EventInfo as GridInitializePagerItem).PagingManager.DataSourceCount;
            }
        }
 
        protected void TagDetailDataNeedsDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            _dtTagDetailData = (DataTable)ViewState[RadGridTags.SelectedValue.ToString()];
 
            if (_dtTagDetailData == null)
            {
                _dtTagDetailData = _mData.GetTagDetailsData(RadGridTags.SelectedValue.ToString());
                ViewState[RadGridTags.SelectedValue.ToString()] = _dtTagDetailData;
            }
 
            RadGridTagDetail.DataSource = _dtTagDetailData;
        }
 
        protected void TagDataNeedsDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            var dtTagData = (DataTable)ViewState[_mSPoCode];
 
            if (dtTagData == null)
            {
                dtTagData = _mData.GetPoTagData(_mSPoCode);
                ViewState[_mSPoCode] = dtTagData;
            }
 
            RadGridTags.DataSource = dtTagData;
            RadGridTags.SelectedIndexes.Add(0);
        }
 
        protected void RadGridTagDetail_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName != "UpdateAll") return;
 
            if (RadGridTagDetail.EditIndexes.Count == 0)
        {
            return;
        }
 
        foreach (GridDataItem item in RadGridTagDetail.EditItems)
        {
            UpdateItem(item.EditFormItem);
        }
 
        e.Item.OwnerTableView.Rebind();
    }
 
        private void UpdateItem(GridEditableItem editedItem)
        {
            if (editedItem == null)
                return;
            //Locate the changed row in the DataSource
            var changedRows = _dtTagDetailData.Select("Tag = '" + editedItem.GetDataKeyValue("Tag") + "'");
 
            if (changedRows.Length != 1)
            {
                return;
            }
 
            //Update new values
            var newValues = new Hashtable();
            //The GridTableView will fill the values from all editable columns in the hash
            editedItem.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);
 
            var changedRow = changedRows[0];
            changedRow.BeginEdit();
            try
            {
                foreach (DictionaryEntry entry in newValues)
                {
                    changedRow[(string)entry.Key] = entry.Value;
                }
                changedRow.EndEdit();
            }
            catch (Exception)
            {
                changedRow.CancelEdit();
            }
        }
    }
}

Andrey
Telerik team
 answered on 23 Apr 2013
5 answers
1.0K+ views
I am surprised I cannot find any guidance on how to do a CLIENT-side Yes / No / Cancel dialog box using Telerik Rad controls for ASP.NET AJAX.  My best guess is the RadNotification control, but still I cannot find any guidance on how to do this, in either the online documentation or by searching the Forums,  Could you please point me to a helpful posting or documentation page on this topic, one that has some sample code?
Marin Bratanov
Telerik team
 answered on 23 Apr 2013
1 answer
150 views
I want to the RadEditor control in ascx page (to be used in SP2010 webpart). But I receive the below error.
1) I have added reference of RadEditorSharePoint.dll, Telerik.Ajax.SharePoint.dll and Telerik.Web.UI.dll
2) Have added

<%@ Register Assembly="RadEditorSharePoint, Version=6.3.0.0, Culture=neutral, PublicKeyToken=1f131a624888eeed"

Namespace="Telerik.SharePoint" TagPrefix="telerik" %>
in the ascx page

3) Have deployed the RadControlsSP.wsp from Telerik.SharepointAccelerationKit_2012_1_CTP_Trial.

    But Still I receive the error as shown below.

Compiler Error Message: CS0012: The type 'Telerik.Web.UI.RadEditor' is defined in an assembly that is not referenced. You must add a reference to assembly 'Telerik.Web.UI, Version=2012.1.215.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4'.

Source Error:

 

Line 1154:       
Line 1155:        [System.Diagnostics.DebuggerNonUserCodeAttribute()]
Line 1156:        private global::Telerik.SharePoint.MOSSRadEditor @__BuildControlrtxtDetail() {
Line 1157:            global::Telerik.SharePoint.MOSSRadEditor @__ctrl;
Line 1158:           
 

Please help on the same.

Stanimir
Telerik team
 answered on 23 Apr 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?