Telerik Forums
UI for ASP.NET AJAX Forum
0 answers
121 views
  1. is there a way to position the textboxes right below the handles of the slider displaying the handle's value? such that the textbox moves as the handle moves
Ashwijini
Top achievements
Rank 1
 asked on 02 May 2013
4 answers
936 views

Currently have a rad grid that will load fine in development but once it is moved into production receive a script timeout error.   In Production, the first load of the page works but have a RadComboBox that allows for Autopostback that changes the results in my RadGrid.  It is at this point that I receive the timeout.  Each time in production it will timeout after 30 seconds and have not figured out a way to stop it from timing out.  I have compared the values with IIS to compare script timeouts and they are the same.  It is trying to process 19,000 records, which I know it may take some time to query but in development the query doesn't take long at all to complete.

Following code is in web.config

<httpRuntime maxRequestLength="612353" executionTimeout="600"/>

Code found in ASPX page as I seen this suggested by others.

<telerik:RadScriptManager ID="RadScriptManager1" Runat="server"
    AsyncPostBackTimeout="600"></telerik:RadScriptManager>

Also added the following to my code and did not affect the outcome:

ValidateRequest="false"


In an attempt to resolve the problem I changed how my RadGrid would receive the data from client-side to code-behind where I could specify the command timeout and this has only caused the page to load for 5 seconds and not even return indications of and error.  Just not update my RadGrid, though it will change a information box that was created.

Looking for suggestions that might help in resolving this error. 

Kurt Kluth
Top achievements
Rank 1
 answered on 02 May 2013
6 answers
652 views
Hi, can I hide the expander on an ASP.NET radTreeView node?  I'm expanding the entire list upon load with checkboxes and don't want the users to expand/collapse since they are selecting search criteria. 

Thanks, Dave.
Plamen
Telerik team
 answered on 02 May 2013
3 answers
336 views
So I've created a grid that has a number of template columns that should remain entirely in "edit mode" (I set this in my C# code) so that I can edit my grid "live" (Excel like). Below is just a portion of my grid. When I'm trying to do the update, however, I don't know how to read the values from each cell in the grid. I've tried to do loops  such as Radgrid1.Items[i].Cells[j], and Radgrid1.Items[i].ExtractValues. I've also followed the batch update on this site but this doesn't work either. The question comes down to: How can I get data from each cell of the RadGrid. The cells can be anything from drop down menus to text boxes. Any help would be greatly appreciated

-Matt
    
        <telerik:RadGrid ID="RadGrid1" runat="server" Width="70%" AllowPaging="True"  
            Height="400px" AllowMultiRowEdit="True"   
             BorderColor="Black" BorderWidth="1px"  
            onselectedindexchanged="RadGrid1_SelIndexChange"  
            onprerender="RadGrid1_PreRender"  
            OnItemCommand="RadGrid1_ItemCommand" 
            onNeedDataSource="RadGrid1_NeedDataSource1" onitemdatabound="RadGrid1_ItemDataBound"  
             AllowAutomaticUpdates="True" 
            > 
            <AlternatingItemStyle BackColor="#E8E8E8" Font-Bold="False" Font-Italic="False"  
                Font-Overline="False" Font-Strikeout="False" Font-Underline="False"  
                Wrap="True" BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" /> 
            <MasterTableView AutoGenerateColumns="False"  
                Width="100%" BorderColor="Black" BorderWidth="0px" GridLines="None"  
                EditMode="InPlace"  
                CommandItemDisplay="TopAndBottom" > 
                <Columns>  
                 
           <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" /> 
                          
                    <telerik:GridTemplateColumn UniqueName="DeleteColumn" HeaderStyle-Width="70px"> 
                        <EditItemTemplate> 
                            <asp:Button ID="DeleteButton" runat="server" Text="Delete" /> 
                        </EditItemTemplate> 
 
<HeaderStyle Width="70px"></HeaderStyle> 
                    </telerik:GridTemplateColumn> 
 
                    <telerik:GridTemplateColumn DataField="role" HeaderText="Role"  
                        SortExpression="role" UniqueName="role" HeaderStyle-Width="150px"> 
                        <EditItemTemplate> 
                            <asp:Label ID="roleLabel" runat="server" Text='<%# Eval("role") %>' Width="150px"></asp:Label> 
                        </EditItemTemplate> 
                        <HeaderTemplate> 
                            <asp:Label ID="rol_label" runat="server" Text="Role"></asp:Label> 
                        </HeaderTemplate>                 
 
</Columns> 
                  <CommandItemTemplate> 
                       <asp:Button runat="server" ID="UpdateAll" Text="Update All" CommandName="UpdateAll" /></CommandItemTemplate> 
                 
                 
            </MasterTableView> 
             
            <ClientSettings> 
                <Selecting AllowRowSelect="True" /> 
                <Scrolling ScrollHeight="100%" AllowScroll="True"  /> 
                <resizing allowcolumnresize="True"  /> 
            </ClientSettings> 
        </telerik:RadGrid>
Eyup
Telerik team
 answered on 02 May 2013
1 answer
112 views

I have a Radgrid with EnableHeaderContextMenu enabled to allow users to show/hide columns.

The checkbox and the label in column chooser window do not align.

Attached is the screenshot showing the behavior.

Eyup
Telerik team
 answered on 02 May 2013
1 answer
132 views
Hi, I am trying to allow inline editing of a radgrid, and I have a column that can either be text (including html) or a url. When we try to edit this row and accept or cancel the changes, in google chrome nothing happens, in internet explored and unhandled exception is thrown. Am I not able to accept html/urls?

Attached is the error from ie. Thanks.

<telerik:RadGrid ID="rgMain" runat="server" AllowPaging="false" AllowSorting="false"
                        AllowMultiRowSelection="false" AutoGenerateColumns="False" OnItemCommand="rgMain_ItemCommand"
                        HorizontalAlign="NotSet" AllowAutomaticDeletes="False" AllowAutomaticInserts="False"
                        AllowAutomaticUpdates="true" Width="100%" VirtualItemCount="0" AllowFilteringByColumn="false"
                        ShowGroupPanel="False">
                        <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
                        <ClientSettings ReorderColumnsOnClient="false" AllowColumnsReorder="false" EnableRowHoverStyle="false"
                            AllowGroupExpandCollapse="true" AllowExpandCollapse="true" />
                        <MasterTableView DataKeyNames="DryRunDetailsID" GridLines="None" AllowMultiColumnSorting="True"
                            AutoGenerateColumns="False" HorizontalAlign="NotSet" CommandItemDisplay="Top"
                            EditMode="InPlace" AllowAutomaticUpdates="true" GroupLoadMode="Client">
                            <ItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
                            <HeaderStyle HorizontalAlign="Left" VerticalAlign="Top" />
                            <AlternatingItemStyle HorizontalAlign="Left" VerticalAlign="Top" />
                            <GroupByExpressions>
                                <telerik:GridGroupByExpression>
                                    <SelectFields>
                                        <telerik:GridGroupByField FieldAlias="DryRunDate" FieldName="DryRunDate" FormatString="{0:dddd MMMM d}"
                                            HeaderText="Date"></telerik:GridGroupByField>
                                    </SelectFields>
                                    <GroupByFields>
                                        <telerik:GridGroupByField FieldAlias="DryRunDate" FieldName="DryRunDate" SortOrder="Ascending"
                                            FormatString="{0:dddd MMMM d}"></telerik:GridGroupByField>
                                    </GroupByFields>
                                </telerik:GridGroupByExpression>
                            </GroupByExpressions>
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="">
                                    <ItemTemplate>
                                        <asp:Label ID="lblRowCount" runat="server" />
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                                    <ItemStyle CssClass="MyImageButton" />
                                </telerik:GridEditCommandColumn>
                                <telerik:GridDropDownColumn DataField="ClassID" DataSourceID="SqlDataSource1" HeaderText="ClassNumberPrefix"
                                    ListTextField="ClassNumberPrefix" ListValueField="ClassID" UniqueName="ClassNumberPrefix"
                                    EnableEmptyListItem="true" EmptyListItemText=" " EmptyListItemValue="0">
                                </telerik:GridDropDownColumn>
                                <telerik:GridBoundColumn UniqueName="PrimaryPresenter" SortExpression="PrimaryPresenter"
                                    HeaderText="Primary Presenter" DataField="PrimaryPresenter" ReadOnly="true">
                                </telerik:GridBoundColumn>
                                <telerik:GridDateTimeColumn DataField="DryRunStartTime" HeaderText="Start Date" SortExpression="DryRunStartTime" UniqueName="DryRunStartTime" DataType="System.DateTime" PickerType="DateTimePicker"></telerik:GridDateTimeColumn>
                                <telerik:GridDateTimeColumn DataField="DryRunEndTime" HeaderText="End Date" SortExpression="DryRunEndTime" UniqueName="DryRunEndTime" DataType="System.DateTime" PickerType="DateTimePicker"></telerik:GridDateTimeColumn>
                                <telerik:GridBoundColumn UniqueName="DryRunLocation" SortExpression="DryRunLocation"
                                    HeaderText="Location" DataField="DryRunLocation" ReadOnly="false">
                                </telerik:GridBoundColumn>
                                <telerik:GridDropDownColumn DataField="DryRunCoordinatorID" DataSourceID="SqlDataSource2"
                                    HeaderText="Slot Owner" ListTextField="CoordinatorName" ListValueField="DryRunCoordinatorID"
                                    UniqueName="SlotOwner" EnableEmptyListItem="true" EmptyListItemText=" "
                                    EmptyListItemValue="0">
                                </telerik:GridDropDownColumn>
                            </Columns>
                            <ExpandCollapseColumn ButtonType="ImageButton" Visible="true" UniqueName="ExpandColumn">
                                <HeaderStyle Width="19px"></HeaderStyle>
                            </ExpandCollapseColumn>
                            <RowIndicatorColumn ItemStyle-Width="0px" HeaderStyle-Width="0px" />
 
                        </MasterTableView>
                    </telerik:RadGrid>
Eyup
Telerik team
 answered on 02 May 2013
6 answers
392 views
When going to a page with the radchart control on it, we're seeing this error:

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly.

Requested URL: /performance/reports/ChartImage.axd


What can we do to fix this? Are we missing a config setting? It's important to note that right now the radchart control is in a user control which is on the page that is displaying the error.

Thanks for any help.
Jeny
Top achievements
Rank 1
 answered on 02 May 2013
1 answer
118 views

Hi, I am using telerik radgrid in my application with below markup : When in the application i m increasing the page size from 20 to 50 or more , it thows me error. Could you pls suggest what needs to be corrected from code perspective?
 
<telerik:RadGrid ID="gvHazardCategories" runat="server" 
AutoGenerateColumns="False"

AllowPaging="True"
 
PageSize="20"

AllowSorting="True"

DataSourceID="odsHazardCategories"

GridLines="None"

AllowFilteringByColumn="true"
 
OnInit="gvHazardCategories_Init"
 
OnDeleteCommand="gvHazardCategories_DeleteCommand"

OnInsertCommand="gvHazardCategories_InsertCommand"

OnUpdateCommand="gvHazardCategories_UpdateCommand"

OnItemCreated="gvHazardCategories_ItemCreated"
 
OnItemCommand="gvHazardCategories_ItemCommand"
 
OnPreRender="gv_PreRender"
 >
 

using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Fourleaf.Websites.DEC.Web;
using Fourleaf.Websites.DEC.Core;
using Fourleaf.Websites.DEC.Business;
using Telerik.Web.UI;
using System.Collections.Specialized;
using Microsoft.Practices.EnterpriseLibrary.ExceptionHandling;
 
public partial class DataAdmin_HazardCategories : BasePage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        SetupPage("Hazard Category Management", FourleafUser.UserLevelType.Administrator);
    }
 
    #region gvHazardCategories
 
    protected void gvHazardCategories_Init(object sender, EventArgs e)
    {
        try
        {
            TelerikUtil.ConfigureFilterItems(((RadGrid)sender).FilterMenu);
        }
        catch (Exception ex)
        {
            bool rethrow = ExceptionPolicy.HandleException(ex, CurrentSite.Instance.Error_UI_Policy_Name);
            NameValueCollection errDetail = new NameValueCollection(1);
            errDetail.Add("UserErrorMessage", UserErrorMessage);
            ExceptionHandler handler = new ExceptionHandler(ex, errDetail);
        }
    }
    //protected void gvHazardCategories_hPageIndexChanged(object sender, GridCommandEventArgs e)
    //{
    //    try
    //    {
    //        gvHazardCategories.CurrentPageIndex = e.NewPageIndex;
    //        //ShowGrid(-1);
    //        gvHazardCategories.DataBind();
    //    }
    //    catch (Exception ex)
    //    {
    //        bool rethrow = ExceptionPolicy.HandleException(ex, CurrentSite.Instance.Error_UI_Policy_Name);
    //        NameValueCollection errDetail = new NameValueCollection(1);
    //        errDetail.Add("UserErrorMessage", UserErrorMessage);
    //        ExceptionHandler handler = new ExceptionHandler(ex, errDetail);
    //    }
    //}
 
    protected void gvHazardCategories_ItemCommand(object source, GridCommandEventArgs e)
    {
        try
        {
            //Used to close any open edit forms when the insert form is displayed and vice versa
            RadGrid grid = (RadGrid)source;
            TelerikUtil.CloseOppositeForm(grid, e);
 
            if (e.Item is GridEditableItem & !e.Item.IsInEditMode)
            {
                Hazard_Category _Business = new Hazard_Category();
                //Get edited item
                GridEditableItem editedItem = (GridEditableItem)e.Item;
                //Get values
                int HazardCategoryId = Conversion.ToInt32Default(editedItem.GetDataKeyValue("Hazard_Category_Id"), 0);
 
                if (HazardCategoryId > 0)
                {
                    switch (e.CommandName.ToUpper())
                    {
                        case "UP":
                            _Business.MoveUp(HazardCategoryId);
                            gvHazardCategories.Rebind();
                            break;
                        case "DOWN":
                            _Business.MoveDown(HazardCategoryId);
                            gvHazardCategories.Rebind();
                            break;
                    }
                }
            }
        }
        catch (Exception ex)
        {
            bool rethrow = ExceptionPolicy.HandleException(ex, CurrentSite.Instance.Error_UI_Policy_Name);
            NameValueCollection errDetail = new NameValueCollection(1);
            errDetail.Add("UserErrorMessage", UserErrorMessage);
            ExceptionHandler handler = new ExceptionHandler(ex, errDetail);
        }
    }
 
 
    protected void gvHazardCategories_DeleteCommand(object source, GridCommandEventArgs e)
    {
        try
        {
            //Get edited item
            GridEditableItem editedItem = (GridEditableItem)e.Item;
 
            //Get values
            int HazardCategoryId = Conversion.ToInt32Default(editedItem.GetDataKeyValue("Hazard_Category_Id"), 0);
 
            //Check values are legit
            if (HazardCategoryId <= 0)
            {
                e.Canceled = true;
            }
            else
            {
                //Do the work
                Hazard_Category _Business = new Hazard_Category();
                _Business.Delete(HazardCategoryId);
            }
        }
        catch (Exception ex)
        {
            bool rethrow = ExceptionPolicy.HandleException(ex, CurrentSite.Instance.Error_UI_Policy_Name);
            NameValueCollection errDetail = new NameValueCollection(1);
            errDetail.Add("UserErrorMessage", UserErrorMessage);
            ExceptionHandler handler = new ExceptionHandler(ex, errDetail);
        }
    }
 
    protected void gvHazardCategories_InsertCommand(object source, GridCommandEventArgs e)
    {
        try
        {
            //Get edited item
            GridEditableItem editedItem = (GridEditableItem)e.Item;
 
            //Get error label and reset it
            Label lblError = (Label)Functions.FindControlRecursive(editedItem.OwnerTableView, "lblError");
            lblError.Text = "";
 
            //Get values
            string HazardCategoryName = Conversion.ToStringDefault(((TextBox)Functions.FindControlRecursive(editedItem.OwnerTableView, "txtEditName")).Text);
            int AboveOrBelow = Conversion.ToInt32Default(((RadComboBox)Functions.FindControlRecursive(editedItem.OwnerTableView, "cmbAboveBelow")).SelectedValue, 0);
            int ReferenceId = Conversion.ToInt32Default(((RadComboBox)Functions.FindControlRecursive(editedItem.OwnerTableView, "cmbHazardCategories")).SelectedValue, 0);
 
 
            //Check values are legit
            if (HazardCategoryName.Trim() == "")
            {
                e.Canceled = true;
            }
            else
            {
                //Do the work
                Hazard_Category _Business = new Hazard_Category();
                int i = _Business.Insert(HazardCategoryName, AboveOrBelow, ReferenceId);
 
                if (i == -1)
                {
                    lblError.Text = string.Format("The database already contains a record for '{0}'", HazardCategoryName);
                    lblError.Visible = true;
                    e.Canceled = true;
                }
            }
 
            //Check to see if we need to display error
            if (e.Canceled == true && lblError.Text == "")
            {
                lblError.Text = "Please complete all the required fields.";
                lblError.Visible = true;
            }
        }
        catch (Exception ex)
        {
            bool rethrow = ExceptionPolicy.HandleException(ex, CurrentSite.Instance.Error_UI_Policy_Name);
            NameValueCollection errDetail = new NameValueCollection(1);
            errDetail.Add("UserErrorMessage", UserErrorMessage);
            ExceptionHandler handler = new ExceptionHandler(ex, errDetail);
        }
    }
 
    protected void gvHazardCategories_UpdateCommand(object source, GridCommandEventArgs e)
    {
        try
        {
            //Get edited item
            GridEditableItem editedItem = (GridEditableItem)e.Item;
 
            //Get error label and reset it
            Label lblError = (Label)Functions.FindControlRecursive(editedItem.OwnerTableView, "lblError");
            lblError.Text = "";
 
            //Get values
            int HazardCategoryId = Conversion.ToInt32Default(editedItem.GetDataKeyValue("Hazard_Category_Id"), 0);
            string HazardCategoryName = Conversion.ToStringDefault(((TextBox)editedItem.FindControl("txtEditName")).Text);
            int HazardCategorySort = Conversion.ToInt32Default(editedItem.GetDataKeyValue("Hazard_Category_Sort"), 0);
 
            //Check values are legit
            if (HazardCategoryId <= 0 || HazardCategoryName.Trim() == "")
            {
                e.Canceled = true;
            }
            else
            {
                //Do the work
                Hazard_Category _Business = new Hazard_Category();
                _Business.Update(HazardCategoryId, HazardCategoryName, HazardCategorySort);
            }
 
            //Check to see if we need to display error
            if (e.Canceled == true && lblError.Text == "")
            {
                lblError.Text = "Please complete all the required fields.";
                lblError.Visible = true;
            }
        }
        catch (Exception ex)
        {
            bool rethrow = ExceptionPolicy.HandleException(ex, CurrentSite.Instance.Error_UI_Policy_Name);
            NameValueCollection errDetail = new NameValueCollection(1);
            errDetail.Add("UserErrorMessage", UserErrorMessage);
            ExceptionHandler handler = new ExceptionHandler(ex, errDetail);
        }
    }
 
    protected void gvHazardCategories_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        try
        {
            if (e.Item is GridHeaderItem)
            {
            }
 
            if (e.Item is GridDataItem)
            {
                GridDataItem dataItem = e.Item as GridDataItem;
                Button btDelete = null;
                int CategoryCount = Conversion.ToInt32Default(dataItem.GetDataKeyValue("Hazard_Category_Count"));
 
                btDelete = ((Button)dataItem["HC_Actions"].Controls[3]);
 
                if (CategoryCount == 0)
                {
                    btDelete.Visible = true;
                }
                else
                {
                    btDelete.Visible = false;
                }
 
                //Hide sort order buttons
                int IsFirst = Conversion.ToInt32Default(dataItem.GetDataKeyValue("IsFirst"));
                int IsLast = Conversion.ToInt32Default(dataItem.GetDataKeyValue("IsLast"));
 
                if (IsFirst == 1)
                {
                    dataItem["HC_Up"].Controls[0].Visible = false;
                    dataItem["HC_Up"].Text = " ";
                }
                if (IsLast == 1)
                {
                    dataItem["HC_Down"].Controls[0].Visible = false;
                    dataItem["HC_Down"].Text = " ";
                }
            }
 
            if (e.Item is GridEditFormItem && e.Item.IsInEditMode)
            {
                GridEditFormItem item = (GridEditFormItem)e.Item;
                //Loop through all items in grid adding help tooltips where necessary
                foreach (Control c in item.Controls[1].Controls[0].Controls)
                {
                    if (c.GetType() == typeof(Label))
                    {
                        Label lbl = (Label)item.FindControl(c.ID);
                        if (lbl.CssClass == "help_label")
                        {
                            lbl.ToolTip = new HelpText().GetTooltip(c.ID, "Hazard Category Management");
                        }
                    }
                }
            }
        }
        catch (Exception ex)
        {
            bool rethrow = ExceptionPolicy.HandleException(ex, CurrentSite.Instance.Error_UI_Policy_Name);
            NameValueCollection errDetail = new NameValueCollection(1);
            errDetail.Add("UserErrorMessage", UserErrorMessage);
            ExceptionHandler handler = new ExceptionHandler(ex, errDetail);
        }
    }
 
    protected void gv_PreRender(object sender, System.EventArgs e)
    {
        RadGrid aGrid = (RadGrid)sender;
 
        if (aGrid.MasterTableView.IsItemInserted)
        {
            RadComboBox aCombo = (RadComboBox)Functions.FindControlRecursive(aGrid.MasterTableView, "cmbHazardCategories");
            if (aCombo != null)
            {
                aCombo.Items[aCombo.Items.Count - 1].Selected = true;
            }
        }
    }
 
    #endregion
 
    protected void Toolbar_ButtonClick(object sender, RadToolBarEventArgs e)
    {
        try
        {
 
            RadToolBarButton thisButton = (RadToolBarButton)e.Item;
 
            if (thisButton.CommandName.ToUpper() == "CLEARFILTERS")
            {
                GridTableView gtv = ((GridTableView)((RadToolBar)sender).Parent.Parent.Parent.Parent.Parent);
                foreach (GridColumn column in gtv.Columns)
                {
                    column.CurrentFilterFunction = GridKnownFunction.NoFilter;
                    column.CurrentFilterValue = string.Empty;
                }
                gtv.FilterExpression = string.Empty;
                gtv.Rebind();
            }
        }
        catch (Exception ex)
        {
            bool rethrow = ExceptionPolicy.HandleException(ex, CurrentSite.Instance.Error_UI_Policy_Name);
            NameValueCollection errDetail = new NameValueCollection(1);
            errDetail.Add("UserErrorMessage", UserErrorMessage);
            ExceptionHandler handler = new ExceptionHandler(ex, errDetail);
        }
 
    }
}
<%@ Page Title="" Language="C#" MasterPageFile="../Core/MasterPage.master" AutoEventWireup="true" CodeFile="HazardCategories.aspx.cs" Inherits="DataAdmin_HazardCategories" %>
<%@ Register TagPrefix="ucDEC" TagName="HelpPage" Src="../UserControls/HelpPage.ascx" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolderMain" Runat="Server">
 
    <span style="float: right; line-height: 20px;">
        <ucDEC:HelpPage ID="ucHelp" runat="server" PageName="Hazard_Category" Title="Help - Hazard Category Management" />
    </span>
     
    <h4>Hazard Category Management</h4>
     
    <asp:Panel ID="pnlInstructions" runat="server">
        <p>
            Each requirement is classified according to one of the Hazard Categories from the list shown below.
            <br /><br />
            This screen is used to modify the list of existing Hazard Categories or add new ones. A new Hazard Category can be inserted between existing categories if required.
        </p>
    </asp:Panel>
    <telerik:RadGrid ID="gvHazardCategories" runat="server"
        AutoGenerateColumns="False"
        AllowPaging="True"
        PageSize="20"
        AllowSorting="True" 
        DataSourceID="odsHazardCategories"
        GridLines="None"
        AllowFilteringByColumn="true"
        OnInit="gvHazardCategories_Init"
        OnDeleteCommand="gvHazardCategories_DeleteCommand"
        OnInsertCommand="gvHazardCategories_InsertCommand"
        OnUpdateCommand="gvHazardCategories_UpdateCommand"
        OnItemCreated="gvHazardCategories_ItemCreated"
        OnItemCommand="gvHazardCategories_ItemCommand"
        OnPreRender="gv_PreRender"
        >
        <MasterTableView
            DataKeyNames="Hazard_Category_Id, Hazard_Category_Nm, Hazard_Category_Count, Hazard_Category_Sort, IsFirst, IsLast"
            DataSourceID="odsHazardCategories" 
            InsertItemPageIndexAction="ShowItemOnCurrentPage"
            CommandItemDisplay="Top"
            TableLayout="Fixed"
            >
            <PagerStyle AlwaysVisible="true" />
            <RowIndicatorColumn>
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <CommandItemTemplate>
                <telerik:RadToolBar ID="tbGroups" runat="server" OnButtonClick="Toolbar_ButtonClick">
                    <Items>
                        <telerik:RadToolBarButton Text="New"
                            Visible="true"
                            CommandName='<%# RadGrid.InitInsertCommandName %>' ImageUrl="../Core/images/new.gif">
                        </telerik:RadToolBarButton>
                        <telerik:RadToolBarButton Text="Refresh"
                            Visible="true"
                            CommandName='<%# RadGrid.RebindGridCommandName %>' ImageUrl="../Core/images/refresh.gif">
                        </telerik:RadToolBarButton>
                        <telerik:RadToolBarButton Text="Export to Excel"
                            Visible="false"
                            CommandName='<%# RadGrid.ExportToExcelCommandName %>' ImageUrl="../Core/images/excel.gif">
                        </telerik:RadToolBarButton>
                        <telerik:RadToolBarButton Text="Output to PDF"
                            Visible="false"
                            CommandName='<%# RadGrid.ExportToPdfCommandName %>' ImageUrl="../Core/images/pdf.gif">
                        </telerik:RadToolBarButton>
                        <telerik:RadToolBarButton Text="Clear Filters"
                            Visible="true"
                            CommandName='CLEARFILTERS' ImageUrl="../Core/images/clear_filters.gif">
                        </telerik:RadToolBarButton>
                    </Items>
                </telerik:RadToolBar>
            </CommandItemTemplate>
            <Columns>
                <telerik:GridBoundColumn UniqueName="HC_ID" HeaderText=""
                    ReadOnly="true" Visible="false"
                    DataField="Hazard_Category_Id">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="HC_Sort" HeaderText=""
                    ReadOnly="true" Visible="false"
                    DataField="Hazard_Category_Sort">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn UniqueName="HC_Name" HeaderText="Name"
                    AutoPostBackOnFilter="true"
                    CurrentFilterFunction="Contains"
                    ShowFilterIcon="false"
                    DataField="Hazard_Category_Nm">
                </telerik:GridBoundColumn>
                <telerik:GridButtonColumn UniqueName="HC_Up"
                    HeaderStyle-Width="40px"
                    ButtonType="ImageButton"
                    CommandName="Up"
                    Text="Move Up"
                    ImageUrl="../Core/Images/move_up.gif"
                    ItemStyle-HorizontalAlign="Center"
                    ItemStyle-VerticalAlign="Middle"
                    >
                </telerik:GridButtonColumn>
                <telerik:GridButtonColumn UniqueName="HC_Down"
                    HeaderStyle-Width="40px"
                    ButtonType="ImageButton"
                    CommandName="Down"
                    ImageUrl="../Core/Images/move_down.gif"
                    Text="Move Down"
                    ItemStyle-HorizontalAlign="Center"
                    ItemStyle-VerticalAlign="Middle"
                    >
                </telerik:GridButtonColumn>
                <telerik:GridTemplateColumn UniqueName="HC_Actions" HeaderText="" Visible="true"
                    AllowFiltering="false"
                    HeaderStyle-Width="120px"
                    >
                    <ItemTemplate>
                        <asp:Button ID="bt_HC_Edit" runat="server" Text="Edit" CommandName="Edit" />
                        <asp:Button ID="bt_HC_Delete" runat="server" Text="Delete" CommandName="Delete" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
            <EditFormSettings EditColumn-ButtonType="PushButton" EditFormType="Template">
            <FormTemplate>
                <table>
                    <tr>
                        <td colspan="2">
                            <asp:Label ID="lblError" runat="server" Text="" Visible="false" CssClass="errormsg" />
                        </td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="lblEditName" runat="server" Text="Hazard Name: " CssClass="">Hazard Name: <span class="errormsg">*</span></asp:Label></td>
                        <td><asp:TextBox ID="txtEditName" runat="server" Text='<%#DataBinder.Eval(Container.DataItem, "Hazard_Category_Nm")%>'></asp:TextBox></td>
                    </tr>
                    <tr>
                        <td><asp:Label ID="lblInsertItem" runat="server" Text="Insert Hazard "
                            Visible='<%# (Container is GridEditFormInsertItem) ? true : false %>' CssClass="">Insert Hazard: <span class="errormsg">*</span></asp:Label></td>
                        <td>
                            <telerik:RadComboBox ID="cmbAboveBelow" runat="server"
                                Visible='<%# (Container is GridEditFormInsertItem) ? true : false %>'
                                >
                                <Items>
                                    <telerik:RadComboBoxItem Text="Below" Value="1" />
                                    <telerik:RadComboBoxItem Text="Above" Value="-1" />
                                </Items>
                            </telerik:RadComboBox>
                            <asp:Literal ID="litSpacer" runat="server" text=" " Visible='<%# (Container is GridEditFormInsertItem) ? true : false %>' />
                            <telerik:RadComboBox ID="cmbHazardCategories" runat="server"
                                AppendDataBoundItems="true"
                                EnableItemCaching="true"
                                DataSourceID="odsHazardCategories"
                                DataTextField="Hazard_Category_Nm"
                                DataValueField="Hazard_Category_Id"
                                Width="200px"
                                Visible='<%# (Container is GridEditFormInsertItem) ? true : false %>'
                                >
                            </telerik:RadComboBox>
                        </td>
                    </tr>
                    <tr>
                    <td> </td>
                    <td class="radGridEditLabel">
                        <asp:Button ID="bt_Detail_Update" runat="server"
                            CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
                            Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' />
                        <asp:Button ID="bt_Detail_Cancel" runat="server" CausesValidation="False"
                            CommandName="Cancel" Text="Cancel" />
                    </td>
                </tr>
                </table>
            </FormTemplate>
            </EditFormSettings>
        </MasterTableView>
        <ValidationSettings
            CommandsToValidate="PerformInsert,Update"
            EnableValidation="true"
            ValidationGroup="vgHazardCategory" />
        <GroupingSettings
            CaseSensitive="False" />
        <ClientSettings>
            <Selecting AllowRowSelect="false" />
        </clientsettings>
    </telerik:RadGrid>
     
     
    <asp:ObjectDataSource ID="odsHazardCategories" runat="server"
        SelectMethod="ListOrdered"
        TypeName="Fourleaf.Websites.DEC.Business.Hazard_Category" >
    </asp:ObjectDataSource>
     
     
     
     
</asp:Content>
Angel Petrov
Telerik team
 answered on 02 May 2013
1 answer
102 views
hi,
  can any one suggest a website to understand a MEDIA QUERIES concept clearly(From basic concepts).....................................
thanks
Princy
Top achievements
Rank 2
 answered on 02 May 2013
6 answers
140 views
I have a scheduler with a customized advanced form. On this form I have a Boolean attribute control ResFlight, indicating whether the appointment is a flight, and a resource contol ResAirport holding the departing airport.

If the user checks the ResFlight checkbox I want the ResAirport to be required. 

I would like to do this on the client, but I am a bit lost. I've tried using the asp validators, but I get an error saying that the ResAirport is "an invalid control to validate type"

Any ideas?


Regards, Jill-Connie Lorentsen
Jill-Connie Lorentsen
Top achievements
Rank 1
 answered on 02 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?