Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
114 views
Hi,

I have a RADGrid with static headers and scrolling enabled.
I set the height of the grid to be 400px.
When the page loads the grid first seems to open with the height of 400px, but then it expands to something like 420px.
What is the problem?

Thanks.
Pavlina
Telerik team
 answered on 01 Sep 2009
1 answer
216 views
Hi there,

I am using Q3 2008 version; I want to collapse/expand the Grid Rows (in GroupingByExpression).
I reffered to the http://www.telerik.com/community/forums/aspnet/grid/expand-collapse-all-groups-on-client.aspx, but I think this methodes used in this API are not supported by my version.
I also tried to use the tableView._getGroupExpandButton(tableView._getRowByIndexOrItemIndexHierarchical(0)) but it always return null.
I found the expand button for one of the row "tableView.get_element().all[7].all[1].all[0]" but I am unable to locate this inside dataitem.

Any quick response will be highly appriciated.

Thanks
Sajid

Schlurk
Top achievements
Rank 2
 answered on 01 Sep 2009
1 answer
53 views
For some reason the ajax loading panel is just not working on with my radgrid.  When I try to page or edit or anything it does a normal page refresh.  I am assuming I missed a step somewhere.  I setup my web.config per the asp.net ajax instructions and here is my code.  Any ideas?

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="xxx.aspx.vb" Inherits="xxx" 
    Title="xxx" MasterPageFile="~/main.master" %> 
 
<asp:Content ID="Content1" ContentPlaceHolderID="CPHMain" runat="Server"
    <span style="font-size: 2em; color: white;">xxx</span> 
    <br /> 
    <asp:Panel ID="pnlMain" runat="server"
        <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" 
            DataSourceID="SqlDataSourceGlobalVars" GridLines="None" AllowAutomaticDeletes="True" 
            AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowPaging="True" 
            AllowSorting="True" PageSize="20" ShowFooter="True" Skin="WebBlue" ShowStatusBar="True"
            <MasterTableView AutoGenerateColumns="False" DataKeyNames="id" DataSourceID="SqlDataSourceGlobalVars" 
                AllowSorting="False" ShowFooter="False" CommandItemDisplay="TopAndBottom"
                <RowIndicatorColumn> 
                    <HeaderStyle Width="20px" /> 
                </RowIndicatorColumn> 
                <ExpandCollapseColumn> 
                    <HeaderStyle Width="20px" /> 
                </ExpandCollapseColumn> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="id" DataType="System.Int32" HeaderText="id" ReadOnly="True" 
                        SortExpression="id" UniqueName="id" Visible="False"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="config_param" HeaderText="Parameter" SortExpression="config_param" 
                        UniqueName="config_param"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="config_data" HeaderText="Value" SortExpression="config_data" 
                        UniqueName="config_data"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="config_desc" HeaderText="Description" SortExpression="config_desc" 
                        UniqueName="config_desc"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="datemod" DataType="System.DateTime" HeaderText="Last Modified" 
                        ReadOnly="True" SortExpression="datemod" UniqueName="datemod"
                    </telerik:GridBoundColumn> 
                </Columns> 
            </MasterTableView> 
        </telerik:RadGrid> 
        <asp:SqlDataSource ID="SqlDataSourceGlobalVars" runat="server" ConnectionString="<%$ ConnectionStrings:PrimaryConnectionString %>" 
            SelectCommand="SELECT [id], [config_param], [config_data], [datemod], [config_desc] FROM [site_config]" 
            UpdateCommand="UPDATE site_config SET config_desc = @config_desc , datemod = GETDATE(), config_data = @config_data, config_param = @config_param WHERE (id = @id)" 
            DeleteCommand="DELETE FROM site_config WHERE (id = @id)" InsertCommand="INSERT INTO site_config(config_desc, datemod, config_data, config_param) VALUES (@config_desc, GETDATE(), @config_data, @config_param)"
            <DeleteParameters> 
                <asp:Parameter Name="id" /> 
            </DeleteParameters> 
            <UpdateParameters> 
                <asp:Parameter Name="config_desc" /> 
                <asp:Parameter Name="config_data" /> 
                <asp:Parameter Name="config_param" /> 
                <asp:Parameter Name="id" /> 
            </UpdateParameters> 
            <InsertParameters> 
                <asp:Parameter Name="config_desc" /> 
                <asp:Parameter Name="config_data" /> 
                <asp:Parameter Name="config_param" /> 
            </InsertParameters> 
        </asp:SqlDataSource> 
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" DefaultLoadingPanelID="RadAjaxLoadingPanel1"
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="RadGrid1"
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" MinDisplayTime="1000" > 
        <asp:Image ID="imageloading" runat="server" ImageUrl="~/images/loading.gif" /> 
        </telerik:RadAjaxLoadingPanel> 
    </asp:Panel> 
</asp:Content> 
 

Pavlina
Telerik team
 answered on 01 Sep 2009
1 answer
137 views
I have a RadPanelBar like below,

<Telerik:RadPanelBar 
<Items> 
   <Telerik:RadPanelItem 
     <Items> 
      <Telerik:RadPanelItem 
    <ItemTemplate> 
      <asp:Panel> 
      </asp:Panel> 
      <Telerik:RadTreeView    .. 


I am loading User controls (dynamically) in the asp:Panel which is nested inside RadPanelItems.. under each asp:Panel I have telerik tree..
Right now I am generating (adding) same user control to five panel items..
Note: For now I have Panel items hardcoded.

1.How do I find the controls inside the user controls? is there any easy and dynamic way??
Venkat Ganesh
Top achievements
Rank 1
 answered on 01 Sep 2009
0 answers
168 views
  Below is the markup for an appointment scheduling interface. There is an DropDownList to select the facility which is populated by an SqlDataSource. Each facility has any number of resources.
  On first run all looks like it is working properly, accept the appointments template is not being used. Instead, just a rounded gray box appears in its time slot. When looking at the element in FireBug, there is nothing inside the <div class="rsAptContent"></div> tags. So, I removed the <AppointmentTemplate>, and it works. The subject is displayed. but i cannot figure how my ascx control is broken or breaking the scheduler. The code-behind this control is currently empty.

[BEGIN ScheduledAppointment.ascx]
<%@ Control Language="C#"
            AutoEventWireup="true"
            CodeBehind="ScheduledAppointment.ascx.cs"
            Inherits="org.WhoCo.MIS.Applications.Scheduling.ScheduledAppointment" %>
<asp:Panel runat="server" CssClass="misAppointment">
    <asp:Panel runat="server">

    </asp:Panel>
</asp:Panel>
[END] (Its just a place holder for now...)

  Also, when DblClicking on an open slot or on an appointment the LoadingPanel is displayed and then goes away, but no advanced edit/insert form is displayed. When selecting a different facility from the DropDownList, the same LoadingPanel is displayed, but the change in facility has no effect. The schedule and resources from the last facility in the list is always displayed.
  Lastly, changing the date using the DatePicker provided by the scheduler has no effect. Well, it has the same effect as the DropDownList and the DatePicker, but the date does not change.
  Below is the complete code from the page minus the <%@ %><html><head><body><form> stuff. Below that is the complete code-behind for the page. The connection strings are handled in the code-behind.

[BEGIN Scheduling.aspx]
    <%-- Telerik --%>
    <telerik:RadScriptManager ID="ScriptManager" runat="server"
                              EnableScriptGlobalization="true"
                              EnableScriptLocalization="true"
                              EnablePartialRendering="true">
        <Scripts>
            <asp:ScriptReference Assembly="org.WhoCo.MIS.Site" Name="org.WhoCo.MIS.Localization.Strings.js" />
            <asp:ScriptReference Assembly="org.WhoCo.MIS.Site" Name="org.WhoCo.MIS.Applications.Scheduling.Localization.Strings.js" />
            <asp:ScriptReference Assembly="org.WhoCo.MIS.Site" Name="org.WhoCo.MIS.Applications.Scheduling.ClientScript.js" />
        </Scripts>
    </telerik:RadScriptManager>
    
    <telerik:RadAjaxManager ID="AjaxManager" runat="server"
                            EnableEmbeddedScripts="true"
                            EnableAJAX="true">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="UpdatedControlsGroup">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="ddlFacilities" />
                    <telerik:AjaxUpdatedControl ControlID="Scheduler" LoadingPanelID="lpDefault" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    
    <telerik:RadAjaxLoadingPanel ID="lpDefault" runat="server">
        <div class="updateOverlay">
            <div class="updateContent">
                <asp:Image runat="server"
                           ImageAlign="Middle"
                           ImageURL="~/Images/Loading.gif" />
            </div>
        </div>
    </telerik:RadAjaxLoadingPanel>
    <%-- /Telerik --%>

        <%-- Selections Panel --%>
        <asp:Panel runat="server" ID="UpdatedControlsGroup"
                   BackColor="Transparent"
                   BorderStyle="None">
            <%-- Facilities List --%>
            <asp:DropDownList ID="ddlFacilities" runat="server"
                              DataSourceID="dsFacilities"
                              AutoPostBack="true"
                              DataTextField="name"
                              DataValueField="id">
            </asp:DropDownList>
            
            <%-- Scheduler --%>
            <telerik:RadScheduler ID="Scheduler" runat="server"
                                  Width="100%" Height="100%"
                                  DataSourceID="dsSchedule"
                                  DataKeyField="id"
                                  DataStartField="start"
                                  DataEndField="end"
                                  DataSubjectField="id"
                                  ShowAllDayRow="false"
                                  ShowViewTabs="true"
                                  WeekView-ReadOnly="true"
                                  MonthView-ReadOnly="true"
                                  TimelineView-ReadOnly="true"
                                  StartEditingInAdvancedForm="true"
                                  StartInsertingInAdvancedForm="true"
                                  GroupBy="Schedulable"
                                  GroupingDirection="Horizontal"
                                  SelectedView="ResourceView"
                                  OnClientTimeSlotContextMenu="WhoCo.MIS.Scheduling.Schedule.OnContextMenu"
                                  OnClientAppointmentCreated="WhoCo.MIS.Scheduling.Appointment.OnCreated"
                                  OnClientAppointmentDoubleClick="WhoCo.MIS.Scheduling.Appointment.OnDoubleClick"
                                  OnFormCreated="Scheduler_FormCreated"
                                  OnAppointmentCreated="Scheduler_AppointmentCreated"
                                  OnAppointmentDataBound="Scheduler_AppointmentDataBound">
                <ResourceTypes>
                    <telerik:ResourceType Name="Schedulable" DataSourceID="dsResources" ForeignKeyField="rid" KeyField="id" TextField="name" AllowMultipleValues="false" />
                </ResourceTypes>

                <AdvancedForm Modal="true" />

                <AppointmentTemplate>
                    <mis:ScheduledAppointment ID="Appointment" runat="server" />
                </AppointmentTemplate>

                <AdvancedInsertTemplate>
                    <mis:AppointmentForm ID="InsertForm" runat="server" Mode="Insert" />
                </AdvancedInsertTemplate>

                <AdvancedEditTemplate>
                    <mis:AppointmentForm ID="EditForm" runat="server" Mode="Edit" />
                </AdvancedEditTemplate>
            </telerik:RadScheduler>
        </asp:Panel>

        <%-- Data Sources --%>
        <%-- Facilities DataSource --%>
        <asp:SqlDataSource ID="dsFacilities" runat="server"
                           SelectCommandType="Text"
                           SelectCommand="SELECT id, name FROM facilities">
        </asp:SqlDataSource>

        <%-- Resources DataSource --%>
        <asp:SqlDataSource ID="dsResources" runat="server"
                           SelectCommandType="Text"
                           SelectCommand="SELECT id, status, sort, name, type FROM resources WHERE facility = @p_facility ORDER BY sort ASC">
            <SelectParameters>
                <asp:ControlParameter ControlID="ddlFacilities" Name="p_facility" Type="UInt32" />
            </SelectParameters>
        </asp:SqlDataSource>
        
        <%-- Scheduler DataSource --%>
        <asp:SqlDataSource ID="dsSchedule" runat="server"
                           SelectCommandType="Text"
                           SelectCommand="SELECT * FROM schedule;">
        </asp:SqlDataSource>
[END]

[BEGIN Scheduling.aspx.cs]

using System;
using System.Threading;
using System.Globalization;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Configuration;
// ...
using Telerik.Web.UI;

namespace org.WhoCo.MIS.Applications.Scheduling {
    public partial class Main : System.Web.UI.Page {
        #region [ Page Events ]

        protected void Page_Load( object sender, EventArgs e ) {

        }

        protected void Page_Init( object sender, EventArgs e ) {
            if( !IsPostBack ) {
            // Initialize Components
                // Datasources
                string dbcc = MIS.Database.Client.Prefix + MIS.Session.User.Client.Code;
            //    dsFacilities.SelectCommand = "SELECT id, name FROM " + dbcc + ".facilities;";

                dsFacilities.ProviderName = ConfigurationManager.ConnectionStrings["DB.MIS.WhoCo.lan"].ProviderName;
                dsFacilities.ConnectionString = ConfigurationManager.ConnectionStrings["DB.MIS.WhoCo.lan"].ConnectionString.Replace( "initial catalog=_mis", "initial catalog=" + dbcc );
                dsResources.ProviderName = ConfigurationManager.ConnectionStrings["DB.MIS.WhoCo.lan"].ProviderName;
                dsResources.ConnectionString = ConfigurationManager.ConnectionStrings["DB.MIS.WhoCo.lan"].ConnectionString.Replace( "initial catalog=_mis", "initial catalog=" + dbcc );
                dsSchedule.ProviderName = ConfigurationManager.ConnectionStrings["DB.MIS.WhoCo.lan"].ProviderName;
                dsSchedule.ConnectionString = ConfigurationManager.ConnectionStrings["DB.MIS.WhoCo.lan"].ConnectionString.Replace( "initial catalog=_mis", "initial catalog=" + dbcc );
             //    Logger.Application.DebugFormat( "dsSchedule.ConnectionString == {0}", dsSchedule.ConnectionString );

                Scheduler.Culture = Thread.CurrentThread.CurrentUICulture;
            //    Scheduler.SelectedDate = DateTime.Now;
                Scheduler.SelectedDate = DateTime.Parse( "2009-08-12 17:00:00" );
                Scheduler.DayStartTime = new TimeSpan( 8, 0, 0 );
                Scheduler.DayEndTime = new TimeSpan( 20, 0, 0 );
            //    Scheduler.TimeZoneOffset = new TimeSpan( 7, 0, 0 );
            }
        }

        #endregion Page Events

        #region [ Component Events ]

        protected void OnRefresh( object sender, EventArgs args ) {
            Scheduler.Rebind();
        }

        protected void Scheduler_FormCreated(object sender, SchedulerFormCreatedEventArgs e) {
            RadScheduler scheduler = (RadScheduler)sender;

            switch( e.Container.Mode ) {
                case SchedulerFormMode.AdvancedInsert:
                    break;

                case SchedulerFormMode.AdvancedEdit:
                    break;

                default:
                    // LOG!!!
                    break;
            }
        }

        protected void Scheduler_AppointmentDataBound( object sender, Telerik.Web.UI.SchedulerEventArgs e ) {
            Telerik.Web.UI.Appointment a = e.Appointment;
        }

        protected void Scheduler_AppointmentCreated( object sender, AppointmentCreatedEventArgs e ) {
            Telerik.Web.UI.Appointment a = e.Appointment;
            ScheduledAppointment sa = (ScheduledAppointment)e.Container.FindControl( "Appointment" );
        }

        #endregion Component Events
    }
}
[END]

Thanks in advance!

Nick Yearwood
Nick
Top achievements
Rank 1
 asked on 01 Sep 2009
2 answers
260 views
Hi,

I have a Radgrid with add/update/delete custom buttons on top of the grid. I can invoke the clientside edit of a row using this script on rowclick or rowdblclick.

 editedRow = eventArgs.get_itemIndexHierarchical();
 $find("<%= RadGrid1.MasterTableView.ClientID %>").editItem(editedRow);

However, I am unable to persist the changes to the server when I use

 $find("<%= RadGrid1.MasterTableView.ClientID %>").updateItem(editedRow);

Can anyone explain what exactly happens when updateItem is called. Does the UpdateCommand get fired on the server?

Here is my code

The Script BLOCK :

 <telerik:RadScriptManager ID="ScriptManager" runat="server" /> 
         <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

                <script type="text/javascript">
                    
                    var hasChanges = false;
                    var editedRow;
                    var editedRowId;
                    var editButton;

                  
                    
                    function RowClick(sender, eventArgs)
                    {

                        editedRow = eventArgs.get_itemIndexHierarchical();
                        var grid = $find("<%= RadGrid1.ClientID %>");
                        var masterTable = grid.get_masterTableView();
                        if (editedRow && hasChanges) {
                            if (confirm("Update changes?")) {
                                hasChanges = false;
                                 $find("<%= RadGrid1.MasterTableView.ClientID %>").updateItem(editedRow);
                                editButton.set_enabled(true);
                               
                            }
                            else {
                                hasChanges = true;
                            }
                        }
                       
                  }


                  function onToolButtonClick(sender, args) {
                      editButton = args.get_item();
                      var commandName = editButton.get_commandName();
                      var grid = $find("<%= RadGrid1.ClientID %>");
                      alert("Selected Item Count: " + grid.get_selectedItems().length);
                      switch (commandName)
                      {
                      case "AddSelectedItem":
                            
                              grid.get_masterTableView().insertItem();
                              break;
                          case "EditSelectedItem":
                              editButton.set_enabled(false);                            
                              grid.get_masterTableView().editItem(editedRow);
                              editedRowId = editedRow;
                              hasChanges = true;
                              break;
                      case "DeleteSelectedItem":                       
                          editButton.set_enabled(!confirm('Delete selected item?'));
                          break;   
                      }
                  }

                
                </script>

            </telerik:RadCodeBlock>




<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
            DefaultLoadingPanelID="RadAjaxLoadingPanel1">
           <AjaxSettings>
               <telerik:AjaxSetting  AjaxControlID="RadGrid1">
                   <UpdatedControls>
                       <telerik:AjaxUpdatedControl ControlID="Label1" />
                       <telerik:AjaxUpdatedControl ControlID="RadGrid1" />                    
                   </UpdatedControls>
               </telerik:AjaxSetting>
           </AjaxSettings>          
       </telerik:RadAjaxManager>  
          
       <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" >
            <img alt="Loading..." src="Images/Toolbar/anibusy.gif" />
       </telerik:RadAjaxLoadingPanel>
       



ToolBar Control For Single Select:

         <br /><br />
            <telerik:RadToolBar ID="RadToolBar1" runat="server" OnClientButtonClicked="onToolButtonClick" AutoPostBack="false">
                <Items>
                     <telerik:RadToolBarButton runat="server" Text="Create Provider Audit Chart" CommandName="AddSelectedItem"  PostBack=false ImageUrl="~/Images/Toolbar/select.gif" >
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server" Text="Edit" PostBack="False" CommandName="EditSelectedItem" ImageUrl="~/Images/Toolbar/edit.gif" >
                    </telerik:RadToolBarButton>
                    <telerik:RadToolBarButton runat="server"  Text="Delete" CommandName="DeleteSelectedItem" ImageUrl="~/Images/Toolbar/delete.gif">
                    </telerik:RadToolBarButton>
                    
                </Items>
            </telerik:RadToolBar>
         <br /><br />
 <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
        <br /><br />
         Single Select Grid:
         <br /><br />
            <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="XmlDataSource1"  OnItemUpdated="RadGrid1_ItemUpdated"  >
                <MasterTableView  CommandItemDisplay="Top"  CommandItemStyle-CssClass="RadGrid_MonarchSkin" ClientDataKeyNames="CustomerID" EditMode="InPlace" ShowHeader=true >               
                <Columns>                         
                        <telerik:GridBoundColumn  UniqueName="CustomerID" DataField="CustomerID" HeaderText="Customer ID" Visible="false">
                        </telerik:GridBoundColumn>                      
                        <telerik:GridBoundColumn UniqueName="CompanyName" ColumnEditorID="GridTextBoxColumnEditor1" DataField="CompanyName" HeaderText="CompanyName" >
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn UniqueName="ContactName" ColumnEditorID="GridTextBoxColumnEditor2"  DataField="ContactName" HeaderText="ContactName" >
                        </telerik:GridBoundColumn>  
                                             
                    </Columns>
                     
                </MasterTableView>  
                <ClientSettings >
                    <ClientEvents OnRowClick ="RowClick" />                
                </ClientSettings>
                             
            </telerik:RadGrid>
           







Schlurk
Top achievements
Rank 2
 answered on 01 Sep 2009
3 answers
141 views
I have created a grid that i need to insert a new record, delete an record or update... When I run update it gives me the error - Object reference not set to an instance of an object... Can someone help me out... I just do not see what i am misssing... 

 

  <telerik:RadGrid ID="rgEditPhoneList" runat="server"
            AllowPaging="True"
            AllowSorting="True"
            GridLines="None"
            DataSourceID="SqlDataSource1"
            Visible="False"
            OnItemUpdate="rgEditPhoneList_ItemUpdated"
            OnDataBound="rgEditPhoneList_DataBound"
            OnItemInserted="rgEditPhoneList_ItemInserted"
            OnItemDeleted="rgEditPhoneList_ItemDeleted"
            AllowAutomaticUpdates ="True"
            AllowAutomaticDeletes="True"
            AllowAutomaticInserts="True"
            AutoGenerateColumns="False"
            PageSize="50">
        <ExportSettings>
            <Pdf PaperSize="Letter" FontType="Subset"></Pdf>
            <Excel Format="Html"></Excel>
            <Csv RowDelimiter="NewLine" ColumnDelimiter="Comma"></Csv>
        </ExportSettings>
        <MasterTableView CurrentResetPageIndexAction="SetPageIndexToFirst"
                        Dir="LTR"
                        Frame="Border"
                        TableLayout="Auto"
                        CommandItemDisplay="Top"
                        AutoGenerateColumns="False"
                        DataKeyNames="ID"
                        DataSourceID="SqlDataSource1">
            <RowIndicatorColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
                Visible="False">
                <HeaderStyle Width="20px"></HeaderStyle>
            </RowIndicatorColumn>
            <ExpandCollapseColumn CurrentFilterFunction="NoFilter" FilterListOptions="VaryByDataType"
                Visible="False" Resizable="False">
                <HeaderStyle Width="20px"></HeaderStyle>
            </ExpandCollapseColumn>
            <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
            <ItemStyle CssClass="MyImageButton" />
        </telerik:GridEditCommandColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="ID" DataType="System.Int32"
                    FilterListOptions="VaryByDataType" ForceExtractValue="None"
                    HeaderText="ID" SortExpression="ID"
                    UniqueName="ID" ReadOnly="True">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="SortOrder" DataType="System.Int32"
                    FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="SortOrder"
                    SortExpression="SortOrder" UniqueName="SortOrder">
                </telerik:GridBoundColumn>
               
                <telerik:GridDropDownColumn DataSourceID="sqlKMAgrid" ListTextField="KMA_LongDesc" ListValueField="ID"
                SortExpression="KMA_LongDesc" HeaderText="KMA" DropDownControlType="DropDownList"
                DataField="KMA_LongDesc" ColumnEditorID="GridDropDownColumnEditor1" >
                 </telerik:GridDropDownColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="KMA_LongDesc"
                    FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="KMA_LongDesc"
                    SortExpression="KMA_LongDesc" UniqueName="KMA_LongDesc">
                </telerik:GridBoundColumn>
             <%--   <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="KMA_ID" DataType="System.Int32"
                    FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="KMA_ID"
                    SortExpression="KMA_ID" UniqueName="KMA_ID">
                </telerik:GridBoundColumn>--%>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="DispatchLocation"
                    FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="DispatchLocation"
                    SortExpression="DispatchLocation" UniqueName="DispatchLocation">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Sys" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="Sys" SortExpression="Sys" UniqueName="Sys">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Prin" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="Prin" SortExpression="Prin" UniqueName="Prin">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Site" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="Site" SortExpression="Site" UniqueName="Site">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Co_Div" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="Co_Div" SortExpression="Co_Div" UniqueName="Co_Div">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Name" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="Name" SortExpression="Name" UniqueName="Name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Title" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="Title" SortExpression="Title" UniqueName="Title">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="OfficeNumber"
                    FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="OfficeNumber"
                    SortExpression="OfficeNumber" UniqueName="OfficeNumber">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Extention" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="Extention" SortExpression="Extention" UniqueName="Extention">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="CellNumber"
                    FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="CellNumber"
                    SortExpression="CellNumber" UniqueName="CellNumber">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Monday" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="Monday" SortExpression="Monday" UniqueName="Monday">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Tuesday" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="Tuesday" SortExpression="Tuesday" UniqueName="Tuesday">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Wednesday" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="Wednesday" SortExpression="Wednesday" UniqueName="Wednesday">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Thursday" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="Thursday" SortExpression="Thursday" UniqueName="Thursday">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Friday" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="Friday" SortExpression="Friday" UniqueName="Friday">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Saturday" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="Saturday" SortExpression="Saturday" UniqueName="Saturday">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Sunday" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="Sunday" SortExpression="Sunday" UniqueName="Sunday">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="StartHour" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="StartHour" SortExpression="StartHour" UniqueName="StartHour">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="EndHour" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="EndHour" SortExpression="EndHour" UniqueName="EndHour">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="Notes" FilterListOptions="VaryByDataType"
                    ForceExtractValue="None" HeaderText="Notes" SortExpression="Notes" UniqueName="Notes">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="StartDate" DataType="System.DateTime"
                    FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="StartDate"
                    SortExpression="StartDate" UniqueName="StartDate">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn CurrentFilterFunction="NoFilter" DataField="StopDate" DataType="System.DateTime"
                    FilterListOptions="VaryByDataType" ForceExtractValue="None" HeaderText="StopDate"
                    SortExpression="StopDate" UniqueName="StopDate">
                </telerik:GridBoundColumn>
                 <telerik:GridButtonColumn ConfirmText="Delete this product?" ButtonType="ImageButton"
                 CommandName="Delete" Text="Delete" UniqueName="DeleteColumn">
                        <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                    </telerik:GridButtonColumn>

            </Columns>
              <EditFormSettings ColumnNumber="2" CaptionDataField="ID" CaptionFormatString="Edit properties of Product {0}">
                   <FormTableItemStyle Wrap="False"></FormTableItemStyle>
                    <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                    <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                        Width="100%" />
                    <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                    <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                    <EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record"
                        UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                    </EditColumn>
                    <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
                </EditFormSettings>
           
        </MasterTableView>
     
    </telerik:RadGrid>
     </ContentTemplate>
    </asp:UpdatePanel>
   
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:EDCCConnectString %>"
       SelectCommand="DSRV_SelectKMA_PhoneList" UpdateCommandType="StoredProcedure"
        SelectCommandType="StoredProcedure"
        UpdateCommand="update TL_DSRV_KMA_PhoneList
        set SortOrder = @SortOrder, 
  KMA_LongDesc   = @KMA_ID,
  DispatchLocation = @DispatchLocation,
  [Sys]   = @sys,
  Prin   = @Prin,
  [Site]   = @Site,
  Co_Div   = @Co_Div,
  Name   = @Name,
  Title   = @Title,
  OfficeNumber = @OfficeNumber,
  Extention  = @Extention,
  CellNumber  = @CellNumber,
  Monday   = @Monday,
  Tuesday   = @Tuesday,
  Wednesday  = @Wednesday,
  Thursday  = @Thursday,
  Friday   = @Friday,
  Saturday  = @Saturday,
  Sunday   = @Sunday,
  StartHour  = @StartHour,
  EndHour   = @EndHour,
  Notes   = @Notes,
  StartDate  = @StartDate,
  StopDate  = @StopDate
  where ID = @ID"
  
        InsertCommand="INSERT INTO TL_DSRV_KMA_PhoneList (SortOrder, 
  KMA_ID,
  DispatchLocation,
  [Sys],
  Prin,
  [Site],
  Co_Div,
  Name,
  Title,
  OfficeNumber,
  Extention,
  CellNumber,
  Monday,
  Tuesday,
  Wednesday,
  Thursday,
  Friday,
  Saturday,
  Sunday,
  StartHour,
  EndHour,
  Notes,
  StartDate,
  StopDate) values(@SortOrder, 
  @KMA_ID,
  @DispatchLocation,
  @Sys,
  @Prin,
  @Site,
  @Co_Div,
  @Name,
  @Title,
  @OfficeNumber,
  @Extention,
  @CellNumber,
  @Monday,
  @Tuesday,
  @Wednesday,
  @Thursday,
  @Friday,
  @Saturday,
  @Sunday,
  @StartHour,
  @EndHour,
  @Notes,
  @StartDate,
  @StopDate)"
        DeleteCommand="DELETE FROM [TL_DSRV_KMA_PhoneList] WHERE [ID] = @ID" >
        <SelectParameters>
            <asp:ControlParameter ControlID="ddlKMA" Name="KMA_ID"
                PropertyName="SelectedValue" Type="Int32" />
        </SelectParameters>
        <UpdateParameters>
            <asp:Parameter Name="ID" Type="Int32" />
            <asp:Parameter Name="SortOrder" Type="Int32" />
            <asp:Parameter Name="KMA_LongDesc" Type="Int32" />
            <asp:Parameter Name="DispatchLocation" Type="String" />
            <asp:Parameter Name="Sys" Type="String" />
            <asp:Parameter Name="Prin" Type="String" />
            <asp:Parameter Name="Site" Type="String" />
            <asp:Parameter Name="Co_Div" Type="String" />
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Title" Type="String" />
            <asp:Parameter Name="OfficeNumber" Type="String" />
            <asp:Parameter Name="Extention" Type="String" />
            <asp:Parameter Name="CellNumber" Type="String" />
            <asp:Parameter Name="Monday" Type="String" />
            <asp:Parameter Name="Tuesday" Type="String" />
            <asp:Parameter Name="Wednesday" Type="String" />
            <asp:Parameter Name="Thursday" Type="String" />
            <asp:Parameter Name="Friday" Type="String" />
            <asp:Parameter Name="Saturday" Type="String" />
            <asp:Parameter Name="Sunday" Type="String" />
            <asp:Parameter Name="StartHour" Type="String" />
            <asp:Parameter Name="EndHour" Type="String" />
            <asp:Parameter Name="Notes" Type="String" />
            <asp:Parameter Name="StateDate" Type="DateTime" />
            <asp:Parameter Name="StopDate" Type="DateTime" />           
        </UpdateParameters>
        <InsertParameters>
            <asp:Parameter Name="SortOrder" Type="Int32" />
            <asp:Parameter Name="KMA_LongDesc" Type="Int32" />
            <asp:Parameter Name="DispatchLocation" Type="String" />
            <asp:Parameter Name="Sys" Type="String" />
            <asp:Parameter Name="Prin" Type="String" />
            <asp:Parameter Name="Site" Type="String" />
            <asp:Parameter Name="Co_Div" Type="String" />
            <asp:Parameter Name="Name" Type="String" />
            <asp:Parameter Name="Title" Type="String" />
            <asp:Parameter Name="OfficeNumber" Type="String" />
            <asp:Parameter Name="Extention" Type="String" />
            <asp:Parameter Name="CellNumber" Type="String" />
            <asp:Parameter Name="Monday" Type="String" />
            <asp:Parameter Name="Tuesday" Type="String" />
            <asp:Parameter Name="Wednesday" Type="String" />
            <asp:Parameter Name="Thursday" Type="String" />
            <asp:Parameter Name="Friday" Type="String" />
            <asp:Parameter Name="Saturday" Type="String" />
            <asp:Parameter Name="Sunday" Type="String" />
            <asp:Parameter Name="StartHour" Type="String" />
            <asp:Parameter Name="EndHour" Type="String" />
            <asp:Parameter Name="Notes" Type="String" />
            <asp:Parameter Name="StateDate" Type="DateTime" />
            <asp:Parameter Name="StopDate" Type="DateTime" /> 
        </InsertParameters>
        <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>

    </asp:SqlDataSource>
   
    <asp:SqlDataSource ID="sqlKMAgrid" runat="server"
        ConnectionString="<%$ ConnectionStrings:EDCCConnectString %>"
        SelectCommand="SELECT [ID], [KMA_LongDesc] FROM [TL_KMA_Reference]"></asp:SqlDataSource>
       
     

 

 

 protected void rgEditPhoneList_ItemUpdated(object source, Telerik.Web.UI.GridUpdatedEventArgs e)
    {

        GridEditableItem item = (GridEditableItem)e.Item;
        String Name = item.GetDataKeyValue("ID").ToString();

        if (e.Exception != null)
        {
            e.KeepInEditMode = true;
            e.ExceptionHandled = true;

            SetMessage("ID " + Name + " cannot be updated. Reason: " + e.Exception.Message);
        }
        else
        {
            SetMessage("ID " + Name + " is updated!");
        }
    }

    private void SetMessage(string message)
    {
        gridMessage = message;
    }

    private void DisplayMessage(string text)
    {
        rgEditPhoneList.Controls.Add(new LiteralControl(string.Format("<span style='color:red'>{0}</span>", text)));
    }

    private string gridMessage = null;

    protected void rgEditPhoneList_DataBound(object sender, EventArgs e)
    {
        if (!string.IsNullOrEmpty(gridMessage))
        {
            DisplayMessage(gridMessage);
        }
    }
   
   

 

 

 

 

 

 

 

Gina
Top achievements
Rank 1
 answered on 01 Sep 2009
1 answer
162 views
Hello!

I've stumbled across a problem with images being moved around, by selecting and dragging them in the editor in Firefox. Whenever I do this, the image url gets changed – two dots are being added in front of the file path. So, instead of having the url read like this: src="/image-file.jpg" (which is what we're intending) it becomes src="../image-file.jpg" which in turn makes the image disappear once the page is saved & published through our cms tool.

Any solution to this?
Rumen
Telerik team
 answered on 01 Sep 2009
10 answers
289 views
I have something very strange.
I get the javascript error telerik is undefined, and only for IE6.

It happens only to the tree object, and on one page it works wel, but on another page I get this error, and the tree is unaccessable.

Is there something where and how I can register the webresource.axd?

When I'm looking with fiddler, I don't see the resource loading on my second page, but it is loading on the first page.

I've already searched in your forum, but there is not any solution described. So please help!

Thanks in advance
yashvir karki
Top achievements
Rank 1
 answered on 01 Sep 2009
1 answer
157 views
I`m currently using RadControls for ASPNET AJAX Q1 2009, and wanted to try the RadCaptcha control in one of my forms. I added the handlers in web.config and tried to add the control to my page(usercontrol). Intellisense inVisual Studio could not find it (Element RadCaptcha is not a known element). I added the code from one of the examples

<

 

telerik:RadCaptcha ID="RadCaptcha1" runat="server" ErrorMessage="Page not valid. The code you entered is not valid." ValidationGroup="Group">

 

 

 

 

 

 

</telerik:RadCaptcha>

 

 

 

 

 


And all it does is throw an Parser Error: "Unknown server tag 'telerik:RadCaptcha'."

Is this control not part of ASPNET AJAX Q1 2009? or am I doing something wrong here?

Schlurk
Top achievements
Rank 2
 answered on 01 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?