Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
1.1K+ views

<telerik:GridTemplateColumn HeaderText="Amount" UniqueName="Amount" SortExpression="Amount" Aggregate="Custom" DataField="Amount">  

<ItemTemplate>
 <asp:TextBox runat="server" ID="txtAmount" Text='<%# Eval("Amount") %>' 

 DataFormatString="{0:C}" ></asp:TextBox> 

</ItemTemplate> 
 </telerik:GridTemplateColumn>

 

In the above code, initially, I used only ItemTemplate and added Textbox in it and tried to get the value entered by user in the ItemCommand event. But I couldn't get the new value from Textbox. It is giving the old value

I had used below code in the Itemcommand event to get the new value, but, didn't get the new value.

protected void grdPaymentHistory_OnItemCommand(object sender, GridCommandEventArgs e)

{ 

     var dataItem = e.Item as GridDataItem;

         var refundAmount = (TextBox)dataItem["Amount"].Controls[1];  

}

 

Later on, I thought that edited values may not be available in ItemTemplate. So, I used editItemTemplate which is containing textbox and validator.Now, when user clicks on edit button (GridEditcommandcolumn), textbox is avialable for entering the amount. I am trying to get the value entered by user in the textbox in the edititemtemplate. I am trying to get the value in ItemCommand event. Below is the Itemcommand event.

Here, I am getting the old value i.e the value which was there initially before the user edited.
 

<telerik:GridTemplateColumn HeaderText="Amount" UniqueName="Amount" SortExpression="Amount" Aggregate="Custom" DataField="Amount"> 

<ItemTemplate>  

<asp:Label runat="server" ID="lblAmount" Text='<%# Eval("Amount") %>'DataFormatString="{0:C}"></asp:Label>

 </ItemTemplate>

 <EditItemTemplate> 

<asp:TextBox runat="server" ID="txtAmount" Text='<%# Eval("Amount") %>' 

 DataFormatString="{0:C}" ></asp:TextBox>  

 

<asp:CustomValidator ID="RefundamountValidator" runat="server" ControlToValidate="txtAmount" 

OnServerValidate="RefundAmountValidation" ValidateEmptyText="True"  

ErrorMessage="Reassign To cannot be the same as Assigned To" SetFocusOnError="true" 

Text="*" Display="Dynamic" />  

 

</EditItemTemplate>

</telerik:GridTemplateColumn>

 

 

protected void grdPaymentHistory_OnItemCommand(object sender, GridCommandEventArgs e)

{ 

    foreach (GridDataItem item in grdPaymentHistory.EditItems)

        { 

        var TextBox1 = item.FindControl("txtAmount") as TextBox; 

        }
}


Please provide your valuable inputs to get the new value in both ItemTemplate and EditItemTemplate.
Thanks

Jayesh Goyani
Top achievements
Rank 2
 answered on 18 May 2013
3 answers
178 views
Does anyone somewhere has ever done drag and drop objects from one window to other window in a browser?
The context is: I have a list of icons representing modules in a floating non modal window which I can select one and drag drop into its parent window to create an instance of this module.
I know that the selecting icon event should generate an event into its parent window to create an instance of the dragging object.
But is it possible to pass the control of the mouse to the parent window?

Or this king of functionality already exists in your controls!


Christian
Raka
Top achievements
Rank 1
 answered on 17 May 2013
1 answer
218 views
Hi there,

I have an asp.net page (code at the end of posting) with a RadChart. The RadChart is used to show the progress of a project as a Gantt diagram.  The client organizes thier projects in the following manner
- a project is split into milestones
- a milestone is split into phases

Only the phases should be displayed on the diagram and not the milestones.  The phases should be colored according to the milestone.  The colors of the milestones should be shown as legend.  Please see the attached image.  

I have the following issues:
I don't seem to get the legend working properly.  I use PreRender of the RadChart to reset the legend and create its elements manually. The colors shown however don't correspnd with the ones assigned.  

Following is the code.

Thank you for your help!

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Projektplan.aspx.cs" Inherits="Test.Pages.Projektplan" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
 
<%@ Register TagPrefix="telerik" Namespace="Telerik.Charting" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html>
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <div>
            <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
                <Scripts>
                    <asp:scriptreference assembly="Telerik.Web.UI" name="Telerik.Web.UI.Common.Core.js"></asp:scriptreference>
                    <asp:scriptreference assembly="Telerik.Web.UI" name="Telerik.Web.UI.Common.jQuery.js"></asp:scriptreference>
                    <asp:scriptreference assembly="Telerik.Web.UI" name="Telerik.Web.UI.Common.jQueryInclude.js"></asp:scriptreference>
                </Scripts>
            </telerik:RadScriptManager>
            <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager>
            <telerik:RadChart ID="ProjektPlan" runat="server" SeriesOrientation="Horizontal" OnPreRender="ProjektPlan_OnPreRender" DefaultType="Gantt" />
        </div>
    </form>
</body>
</html>

using System;
using System.Drawing;
using Telerik.Charting;
using Telerik.Charting.Styles;
using Telerik.Web.UI;
 
namespace Test.Pages
{
    public partial class Projektplan : System.Web.UI.Page
    {
        readonly Color _kickoffcolor = Color.Coral;
        readonly Color _longColor = Color.Blue;
        readonly Color _pflichtenheftColor = Color.CornflowerBlue;
        readonly Color _shortColor = Color.Cornsilk;
        readonly Color _entscheidungsvorlageColor = Color.Crimson;
        readonly Color _abschlussColor = Color.Cyan;
 
        protected void Page_Load(object sender, EventArgs e)
        {
 
 
            if (Page.IsPostBack)
            {
                return;
            }
 
            ProjektPlan.Height = 600;
            ProjektPlan.Width = 800;
 
 
            ProjektPlan.PlotArea.YAxis.AutoScale = false;
            ProjektPlan.PlotArea.YAxis.AxisMode = ChartYAxisMode.Extended;
            ProjektPlan.PlotArea.YAxis.Appearance.ValueFormat = ChartValueFormat.ShortDate;
            ProjektPlan.PlotArea.YAxis.Appearance.CustomFormat = "MM.yyyy";
 
            ProjektPlan.PlotArea.YAxis.Appearance.LabelAppearance.RotationAngle = 45;
            ProjektPlan.PlotArea.YAxis.Appearance.MinorGridLines.Visible = false;
 
            ProjektPlan.PlotArea.XAxis.Appearance.MajorGridLines.Visible = false;
 
            double start = new DateTime(2013, 5, 17).ToOADate();
            double ende = new DateTime(2014, 8, 17).ToOADate();
            ProjektPlan.PlotArea.YAxis.AddRange(start, ende, 30);
 
            ChartSeries series0 = new ChartSeries { Name = "series 1", Type = ChartSeriesType.Gantt };
            series0.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.Nothing;
            series0.Appearance.FillStyle.MainColor = Color.Blue;
 
            ChartSeriesItem kickoffSeriesItem = new ChartSeriesItem
            {
                Name = "Series0Item0",
                YValue = new DateTime(2013, 5, 17).ToOADate(),
                YValue2 = new DateTime(2013, 6, 17).ToOADate()
            };
 
            kickoffSeriesItem.Label.TextBlock.Text = "Kickoff";
            kickoffSeriesItem.Label.Appearance.LabelLocation = StyleSeriesItemLabel.ItemLabelLocation.Auto;
            kickoffSeriesItem.Appearance.FillStyle.MainColor = _kickoffcolor;
 
            ChartSeriesItem longSeriesItem = new ChartSeriesItem
            {
                Name = "Series0Item1",
                YValue = new DateTime(2013, 7, 20).ToOADate(),
                YValue2 = new DateTime(2013, 8, 14).ToOADate()
            };
            longSeriesItem.Appearance.FillStyle.MainColor = _longColor;
            longSeriesItem.Label.TextBlock.Text = "Longlist";
            kickoffSeriesItem.Label.Appearance.LabelLocation = StyleSeriesItemLabel.ItemLabelLocation.Auto;
 
            ChartSeriesItem shortSeriesItem = new ChartSeriesItem
            {
                Name = "Series1Item0",
                YValue = new DateTime(2013, 9, 30).ToOADate(),
                YValue2 = new DateTime(2013, 11, 17).ToOADate()
            };
            shortSeriesItem.Appearance.FillStyle.MainColor = _shortColor;
            shortSeriesItem.Label.TextBlock.Text = "Shortlist";
            kickoffSeriesItem.Label.Appearance.LabelLocation = StyleSeriesItemLabel.ItemLabelLocation.Auto;
 
            ChartSeriesItem abschlussSeriesItem = new ChartSeriesItem
            {
                Name = "Series1Item1",
                YValue = new DateTime(2013, 12, 15).ToOADate(),
                YValue2 = new DateTime(2014, 4, 14).ToOADate()
            };
            abschlussSeriesItem.Appearance.FillStyle.MainColor = _abschlussColor;
            abschlussSeriesItem.Label.TextBlock.Text = "Abschluß";
            kickoffSeriesItem.Label.Appearance.LabelLocation = StyleSeriesItemLabel.ItemLabelLocation.Auto;
 
            series0.AddItem(abschlussSeriesItem);
            series0.AddItem(shortSeriesItem);
            series0.AddItem(longSeriesItem);
            series0.AddItem(kickoffSeriesItem);
 
            ProjektPlan.AddChartSeries(series0);
        }
 
        protected void ProjektPlan_OnPreRender(object sender, EventArgs e)
        {
            RadChart chart = (RadChart) sender;
            LabelItem kickoffLegendItem = new LabelItem("Kickoff");
            kickoffLegendItem.Appearance.FillStyle.MainColor = _kickoffcolor;
 
            LabelItem longLegendItem = new LabelItem("Longlist");
            longLegendItem.Appearance.FillStyle.MainColor = _longColor;
 
            LabelItem pflichtenheftLegendItem = new LabelItem("Pflichtenheft");
            longLegendItem.Appearance.FillStyle.MainColor = _pflichtenheftColor;
 
            LabelItem shortLegendItem = new LabelItem("Shortlist");
            shortLegendItem.Appearance.FillStyle.MainColor = _shortColor;
 
            LabelItem entscheidungsvorlageLegendItem = new LabelItem("Entscheidungsvorlage");
            shortLegendItem.Appearance.FillStyle.MainColor = _entscheidungsvorlageColor;
 
            LabelItem abschlussLegendItem = new LabelItem("Abschluß");
            abschlussLegendItem.Appearance.FillStyle.MainColor = _abschlussColor;
 
            chart.Legend.Items.Clear();
            chart.Legend.Items.Add(kickoffLegendItem);
            chart.Legend.Items.Add(longLegendItem);
            chart.Legend.Items.Add(pflichtenheftLegendItem);
            chart.Legend.Items.Add(shortLegendItem);
            chart.Legend.Items.Add(entscheidungsvorlageLegendItem);
            chart.Legend.Items.Add(abschlussLegendItem);
        }
    }
}


Petar Kirov
Telerik team
 answered on 17 May 2013
2 answers
553 views
I have a page layout using the RadSplitter that consists of a left panel that can be collapsed. We want to collapse the side panel automatically on some pages (which I already know we can do), but we also want to let the user know that panel has been collapsed and that they can re-expand it if they want. Is there a way to add a RadTooltip to the expand/collapse button? I know you can have a standard browser on-hover tooltip, but we want something that we can pop open automatically on page load that says something like "Missing your sidebar? Click here to open it." and ideally have a button that says "Never show again" where we could store a value (in DB or cookie) to prevent the tooltip in the future.
Kevin Neumann
Top achievements
Rank 1
 answered on 17 May 2013
7 answers
295 views
Hi,

I have a rad grid with about 7 columns and 4 of them are hyperlink columns. The grid is wrap in an ajax panel which ajaxifies just fine. Really the only reason I want the grid to ajaxify is for the pagination but it is also ajaxifying when you click a hyperlink column. This is not what I want. How can I only ajaxify the pagination buttons?

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Simple"></telerik:RadAjaxLoadingPanel>
       <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">
            <telerik:RadGrid runat="server" ID="grdInvoices1" Width="836px"
             AutoGenerateColumns="false" CssClass="CustomClass"
               AllowMultiRowEdit="false" ShowHeader="false" ForeColor="Black"
                BorderColor="#EDEDED" BorderStyle="Solid"
               SelectedItemStyle-CssClass="SelectedStyle"
                   onpageindexchanged="grdInvoices1_PageIndexChanged"
                onpagesizechanged="grdInvoices1_PageSizeChanged1" onitemdatabound="grdInvoices1_ItemDataBound"
                 >
               <ClientSettings>
                   <Selecting AllowRowSelect="true" />
                   <ClientEvents OnRowMouseOver="GetRowId" OnRowSelected="RowSelected" />
                    <DataBinding EnableCaching="false" />
               </ClientSettings>
               <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" ></PagerStyle>
               <MasterTableView DataKeyNames="Id, CustomerId, CompanyId" ClientDataKeyNames="Id"
                       Font-Names="Arial,Helvetica,sans-serif;" >
                   <CommandItemSettings ExportToPdfText="Export to PDF" />
                   <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" >
                   </RowIndicatorColumn>
                   <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                   </ExpandCollapseColumn>
                   <Columns>
                        <telerik:GridBoundColumn DataField="Id" HeaderText="Id" Visible="false" UniqueName="Id">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn DataField="InvoiceNo" UniqueName="InvoiceNo" HeaderText="Invoice No">
                           <ItemTemplate>
                               <asp:LinkButton runat="server" ID="lnkInvoiceNo" Text='<%# Eval("InvoiceNo") %>'
                                 OnClick="lnkInvoiceNo_Click"     />
                               </ItemTemplate>
                        <ItemStyle Width="115px" CssClass="FirstColumn" />
                        </telerik:GridTemplateColumn>
                        <%-- <telerik:GridHyperLinkColumn  HeaderText="Invoice No"  UniqueName="InvoiceNo"
                             DataNavigateUrlFields="Id, CustomerId, CompanyId" DataNavigateUrlFormatString="../Invoices/ViewInvoice.aspx?Invoice={0}&Customer={1}&Company={2}"
                             DataTextField="InvoiceNo" DataTextFormatString="{0:d}" >
                              <ItemStyle Width="175px" CssClass="FirstColumn" />
                        </telerik:GridHyperLinkColumn>--%>
                        <telerik:GridBoundColumn DataField="Customer" HeaderText="Customer" UniqueName="Customer">
                           <ItemStyle Width="300px" HorizontalAlign="Center" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Total" HeaderText="Total" UniqueName="Total"
                            DataFormatString="{0:N2}" ItemStyle-HorizontalAlign="Right"  ItemStyle-Font-Bold="true">
                        </telerik:GridBoundColumn>
                        <telerik:GridTemplateColumn HeaderText="Tools" UniqueName="Edit">
                           <ItemStyle Width="128px" HorizontalAlign="Right" CssClass="EditSpacer" />
                           <ItemTemplate>
                           <div runat="server" id="Edit" class="Tools">
                               <asp:ImageButton  ID="lnkEdit" runat="server" OnClick="btnEdit_Click"  ImageUrl="~/Images/Icons/Test/Edit.png"
                                   AlternateText="Edit" ToolTip="Edit" />
                           </div>
                       </ItemTemplate>
                       </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn>
                           <ItemStyle Width="20px"  />
                           <ItemTemplate>
                           <div class="Tools">
                               <asp:HyperLink ID="Delete" runat="server">  
                                <asp:ImageButton ID="DeleteImg" runat="server" ImageUrl="~/Images/Icons/Test/Delete.png"
                                 OnClientClick="return DeleteInvoice();" AlternateText="Delete" ToolTip="Delete" style="border:none; "   /> 
                                </asp:HyperLink>
                           </div>
                       </ItemTemplate>
                       </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn>
                           <ItemStyle Width="20px" />
                           <ItemTemplate>
                           <div class="Tools">
                             <asp:ImageButton ID="btnPayment" runat="server" OnClick="btnPayment_Click"  ImageUrl="~/Images/Icons/Test/addpayment.png"
                                   AlternateText="Payment" ToolTip="Payment"  style="border:none;" />
                           </div>
                       </ItemTemplate>
                   </telerik:GridTemplateColumn>
                       <telerik:GridTemplateColumn>
                           <ItemStyle Width="20px" />
                           <ItemTemplate>
                           <div class="Tools">
                               <asp:HyperLink ID="Print" runat="server"  >  
                                <asp:ImageButton ID="PrintImg" runat="server" ImageUrl="~/Images/Icons/Test/Printer.png"
                                AlternateText="Print"  ToolTip="Print" OnClick="PrintInvoice" /> 
                                </asp:HyperLink>
                           </div>
                       </ItemTemplate>
                   </telerik:GridTemplateColumn>
                 
                   <telerik:GridBoundColumn DataField="CustomerId" HeaderText="CustomerId" UniqueName="CustomerId">
                       <ItemStyle CssClass="HideColumn" />
                   </telerik:GridBoundColumn>
                   <telerik:GridBoundColumn DataField="CompanyId" HeaderText="CompanyId" UniqueName="CompanyId">
                       <ItemStyle CssClass="HideColumn" />
                   </telerik:GridBoundColumn>
                   </Columns>
                   <EditFormSettings>
                       <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                       </EditColumn>
                   </EditFormSettings>            
               </MasterTableView>              
                   <FilterMenu EnableImageSprites="False">
                   </FilterMenu>
                   <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                   </HeaderContextMenu>
           </telerik:RadGrid>
           </telerik:RadAjaxPanel>


Thanks,
Ron.
Ron
Top achievements
Rank 1
 answered on 17 May 2013
10 answers
535 views
Hello,

I was wondering if it is possible to cancel the RadGrid's Export after the GridExporting event. 

I have figured out that I can save a file to the server during the GridExporting event, and after this occurs, I would like to cancel the rest of the normal process.

Any ideas?

Thanks in advance!

Jason
Daniel
Telerik team
 answered on 17 May 2013
3 answers
230 views
Hi,

I have a problem with telerik version 2013.1.417.35 for radasyncupload in the grid. I dont have any problem with previous versions.

I have a grid and trying to create a new attachment gives an error : 

<telerik:RadGrid ID="AttachmentGrid" GridLines="None" EnableLinqExpressions="False"
            runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
            AllowPaging="True" DataSourceID="SubActivitiesDataSource" Skin="Metro" AllowSorting="True"
            AutoGenerateDeleteColumn="False" OnItemCommand="AttachmentGrid_ItemCommand" OnItemCreated="AttachmentGrid_ItemCreated">
            <PagerStyle Mode="NextPrevAndNumeric" />
            <%--25/03/2013--%>
            <MasterTableView Width="110%" Height="400px" CommandItemDisplay="Top" DataKeyNames="id"
                DataSourceID="AttachmentDataSource" HorizontalAlign="NotSet" AutoGenerateColumns="False"
                EditMode="PopUp" CommandItemSettings-AddNewRecordText="Add New Attachment">
                <CommandItemSettings ExportToPdfText="Export to Pdf" />
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                    <HeaderStyle Width="20px" />
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                    <HeaderStyle Width="20px" />
                </ExpandCollapseColumn>
                <EditFormSettings InsertCaption="Add New Attachment" EditColumn-UpdateText="Save"
                    EditColumn-InsertText="Save" EditColumn-ButtonType="PushButton" FormMainTableStyle-Height="250">
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                    <PopUpSettings Modal="true" ZIndex="999999" CloseButtonToolTip="Click to close" Width="800" />
                </EditFormSettings>
                <Columns>
                    <telerik:GridEditCommandColumn ButtonType="LinkButton" EditText="Edit">
                        <ItemStyle Font-Size="Small" Font-Bold="true" />
                    </telerik:GridEditCommandColumn>
                    <telerik:GridButtonColumn ButtonType="LinkButton" Text="Delete" CommandName="Delete"
                        ConfirmText="Are you sure?" ConfirmTitle="Alert">
                        <ItemStyle Font-Size="Small" Font-Bold="true" />
                    </telerik:GridButtonColumn>
                    <telerik:GridTemplateColumn UniqueName="InitiatorName" Groupable="False" HeaderText="Which entity or company did you receive this file from?"
                        DataField="InitiatorName" Display="false">
                        <ItemTemplate>
                            <asp:Label ID="lblcompany" Text='<%#DataBinder.Eval(Container.DataItem, "InitiatorName")%>'
                                runat="server"  Display="false"></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList ID="InitiatorName" runat="server" CssClass="textbox" SelectedValue='<%# Bind("InitiatorName") %>'
                                DataSourceID="CompanyNameDataSource" DataTextField="InitiatorName" Width="300px"
                                DataValueField="InitiatorName" OnSelectedIndexChanged="InitiatorName_SelectedIndexChanged"
                                AutoPostBack="true">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="ReqInitiatorName" runat="server" ControlToValidate="InitiatorName"
                                ErrorMessage="Please Select a Company Name" Display="Dynamic" SetFocusOnError="true" />
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="FileMainCategory" Groupable="False" HeaderText="Which of the 6 chapters"
                        DataField="FileMainCategory">
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "FileMainCategory")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList ID="FileMainCategory" runat="server" CssClass="textbox" SelectedValue='<%# Bind("FileMainCategory") %>'
                                DataSourceID="FileMainCategoryDataSource" DataTextField="MainCategory" Width="300px"
                                DataValueField="MainCategory" OnSelectedIndexChanged="MainCategory_SelectedIndexChanged"
                                AutoPostBack="true">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredfieldvalidatorFileMainCategory" runat="server"
                                ControlToValidate="FileMainCategory" ErrorMessage="Please select one, if none applies then choose “Others”"
                                Display="Dynamic" SetFocusOnError="true" />
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="FileCategory" Groupable="False" HeaderText="Categorise this file based on the 6 Chapters selected"
                        DataField="FileCategory">
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "FileCategory")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList ID="FileCategory1" runat="server" CssClass="textbox" DataTextField="Category"
                                Width="300px" DataSourceID="FileCategoryDataSource" DataValueField="Category">
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredfieldvalidatorFileCategory" runat="server"
                                ControlToValidate="FileCategory1" ErrorMessage="Please Select a File Category"
                                Display="Dynamic" SetFocusOnError="true" />
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="MainClassofInsurance" Groupable="False" HeaderText="Is this related to a particular class of insurance?"
                        DataField="MainClassofInsurance"  Display="false">
                        <ItemTemplate>
                            <asp:Label ID="lblClassofInsurance" Text='<%#DataBinder.Eval(Container.DataItem, "MainClassofInsurance")%>'
                                runat="server"  Display="false"></asp:Label>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList ID="MainClassofInsurance" runat="server" CssClass="textbox" SelectedValue='<%# Bind("MainClassofInsurance") %>'
                                DataSourceID="ClassOfInsurancedatasource" DataTextField="Insurance" Width="300px"
                                DataValueField="Insurance" OnSelectedIndexChanged="MainClassofInsurance_SelectedIndexChanged"
                                AutoPostBack="true">
                            </asp:DropDownList>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <%--24/03/2012 --%>
                    <telerik:GridTemplateColumn UniqueName="refid" Groupable="False" HeaderText="TaskNo"
                        DataField="refid">
                        <ItemTemplate>
                            <%-- Start-14/12/2012-Reddy Set InitiatorName/MainClassofInsurance values from task master unless exist in the attachment table.--%>
                            <asp:HyperLink ID="lnkrefid" runat="Server" NavigateUrl='<%#"~/EditTask.aspx?TaskNo=" + DataBinder.Eval(Container.DataItem, "refid").ToString()%>'
                                Text='<%# Bind("refid") %>' Target="_blank" />
                            <%--<%#DataBinder.Eval(Container.DataItem, "refid")%>--%>
                            <%--End-14/12/2012-Reddy Set InitiatorName/MainClassofInsurance values from task master unless exist in the attachment table.--%>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="emailrefid" Groupable="False" HeaderText="emailrefid"
                        DataField="emailrefid">
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "emailrefid")%>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <%--24/03/2012--%>
                    <telerik:GridTemplateColumn UniqueName="Status" Groupable="False" HeaderText="Status"
                        FilterControlWidth="50px">
                        <HeaderStyle Width="80px" />
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "Status")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:DropDownList ID="Status" runat="server" SelectedValue='<%# Bind("Status") %>'
                                CssClass="textbox">
                                <asp:ListItem Text="ACTIVE" Value="ACTIVE" Selected="True"></asp:ListItem>
                                <asp:ListItem Text="INACTIVE" Value="INACTIVE"></asp:ListItem>
                                <asp:ListItem Text="DELETED" Value="DELETED"></asp:ListItem>
                                <asp:ListItem Text="Please Select" Value=""></asp:ListItem>
                            </asp:DropDownList>
                            <asp:RequiredFieldValidator ID="RequiredfieldvalidatorStatus" runat="server" ControlToValidate="Status"
                                ErrorMessage="Please Select a Status" Display="Dynamic" SetFocusOnError="true" />
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridAttachmentColumn DataSourceID="SubActivitiesDataSource" MaxFileSize="10048576"
                        HeaderStyle-Font-Bold="true" EditFormHeaderTextFormat="Upload File: " HeaderText="Attachment"
                        AttachmentDataField="Content" AttachmentKeyFields="id" FileNameTextField="FileName"
                        DataTextField="FileName" UniqueName="AttachmentColumn" AllowFiltering="true">
                    </telerik:GridAttachmentColumn>
                    <telerik:GridTemplateColumn UniqueName="filename" Groupable="False" HeaderText="File Name"
                        DataField="filename">
                        <HeaderStyle Width="150px" />
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "filename")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtFile" Text='<%# Bind("filename") %>' runat="server"></asp:TextBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="Description" Groupable="False" HeaderText="Description"
                        DataField="Description">
                        <HeaderStyle Width="150px" />
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "Description")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtdesc" Text='<%# Bind("Description") %>' runat="server" Width="400px"
                                Height="50px" TextMode="MultiLine"></asp:TextBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <%--25/03/2013--%>
                    <telerik:GridTemplateColumn UniqueName="DateUpdated" Groupable="False" HeaderText="Date Created">
                        <HeaderStyle Width="150px" />
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "DateUpdated")%><br />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="UpdatedBy" Groupable="False" HeaderText="Created By">
                        <HeaderStyle Width="150px" />
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "UpdatedBy")%>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                    <%--25/03/2013--%>
                    <%-- ssy       '01/08/2012--%>
                    <telerik:GridTemplateColumn UniqueName="PlacementNo" Groupable="False" HeaderText="PlacementNo"
                        DataField="PlacementNo">
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "PlacementNo")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtPlacementNo" Text='<%# Bind("PlacementNo") %>' runat="server"></asp:TextBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="AddendumNo" Groupable="False" HeaderText="AddendumNo"
                        DataField="AddendumNo">
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "AddendumNo")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtAddendumNo" Text='<%# Bind("AddendumNo") %>' runat="server"></asp:TextBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="ClaimNo" Groupable="False" HeaderText="ClaimNo"
                        DataField="ClaimNo">
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "ClaimNo")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtClaimNo" Text='<%# Bind("ClaimNo") %>' runat="server"></asp:TextBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="EndorsementNo" Groupable="False" HeaderText="EndorsementNo"
                        DataField="EndorsementNo">
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "EndorsementNo")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtEndorsementNo" Text='<%# Bind("EndorsementNo") %>' runat="server"></asp:TextBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="OtherRefNo" Groupable="False" HeaderText="OtherRefNo"
                        DataField="OtherRefNo">
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "OtherRefNo")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtOtherRefNo" Text='<%# Bind("OtherRefNo") %>' runat="server"></asp:TextBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="GroupName" Groupable="False" HeaderText="GroupName"
                        DataField="GroupName">
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "GroupName")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtGroupName" Text='<%# Bind("GroupName") %>' runat="server"></asp:TextBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn UniqueName="PolicyYear" Groupable="False" HeaderText="PolicyYear"
                        DataField="PolicyYear">
                        <ItemTemplate>
                            <%#DataBinder.Eval(Container.DataItem, "PolicyYear")%>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <asp:TextBox ID="txtPolicyYear" Text='<%# Bind("PolicyYear") %>' runat="server"></asp:TextBox>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>
                    <%-- ssy       '01/08/2012--%>
                </Columns>
            </MasterTableView>
            <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Sunset">
            </HeaderContextMenu>
            <ClientSettings>
                <Selecting AllowRowSelect="True" />
                <%--25/03/2013--%>
                <Scrolling AllowScroll="true" />
                <%--25/03/2013--%>                
            </ClientSettings>
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
        </telerik:RadGrid>

after upload a file then click on save button gives an error - Invalid JSON primitive : filename.

it' not hitting any break point .. so unable to solve this...

please help me on this..

Thanks in advance..

Hristo Valyavicharski
Telerik team
 answered on 17 May 2013
1 answer
172 views
Telerik,

Are there plans to change how the template columns work in RadGrid so that they, too, can be dynamically created in the OnLoad event of the page?  It has been 3 years since your last post on this and I am wondering if this is something that can be fixed.  We have dynamically created grids all set up in the OnLoad page but the minute we put template columns in the ASPX page OR try and build them in the OnLoad they act funny.  I understand that this is due to how the RadGrid is initialized and if I put these columns in the RadGrid_Init routine they seem to work but on postback they make a mess as icons are put in places they should not be and other columns seem to dissapear. 

It is not possible to turn off column state on our pages and it is not practical to create the complete grid manually.  It would be AWESOME if you could put template columns on the ASPX page and then add dynamic columns around them.  This would allow us to customize a grid with icons and links but still pull all the columns from a database query.

David.
David Thompson
Top achievements
Rank 2
 answered on 17 May 2013
1 answer
120 views
Hi,

I have updated telerik version to "2013, 1, 417, 35"

Please help me to solve this error :  
 

Server Error in '/emarine_dev_test' Application.

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: BC30108: 'Page' is a type and cannot be used as an expression.

Source Error:

Line 21: <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"
Line 22:     Width="75px" Transparency="25">
Line 23:     <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
Line 24:         style="border: 0;" />
Line 25: </telerik:RadAjaxLoadingPanel>


aspx:

<%@ Page Title="" Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false"
    CodeFile="Add_t_eMarine_SpecialRate_Setup.aspx.vb" Inherits="Add_t_eMarine_SpecialRate_Setup" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Common" %>
<%@ Register TagPrefix="uc" TagName="RadGrid" Src="~/Shared/eMarineTelerikGrid2.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .innerTableCell
        {
            width: 450px;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" EnableShadow="true">
        <Windows>
            <telerik:RadWindow ID="rw_customConfirm" Modal="true" VisibleTitlebar="false" runat="server"
                VisibleStatusbar="false" Width="450px" Height="150px">
                <ContentTemplate>
                    <table>
                        <tr>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td width="20px">
                            </td>
                            <td>
                                <asp:Label Style="font-size: 12px; font-family: Arial;" ID="lblTaskNo" Text="Required field(s) not provided."
                                    runat="server">
                                </asp:Label>
                            </td>
                        </tr>
                        <tr>
                            <td>
                            </td>
                            <td style="font-size: 12px; font-family: Arial;">
                                Do you want to save?
                            </td>
                        </tr>
                    </table>
                    <table>
                        <tr>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td width="20px">
                            </td>
                            <telerik:RadButton runat="server" ID="rbConfirm_Cancel" Text="OK" OnClientClicked="closeCustomConfirm">
                                </telerik:RadButton>
                 <%--           <td width="80px">
                                <telerik:RadButton runat="server" ID="rbConfirm_OK" Text="OK">
                                </telerik:RadButton>
                            </td>
                            <td>
                                <telerik:RadButton runat="server" ID="rbConfirm_Cancel" Text="Cancel" OnClientClicked="closeCustomConfirm">
                                </telerik:RadButton>
                            </td>--%>
                        </tr>
                    </table>
                </ContentTemplate>
            </telerik:RadWindow>
            <telerik:RadWindow ID="rw_customAlert" Modal="true" VisibleTitlebar="false" runat="server"
                VisibleStatusbar="false" Width="450px" Height="150px">
                <ContentTemplate>
                    <table>
                        <tr>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td width="20px">
                            </td>
                            <td>
                                <asp:Label Style="font-size: 12px; font-family: Arial;" ID="Label7" Text="Required field(s) not provided."
                                    runat="server">
                                </asp:Label>
                            </td>
                        </tr>
                        </table>
                    <table>
                        <tr>
                            <td>
                            </td>
                        </tr>
                        <tr>
                            <td width="20px">
                            </td>
                            <telerik:RadButton runat="server" ID="rbAlert_Cancel" Text="OK" OnClientClicked="closeCustomAlert">
                                </telerik:RadButton>
                 <%--           <td width="80px">
                                <telerik:RadButton runat="server" ID="rbConfirm_OK" Text="OK">
                                </telerik:RadButton>
                            </td>
                            <td>
                                <telerik:RadButton runat="server" ID="rbConfirm_Cancel" Text="Cancel" OnClientClicked="closeCustomConfirm">
                                </telerik:RadButton>
                            </td>--%>
                        </tr>
                    </table>
                </ContentTemplate>
            </telerik:RadWindow>
        </Windows>
    </telerik:RadWindowManager>
    <asp:Table ID="Table1" runat="server" CssClass="dialog_view" CellPadding="0" CellSpacing="0"
        border="0" Width="700px">
        <asp:TableRow>
            <asp:TableCell CssClass="dh"> <asp:Table ID="Table2" runat="server" CellPadding="0" CellSpacing="0" Width="100%"
                    border="0">
                    <asp:TableRow>
                        <asp:TableCell CssClass="dhel"><img src="../Images/space.gif" alt=""/></asp:TableCell><asp:TableCell CssClass="dheci" valign="middle"><a onclick="toggleExpandCollapse(this);"><img id="Img1" src="../Images/DialogHeaderIconCollapse.gif" border="0" alt="Collapse panel"/></a></asp:TableCell><asp:TableCell CssClass="dhb"> <asp:Table ID="Table3" runat="server" CellPadding="0" CellSpacing="0" border="0">
                                <asp:TableRow>
                                    <asp:TableCell CssClass="dhtr" valign="middle"> <asp:Literal runat="server" ID="T_eMarine_CISTitle" Text="Add Marine Special Rate Setup"> </asp:Literal></asp:TableCell></asp:TableRow></asp:Table></asp:TableCell><asp:TableCell CssClass="dher"><img src="../Images/space.gif" alt=""/></asp:TableCell></asp:TableRow></asp:Table></asp:TableCell>
        </asp:TableRow>
        <asp:TableRow>
            <asp:TableCell> <asp:Table runat="server" ID="CollapsibleRegion" CellPadding="0" CellSpacing="0"
                    border="0" Width="100%">
                    <asp:TableRow>
                        <asp:TableCell> <asp:Table runat="server" ID="FilterRegion" CellPadding="0" CellSpacing="3" border="0">
                            </asp:Table>
                            <div class="spacer">
                            </div>
                            <asp:Table ID="Table4" runat="server" CellSpacing="0" CellPadding="0" border="0"
                                Width="100%">
                                <asp:TableRow>
                                    <asp:TableCell> <asp:Table ID="Table5" runat="server" CellSpacing="0" CellPadding="0" border="0"
                                            Width="100%">
                                            <asp:TableRow>
                                                <asp:TableCell> <asp:Table ID="Table6" runat="server" CssClass="tv" CellPadding="0" CellSpacing="0"
                                                        border="0">
                                                    </asp:Table>
                                                </asp:TableCell>
                                            </asp:TableRow>
                                        </asp:Table>
                                    </asp:TableCell>
                                </asp:TableRow>
                            </asp:Table>
                        </asp:TableCell>
                    </asp:TableRow>
                    <asp:TableRow>
                        <asp:TableCell CssClass="dialog_body"> <telerik:InformationBox Style="padding-bottom: 1em;" ID="InformationBox" ForeColor="Blue"
                                Title="    Purpose : Update rate for special condition " runat="server">
                            </telerik:InformationBox>
                            <asp:Table ID="Table8" runat="server" Width="900px">
                                <asp:TableRow>
                                    <asp:TableCell> <asp:Table ID="Table9" runat="server">
                                            <asp:TableRow>
                                                <asp:TableCell CssClass="innerTableCell"> <asp:Table ID="Table7" runat="server" CellPadding="0" CellSpacing="3" border="0">
                                                        <asp:TableRow>
                                                            <asp:TableCell CssClass="fls"> <asp:Label CssClass="fls" ID="lblType" runat="server" Text="Type :"></asp:Label></asp:TableCell><asp:TableCell CssClass="dfv">
                                                            <telerik:RadComboBox ID="radType" runat="server"  Visible="true"
                                                               AllowCustomText="true" EnableLoadOnDemand="True" ShowMoreResultsBox="true"
                                                                    Width="400px" Height="240px" EmptyMessage="Enter keyword search here"
                                                                    AutoPostBack="true" EnableVirtualScrolling="true" >
                                                                </telerik:RadComboBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*" ControlToValidate="radType"></asp:RequiredFieldValidator>
<%--                                                            <telerik:RadComboBox ID="radType" runat="server" DataTextField="thedisplay" DataValueField ="thevalue" DataSourceID ="sqlDataSource1">
                                                                </telerik:RadComboBox><asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="*" ControlToValidate="radType"></asp:RequiredFieldValidator><asp:SqlDataSource ID="sqlDataSource1" runat="server"
                                                                               ConnectionString="<%$ ConnectionStrings:eMarineConnectionString %>"
                                                                                 SelectCommand="select '~Please select~' as thedisplay,  '' as thevalue union all select 'Global' as thedisplay,  'Global' as thevalue union all select 'Local' as thedisplay,  'Local' as thevalue ">
                                                                </asp:SqlDataSource>--%>
                                                            </asp:TableCell>
                                                        </asp:TableRow>
                                                        <asp:TableRow>
                                                            <asp:TableCell CssClass="fls"> <asp:Label CssClass="fls" ID="lblconveyance" runat="server" Text="Conveyance by :"></asp:Label></asp:TableCell><asp:TableCell CssClass="dfv"> <telerik:RadComboBox ID="Radconveyance" runat="server"  Visible="true"
                                                               AllowCustomText="true" EnableLoadOnDemand="True" ShowMoreResultsBox="true"
                                                                    Width="400px" Height="240px" EmptyMessage="Enter keyword search here"
                                                                    AutoPostBack="true" EnableVirtualScrolling="true" >
                                                                     <HeaderTemplate>
                                                                        <table style="width: 375px" cellspacing="0" cellpadding="0">
                                                                            <tr>
                                                                                <td style="width: 200px;">
                                                                                    Description </td><td style="width: 175px;">
                                                                                    Conveyance </td></tr></table></HeaderTemplate><ItemTemplate>
                                                                        <table style="width: 375px" cellspacing="0" cellpadding="0">
                                                                            <tr>
                                                                                <td style="width: 200px;">
                                                                                    <%#DataBinder.Eval(Container, "Attributes['thedisplay']")%> </td><td style="width: 175px;">
                                                                                    <%#DataBinder.Eval(Container, "Attributes['thevalue']")%> </td></tr></table></ItemTemplate></telerik:RadComboBox><asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="*" ControlToValidate="Radconveyance"></asp:RequiredFieldValidator></asp:TableCell></asp:TableRow><asp:TableRow>
                                                            <asp:TableCell CssClass="fls"> <asp:Label CssClass="fls" ID="lblShipmenttype" runat="server" Text="Shipment type :"></asp:Label></asp:TableCell><asp:TableCell CssClass="dfv"> <telerik:RadComboBox ID="RadShipmenttype" runat="server"  Visible="true"
                                                               AllowCustomText="true" EnableLoadOnDemand="True" ShowMoreResultsBox="true"
                                                                    Width="400px" Height="240px" EmptyMessage="Enter keyword search here"
                                                                    AutoPostBack="true" EnableVirtualScrolling="true" >
                                                                </telerik:RadComboBox><asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="*" ControlToValidate="RadShipmentType"></asp:RequiredFieldValidator></asp:TableCell></asp:TableRow><asp:TableRow>
                                                             <asp:TableCell CssClass="fls"> <asp:Label CssClass="fls" ID="lblPacking" runat="server" Text="Packing :"></asp:Label></asp:TableCell><asp:TableCell CssClass="dfv"> <telerik:RadComboBox ID="RadPacking" runat="server"  Visible="true"
                                                               AllowCustomText="true" EnableLoadOnDemand="True" ShowMoreResultsBox="true"
                                                                    Width="400px" Height="240px" EmptyMessage="Enter keyword search here"
                                                                    AutoPostBack="true" EnableVirtualScrolling="true" >
                                                                </telerik:RadComboBox><asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="*" ControlToValidate="RadPacking"></asp:RequiredFieldValidator></asp:TableCell></asp:TableRow><asp:TableRow>
                                                             <asp:TableCell CssClass="fls"> <asp:Label CssClass="fls" ID="lblCommodity" runat="server" Text="Commodity :"></asp:Label></asp:TableCell><asp:TableCell CssClass="dfv"> <telerik:RadComboBox ID="RadCommodity" runat="server"  Visible="true"
                                                               AllowCustomText="true" EnableLoadOnDemand="True" ShowMoreResultsBox="true"
                                                                    Width="400px" Height="240px" EmptyMessage="Enter keyword search here"
                                                                    AutoPostBack="true" EnableVirtualScrolling="true" >
                                                                </telerik:RadComboBox><asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="*" ControlToValidate="RadCommodity"></asp:RequiredFieldValidator></asp:TableCell></asp:TableRow><asp:TableRow>
                                                            <asp:TableCell CssClass="fls"> <asp:Label CssClass="fls" ID="lblClientmaster" runat="server" Text="Client master :"></asp:Label></asp:TableCell><asp:TableCell CssClass="dfv"> <telerik:RadTextBox id="txtClientmaster" runat ="server" Text ="" ReadOnly ="true" ></telerik:RadTextBox>
                                                            </asp:TableCell>
                                                        </asp:TableRow>
                                                        <asp:TableRow>
                                                              <asp:TableCell CssClass="fls"> <asp:Label CssClass="fls" ID="lblExport1" runat="server" Text="Export Type :"></asp:Label></asp:TableCell><asp:TableCell CssClass="dfv">
                                                               <%--<telerik:RadComboBox ID="RadExport1" runat="server" DataTextField="thedisplay" DataValueField ="thevalue" DataSourceID ="sqlDataSource6"  Width ="300px">
                                                                </telerik:RadComboBox><asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="*" ControlToValidate="RadExport1"></asp:RequiredFieldValidator><asp:SqlDataSource ID="sqlDataSource6" runat="server"
                                                                               ConnectionString="<%$ ConnectionStrings:eMarineConnectionString %>"
                                                                                 SelectCommand="select '~Please select~' as thedisplay,  '' as thevalue union all select 'Import' as thedisplay,  'Import' as thevalue union all select 'Export' as thedisplay,  'Export' as thevalue ">
                                                                </asp:SqlDataSource>--%>
                                                                 <telerik:RadComboBox ID="RadExport1" runat="server"  Visible="true"
                                                               AllowCustomText="true" EnableLoadOnDemand="True" ShowMoreResultsBox="true"
                                                                    Width="400px" Height="240px" EmptyMessage="Enter keyword search here"
                                                                    AutoPostBack="true" EnableVirtualScrolling="true" >
                                                                </telerik:RadComboBox><asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" ErrorMessage="*" ControlToValidate="RadExport1"></asp:RequiredFieldValidator>                                                                             
                                                            </asp:TableCell>
                                                        </asp:TableRow>
                                                          <asp:TableRow>
                                                            <asp:TableCell CssClass="fls"> <asp:Label CssClass="fls" ID="Label4" runat="server" Text="Marine Rate :"></asp:Label></asp:TableCell><asp:TableCell CssClass="dfv"> <telerik:RadTextBox id="txtMarineRate" runat ="server" Text =""></telerik:RadTextBox>
                                                               <asp:CompareValidator ID="validator" runat="server" ControlToValidate="txtMarineRate" Operator="DataTypeCheck" Type="Double" ErrorMessage="Value must be a number" />
                                                               <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="*" ControlToValidate="txtMarineRate"></asp:RequiredFieldValidator></asp:TableCell></asp:TableRow><asp:TableRow>
                                                            <asp:TableCell CssClass="fls"> <asp:Label CssClass="fls" ID="Label5" runat="server" Text="WSRCC Rate :"></asp:Label></asp:TableCell><asp:TableCell CssClass="dfv"> <telerik:RadTextBox id="txtWSRCCRate" runat ="server" Text =""></telerik:RadTextBox>
                                                                <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToValidate="txtWSRCCRate" Operator="DataTypeCheck" Type="Double" ErrorMessage="Value must be a number" />
                                                                 <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" ErrorMessage="*" ControlToValidate="txtWSRCCRate"></asp:RequiredFieldValidator></asp:TableCell></asp:TableRow><asp:TableRow>
                                                            <asp:TableCell CssClass="fls"> <asp:Label CssClass="fls" ID="lblCountry" runat="server" Text="Country :"></asp:Label></asp:TableCell><asp:TableCell CssClass="dfv"> <telerik:RadComboBox ID="RadCountry" runat="server"  Visible="true"
                                                               AllowCustomText="true" EnableLoadOnDemand="True" ShowMoreResultsBox="true"
                                                                    Width="400px" Height="240px" EmptyMessage="Enter keyword search here"
                                                                    AutoPostBack="true" EnableVirtualScrolling="true" >
                                                                </telerik:RadComboBox>
                                                                 
                                                              </asp:TableCell>
                                                        </asp:TableRow>
                                                           <asp:TableRow>
                                                            <asp:TableCell CssClass="fls"> <asp:Label CssClass="fls" ID="Label6" runat="server" Text="Exclude the selected country :"></asp:Label></asp:TableCell><asp:TableCell CssClass="dfv"> <asp:CheckBox id="chkIsExclusion" Text ="The rate is apply excluded the selected country" runat ="server" />
                                                                                                                    <%--  <asp:CheckBoxList ID="ChkCoverage" runat="server" DataValueField="thevalue" DataTextField ="thedisplay" DataSourceID ="sqlDataSource2">
                                                    </asp:CheckBoxList>                                                        
                                               <asp:SqlDataSource ID="sqlDataSource2" runat="server"
                                                                               ConnectionString="<%$ ConnectionStrings:eMarineConnectionString %>"
                                                                                 SelectCommand="select 'Cover up to destination port only' as thedisplay,  'Cover up to destination port only' as thevalue union all select 'Cover up to final inland destination' as thedisplay,  'Cover up to final inland destination' as thevalue">
                                                                </asp:SqlDataSource>--%> </asp:TableCell></asp:TableRow><asp:TableRow>
                                                            <asp:TableCell CssClass="fls"> <asp:Label CssClass="fls" ID="Label2" runat="server" Text="Ports :"></asp:Label></asp:TableCell><asp:TableCell CssClass="dfv"> <asp:CheckBoxList ID="ChkRelatedPort" runat="server" DataValueField="Ports" DataTextField ="Ports" RepeatColumns="10" TextAlign="Left">
                                                    </asp:CheckBoxList>                                                        
                                                   <%-- <telerik:RadTreeView ID="tvChkPorts" runat="server" >
                                                    </telerik:RadTreeView>
                                                                                               <asp:Label ID="lblErrTreeViewValidate" Visible="false" ForeColor="Red" runat="server"
                                                        Text="* Please select at least one check box!">
                                                    </asp:Label>--%> </asp:TableCell></asp:TableRow><asp:TableRow>
                                                            <asp:TableCell CssClass="fls"> <asp:Label CssClass="fls" ID="Label1" runat="server" Text="Coverage :"></asp:Label></asp:TableCell><asp:TableCell CssClass="dfv"> <asp:CheckBox id="chkCoverPort" Text ="Cover up to destination port only" runat ="server" onclick="CheckCP(this);"/>
                                                            <asp:CheckBox id="chkCoverDest" Text ="Cover up to final inland destination" runat ="server" onclick="CheckCD(this);"  />
                                                         <%--  <asp:CheckBoxList ID="ChkCoverage" runat="server" DataValueField="thevalue" DataTextField ="thedisplay" DataSourceID ="sqlDataSource2">
                                                    </asp:CheckBoxList>                                                        
                                               <asp:SqlDataSource ID="sqlDataSource2" runat="server"
                                                                               ConnectionString="<%$ ConnectionStrings:eMarineConnectionString %>"
                                                                                 SelectCommand="select 'Cover up to destination port only' as thedisplay,  'Cover up to destination port only' as thevalue union all select 'Cover up to final inland destination' as thedisplay,  'Cover up to final inland destination' as thevalue">
                                                                </asp:SqlDataSource>--%> </asp:TableCell></asp:TableRow><asp:TableRow>
                                                            <asp:TableCell CssClass="fls"> <asp:Label CssClass="fls" ID="Label3" runat="server" Text="Description :"></asp:Label></asp:TableCell><asp:TableCell CssClass="dfv"> <telerik:RadTextBox id="raddesciption" runat ="server" ></telerik:RadTextBox> 
                                                              </asp:TableCell>
                                                        </asp:TableRow>
                                                         
                                        </asp:Table>
                                    </asp:TableCell>
                                     
                                      <asp:TableCell></asp:TableCell></asp:TableRow><asp:TableRow>
                                                           <asp:TableCell> <telerik:RadButton ID="btnSaveNClose" CausesValidation="false" runat="server"
                                                                    Text="Save and Close">
                                                                </telerik:RadButton>
                                                            <telerik:RadButton ID="btnSaveNCopyNew" CausesValidation="false" runat="server" Text="Save, Copy and New">
                                                                </telerik:RadButton>
                                                            <telerik:RadButton ID="btnClear" CausesValidation="false" runat="server" Text="Clear">
                                                                </telerik:RadButton>
                                                            <telerik:RadButton ID="btnCancel" CausesValidation="false" runat="server" Text="Cancel">
                                                                </telerik:RadButton>
                                                            </asp:TableCell> <asp:TableCell></asp:TableCell>
                                    </asp:TableRow>
                                                     <%--   <asp:TableRow Style="padding-bottom: 1em;">
                                                            <asp:TableCell></asp:TableCell></asp:TableRow><asp:TableRow>
                                                            <asp:TableCell></asp:TableCell><asp:TableCell> <telerik:RadButton ID="btnSaveNClose" CausesValidation="false" runat="server"
                                                                    Text="Save and Close">
                                                                </telerik:RadButton>
                                                            </asp:TableCell>
                                                            
                                                            <asp:TableCell> <telerik:RadButton ID="btnSaveNCopyNew" CausesValidation="false" runat="server" Text="Save, Copy and New">
                                                                </telerik:RadButton>
                                                            </asp:TableCell>
                                                                 <asp:TableCell> <telerik:RadButton ID="btnClear" CausesValidation="false" runat="server" Text="Clear">
                                                                </telerik:RadButton>
                                                            </asp:TableCell>
                                                                 <asp:TableCell> <telerik:RadButton ID="btnCancel" CausesValidation="false" runat="server" Text="Cancel">
                                                                </telerik:RadButton>
                                                            </asp:TableCell>
                                                        </asp:TableRow>--%>
                                                    </asp:Table>
                                                </asp:TableCell>
                                            </asp:TableRow>
                                        </asp:Table>
                                    </asp:TableCell>
                         <%--           <asp:TableCell CssClass="innerTableCell">
                                          <telerik:InformationBox ID="InformationBox1" ForeColor="Blue" runat="server">
                                            Tips :
                                            <ul>
                                                <li>1. </li>
                                            </ul>
                                        </telerik:InformationBox>
                                            </asp:TableCell>--%></asp:TableRow></asp:Table></asp:TableCell>
                    </asp:TableRow>
            
                </asp:Table>
            </asp:TableCell>
        </asp:TableRow>
    </asp:Table>
    <telerik:RadScriptBlock ID="radScriptBlock1" runat="server">
 
        <script type="text/javascript">
            function closeCustomConfirm() {
                $find("<%=rw_customConfirm.ClientID %>").close();
            }
 
            function closeCustomAlert() {
                $find("<%=rw_customAlert.ClientID %>").close();
            }
             
            function CheckCP(CheckBox1) {
 
                //                var ctlCover = document.getElementById("chkCoverDest");
                var ctlCover = document.getElementById("ctl00_ContentPlaceHolder1_chkCoverDest");
                 
                if (CheckBox1.checked) {
                    ctlCover.checked = false;
                }
                else {
                    ctlCover.checked = true;
                }
 
            }
 
            function CheckCD(CheckBox1) {
 
                //                var ctlCover = document.getElementById("chkCoverPort");
                var ctlCover = document.getElementById("ctl00_ContentPlaceHolder1_chkCoverPort");
 
                if (CheckBox1.checked) {
                    ctlCover.checked = false;
                }
                else {
                    ctlCover.checked = true;
                }
 
            }
        </script>
 
 
    </telerik:RadScriptBlock>
</asp:Content>
Angel Petrov
Telerik team
 answered on 17 May 2013
3 answers
701 views
Hi, after updating to q1 2013 set of controls I ran into issue with tabindex on the radbuttons. 
Buttons (more precisely - inputs that are hidden by span) by default are assigned tabindex -1. 
This causing these button to drop off from the page when user uses tab button on keyboard to navigate.
Now, i realize that I can specifically set tabindex for all buttons, however it is not feasible in our application - we simply don't know where those buttons will appear on the next page load and what index is to assign, so hard-coding tabindex is not an option.

I tried to remove these -1 with jQuery code, but for some reason it doesn't work in IE9, Firefox is ok though...

So the question is - is there a way to NOT assign  tabindex=-1 to the RadButtons and let browser handle keyboard navigation (or remove it after page is loaded, given that we don't know how many buttons there will be and where they will appear)?

Danail Vasilev
Telerik team
 answered on 17 May 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?