Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
103 views
Hi experts
i am using following code and it is not showing me advanced form, if i remove the advanced-form mode attribute than it is working fine.
Could you explain me the concept behind this
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadScriptManager runat="server" ID="RadScriptManager1" />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
    <telerik:RadScheduler runat="server" ID="RadScheduler1" SelectedDate="2007-03-30"
        ShowViewTabs="False" StartEditingInAdvancedForm="true" DataSourceID="AppointmentsDataSource"
        DataKeyField="ID" DataSubjectField="Subject" DataStartField="Start" DataEndField="End"
        DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentID"
        OnAppointmentCommand="RadScheduler1_AppointmentCommand" OnFormCreated="RadScheduler1_FormCreated"
        OnFormCreating="RadScheduler1_FormCreating" OnAppointmentCreated="RadScheduler1_AppointmentCreated"
        Height="" StartInsertingInAdvancedForm="true" AdvancedForm-Modal="true">
        <ResourceTypes>
            <telerik:ResourceType KeyField="ID" Name="AppointmentType" TextField="Keyword" ForeignKeyField="AppointmentTypeID"
                DataSourceID="AppointmentTypesDataSource" />
        </ResourceTypes>
        <ResourceStyles>
            <telerik:ResourceStyleMapping Type="AppointmentType" Text="technical" ApplyCssClass="rsCategoryGreen" />
            <telerik:ResourceStyleMapping Type="AppointmentType" Text="specification_review"
                ApplyCssClass="rsCategoryOrange" />
            <telerik:ResourceStyleMapping Type="AppointmentType" Text="code_review" ApplyCssClass="rsCategoryBlue" />
        </ResourceStyles>
        <%--        <InlineInsertTemplate>
            <div id="InlineInsertTemplate" class="rsCustomAppointmentContainer technical">
                <div>
                </div>
                <span class="rsCustomAppointmentContainerInner">
                    <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Subject") %>' Width="90%"
                        TextMode="MultiLine" Height="20px"></asp:TextBox>
                    <asp:LinkButton ID="InsertButton" runat="server" CommandName="Insert">
                        <asp:Image runat="server" ID="insertImage" ImageUrl="../images/ok.png" AlternateText="insert" />
                    </asp:LinkButton>
                    <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel">
                        <asp:Image runat="server" ID="Image2" ImageUrl="../images/cancel.png" AlternateText="cancel" />
                    </asp:LinkButton>
                    <span class="inline-label">Color code:</span>
                    <asp:RadioButtonList runat="server" ID="AppointmentTypeRadioButtonList" DataValueField="ID"
                        CssClass="AppointmentTypeSelectorTable" DataSourceID="AppointmentTypesDataSource"
                        SelectedValue='<%# Bind("AppointmentTypeID") %>' DataTextField="Keyword" RepeatDirection="Horizontal"
                        DataTextFormatString="<span class='AppointmentTypeSelector rsAptType_{0}'></span>">
                    </asp:RadioButtonList>
                    <asp:LinkButton ID="InsertMoreButton" runat="server" CommandName="More" CssClass="rsAdvancedEditLink">Advanced</asp:LinkButton>
                </span>
            </div>
        </InlineInsertTemplate>
        <InlineEditTemplate>
            <div id="InlineEditTemplate" class="rsCustomAppointmentContainer <%# Eval("AppointmentType.Text") %>">
                <div>
                </div>
                <span class="rsCustomAppointmentContainerInner">
                    <asp:TextBox ID="TitleTextBox" runat="server" Text='<%# Bind("Subject") %>' Width="90%"
                        TextMode="MultiLine" Height="20px"></asp:TextBox>
                    <asp:LinkButton ID="InsertButton" runat="server" CommandName="Update">
                        <asp:Image runat="server" ID="insertImage" ImageUrl="../images/ok.png" AlternateText="update" />
                    </asp:LinkButton>
                    <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel">
                        <asp:Image runat="server" ID="Image3" ImageUrl="../images/cancel.png" AlternateText="cancel" />
                    </asp:LinkButton>
                    <span class="inline-label">Color code:</span>
                    <asp:RadioButtonList runat="server" ID="AppointmentTypeRadioButtonList" DataValueField="ID"
                        CssClass="AppointmentTypeSelectorTable" DataSourceID="AppointmentTypesDataSource"
                        SelectedValue='<%# Bind("AppointmentTypeID") %>' DataTextField="Keyword" RepeatDirection="Horizontal"
                        DataTextFormatString="<span class='AppointmentTypeSelector rsAptType_{0}'></span>">
                    </asp:RadioButtonList>
                    <asp:LinkButton ID="InsertMoreButton" runat="server" CommandName="More" CssClass="rsAdvancedEditLink">Advanced</asp:LinkButton>
                </span>
            </div>
        </InlineEditTemplate>--%>
        <AppointmentTemplate>
            <div class="rsCustomAppointmentContainer <%# Eval("AppointmentType.Text") %>">
                <h2>
                    <%# Eval("Subject") %>
                </h2>
                <div>
                </div>
            </div>
        </AppointmentTemplate>
        <AdvancedEditTemplate>
            <div id="qsfexAdvEditWrapper">
                <div id="qsfexAdvEditInnerWrapper" class='<%# Eval("AppointmentType.Text") %>'>
                    <div class="qsfexAdvAppType">
                    </div>
                    <div class="qsfexAdvEditControlWrapper">
                        <asp:Label ID="Label1" AssociatedControlID="TitleTextBox" runat="server" CssClass="inline-label">Description</asp:Label>
                        <asp:TextBox ID="TitleTextBox" Rows="5" Columns="20" runat="server" Text='<%# Bind("Subject") %>'
                            Width="97%" TextMode="MultiLine"></asp:TextBox><br />
                    </div>
                    <div class="qsfexAdvEditControlWrapper">
                        <asp:Label ID="Label2" AssociatedControlID="StartInput" runat="server" CssClass="inline-label">Start time:</asp:Label>
                        <telerik:RadDateInput ID="StartInput" SelectedDate='<%# Bind("Start") %>' runat="server">
                        </telerik:RadDateInput><br />
                    </div>
                    <div class="qsfexAdvEditControlWrapper">
                        <asp:Label ID="Label3" AssociatedControlID="EndInput" runat="server" CssClass="inline-label">End time:</asp:Label>
                        <telerik:RadDateInput ID="EndInput" SelectedDate='<%# Bind("End") %>' runat="server">
                        </telerik:RadDateInput><br />
                    </div>
                    <div class="qsfexAdvEditControlWrapper">
                        <div class="inline-label">
                            Color code:</div>
                        <div id="qsfexAdvEditColorCodeChooser">
                            <asp:RadioButtonList runat="server" ID="AppointmentTypeRadioButtonList" DataValueField="ID"
                                CssClass="AppointmentTypeSelectorTable" DataSourceID="AppointmentTypesDataSource"
                                SelectedValue='<%# Bind("AppointmentTypeID") %>' DataTextField="Keyword" RepeatDirection="Horizontal"
                                DataTextFormatString="<span class='AppointmentTypeSelector rsAptType_{0}'></span>">
                            </asp:RadioButtonList>
                        </div>
                    </div>
                    <div class="qsfexAdvEditControlWrapper">
                        <asp:CheckBox ID="RepeatCheckBox" runat="server" Text="Repeat for 10 days" CssClass="repeatCheckBox" />
                    </div>
                    <div class="qsfexAdvEditControlWrapper" style="text-align: right;">
                        <asp:LinkButton ID="UpdateButton" runat="server" CommandName="Update">
                            <asp:Image runat="server" ID="insertImage" ImageUrl="../images/ok.png" AlternateText="update" /></asp:LinkButton>
                        <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                            Style="margin-right: 8px;">
                            <asp:Image runat="server" ID="Image2" ImageUrl="../images/cancel.png" AlternateText="cancel" /></asp:LinkButton>
                    </div>
                </div>
            </div>
        </AdvancedEditTemplate>
        <AdvancedInsertTemplate>
            <div id="qsfexAdvEditWrapper">
                <div id="qsfexAdvEditInnerWrapper" class="technical">
                    <div class="qsfexAdvAppType">
                    </div>
                    <div class="qsfexAdvEditControlWrapper">
                        <asp:Label ID="Label4" AssociatedControlID="TitleTextBox" runat="server" CssClass="inline-label">Description</asp:Label>
                        <asp:TextBox ID="TitleTextBox" Rows="5" Columns="20" runat="server" Text='<%# Bind("Subject") %>'
                            Width="97%" TextMode="MultiLine"></asp:TextBox><br />
                    </div>
                    <div class="qsfexAdvEditControlWrapper">
                        <asp:Label ID="Label5" AssociatedControlID="StartInput" runat="server" CssClass="inline-label">Start time:</asp:Label>
                        <telerik:RadDateInput ID="StartInput" SelectedDate='<%# Bind("Start") %>' runat="server">
                        </telerik:RadDateInput><br />
                    </div>
                    <div class="qsfexAdvEditControlWrapper">
                        <asp:Label ID="Label6" AssociatedControlID="EndInput" runat="server" CssClass="inline-label">End time:</asp:Label>
                        <telerik:RadDateInput ID="EndInput" SelectedDate='<%# Bind("End") %>' runat="server">
                        </telerik:RadDateInput><br />
                    </div>
                    <div class="qsfexAdvEditControlWrapper">
                        <div class="inline-label">
                            Color code:</div>
                        <div id="qsfexAdvEditColorCodeChooser">
                            <asp:RadioButtonList runat="server" ID="AppointmentTypeRadioButtonList" DataValueField="ID"
                                CssClass="AppointmentTypeSelectorTable" DataSourceID="AppointmentTypesDataSource"
                                SelectedValue='<%# Bind("AppointmentTypeID") %>' DataTextField="Keyword" RepeatDirection="Horizontal"
                                DataTextFormatString="<span class='AppointmentTypeSelector rsAptType_{0}'></span>">
                            </asp:RadioButtonList>
                        </div>
                    </div>
                    <div class="qsfexAdvEditControlWrapper">
                        <asp:CheckBox ID="RepeatCheckBox" runat="server" Text="Repeat for 10 days" CssClass="repeatCheckBox" />
                    </div>
                    <div class="qsfexAdvEditControlWrapper" style="text-align: right;">
                        <asp:LinkButton ID="InsertButton" runat="server" CommandName="Insert">
                            <asp:Image runat="server" ID="Image4" ImageUrl="../images/ok.png" AlternateText="update" /></asp:LinkButton>
                        <asp:LinkButton ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel"
                            Style="margin-right: 8px;">
                            <asp:Image runat="server" ID="Image5" ImageUrl="../images/cancel.png" AlternateText="cancel" /></asp:LinkButton>
                    </div>
                </div>
            </div>
        </AdvancedInsertTemplate>
        <TimeSlotContextMenuSettings EnableDefault="true" />
        <AppointmentContextMenuSettings EnableDefault="true" />
    </telerik:RadScheduler>
    <asp:EntityDataSource ID="AppointmentsDataSource" runat="server" ConnectionString="name=TutorPortalEntities"
        DefaultContainerName="TutorPortalEntities" EnableDelete="True" EnableFlattening="False"
        EnableInsert="True" EnableUpdate="True" EntitySetName="Templates_Appointments">
    </asp:EntityDataSource>
    <asp:EntityDataSource ID="AppointmentTypesDataSource" runat="server" ConnectionString="name=TutorPortalEntities"
        DefaultContainerName="TutorPortalEntities" EnableDelete="True" EnableFlattening="False"
        EnableInsert="True" EnableUpdate="True" EntitySetName="Templates_AppointmentTypes">
    </asp:EntityDataSource>
    </form>
    <script type="text/javascript">
        var $ = $telerik.$;
 
        // Toggles the inline form style when choosing a resource from the radio buttons.
        $('.AppointmentTypeSelectorTable input[type=radio]').live('click',
            function () {
                appType = $('input ~ label > span', this.parentNode)[0].className.match(/rsAptType_(.+?)\b/i)[1];
 
                var parentElement = $(this).parents('.rsCustomAppointmentContainer');
                if (parentElement.length == 0) {
                    var parentElement = $(this).parents('#qsfexAdvEditInnerWrapper');
 
                    if (parentElement.length == 0)
                        return;
 
                    parentElement.attr('className', appType);
                } else {
                    parentElement.attr('className', 'rsCustomAppointmentContainer ' + appType);
                }
 
            });
    </script>
</asp:Content>
Nikolay Tsenkov
Telerik team
 answered on 03 Feb 2011
3 answers
288 views
We have a requirement to show scheduled tasks for each individual. The tasks will be edited using a different mechanism, not via the scheduler, but we'd like to display them on a scheduler screen.

The data is loading, but the text on the calendar is blank; the attached screenshot shows how it looks, with the tooltip visible but no text on the calendar. here's the definition.

<telerik:RadScheduler ID="RadSchedulerCommitments" runat="server" AllowDelete="False"
AllowEdit="False" AllowInsert="False" DataSourceID="dsCommitments" SelectedView="MonthView"
DataStartField="DueDate" DataEndField="DueDate"
DataKeyField="CommitmentID" DataSubjectField="CommitmentItem"
OverflowBehavior="Expand" ReadOnly="True" ShowHoursColumn="True"
ShowViewTabs="False" >
</telerik:RadScheduler>

Any idea what's wrong?
Veronica
Telerik team
 answered on 03 Feb 2011
5 answers
226 views
I have a RadCombobox in a tooltip, and want the dropdown to be shown when the tooltip is displayed. But setting OpenDropDownOnLoad to true doesn't work...
jc mag
Top achievements
Rank 1
 answered on 03 Feb 2011
1 answer
99 views
Hello

I have a website, but when I run it does not work any telerik control. This is with. frameweok net 3.5, windows 2008 server.

ASPX:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="BuscadorDocumentos.aspx.cs" Inherits="_Default" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <style type="text/css">
        #form1
        {
            height: 361px;
        }
        </style>
</head>
<script type="text/javascript" language="javascript">
 
    function cbbCanal_IndexChanging(sender, eventArgs) {
        var cbbconducta = $find("<%= cbbConducta.ClientID%>");
        var item = eventArgs.get_item();
        if (item.get_index() > 0) {
            cbbconducta.requestItems(item.get_value(), false);
        }
    }
 
    function cbbCanal_Eliminar_IndexChanging(sender, eventArgs) {
        var cbbconducta = $find("<%= cbb_eliminar_conducta.ClientID%>");
        var item = eventArgs.get_item();
        if (item.get_index() > 0) {
            cbbconducta.requestItems(item.get_value(), false);
        }
    }
     
    function cbbCanal_Modificar_IndexChanging(sender, eventArgs) {
        var cbbconducta_modificar = $find("<%= cbb_modificar_conducta.ClientID %>");
        var item = eventArgs.get_item();
        if (item.get_index() > 0) {
            cbbconducta_modificar.requestItems(item.get_value(),false);
        }
    }
    function cbbConducta_Modificar_IndexChanging(sender, eventArgs) {
        var cbbdocumentos_modificar = $find("<%= cbb_modificar_documento.ClientID %>");
        var item = eventArgs.get_item();
        if (item.get_index() > 0) {
            cbbdocumentos_modificar.requestItems(item.get_value(),false);
        }
    }
    function validarUpload(source, arguments) {
        arguments.IsValid = $find('<%= uploader.ClientID %>').validateExtensions();
    }
 
    function validarUpload_Modificar(source, arguments) {
        arguments.IsValid = $find('<%= uploaderModificar.ClientID %>').validateExtensions;
    }
 
    function mostrarDiv(opcion) {
        document.getElementById("divAgregar").style.display = "none";
        document.getElementById("divModificar").style.display = "none";
        document.getElementById("divEliminar").style.display = "none";
 
        if (opcion == "Agregar") {
            document.getElementById("divAgregar").style.display = "";
        }
        if (opcion == "Modificar") {
            document.getElementById("divModificar").style.display = "";
        }
        if (opcion == "Eliminar") {
            document.getElementById("divEliminar").style.display = "";
        }
    }
</script>
<body>
    <form id="form1" runat="server">
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server"
        Skin="Default">
    </telerik:RadAjaxLoadingPanel>
    <telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
    </telerik:RadScriptManager>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"
        EnablePageHeadUpdate="False">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="cbbCanal">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="cbbConducta"
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="bt_buscador_buscar">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grid_buscador_busqueda"
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grid_conductas">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grid_conductas"
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="bt_modificar_cargar">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="tbx_modificar_nombre"
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="grid_modificar_conductas"
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="grid_modificar_conductas">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grid_modificar_conductas"
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="Button1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="grid_eliminar_buscar"
                        LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>
    <telerik:RadTabStrip ID="RadTabStrip1" runat="server" SelectedIndex="0"
        MultiPageID="multiPage1">
        <Tabs>
            <telerik:RadTab runat="server" Text="Buscador" Selected="True">
            </telerik:RadTab>
            <telerik:RadTab runat="server" Text="Mantenedor">
            </telerik:RadTab>
        </Tabs>
    </telerik:RadTabStrip>
                 
    <telerik:RadMultiPage runat="server" ID="multiPage1" Height="270px"
        Width="822px" SelectedIndex="0">
        <telerik:RadPageView runat="server" Height="100px" ID="pageBuscador"><br />
            <table>
                <tr>
                    <td colspan="2"><asp:Label runat="server" ID="lbl_buscador_titulo" Text="Seleccione una opcion de busqueda"></asp:Label>
                    </td>
                </tr>
                <tr>
                    <td><asp:Label runat="server" ID="lbl_buscador_canal" Text="Seleccione un Canal"></asp:Label>
                    </td>
                    <td><telerik:RadComboBox runat="server" ID="cbbCanal"
                            DataTextField="canal"
                            DataValueField="id_canal" OnClientSelectedIndexChanging="cbbCanal_IndexChanging"
                        ></telerik:RadComboBox>
                    </td>
                </tr>
                <tr>
                    <td><asp:Label runat="server" ID="lbl_buscador_conducta" Text="Seleccione una Conducta"></asp:Label></td>
                    <td><telerik:RadComboBox runat="server" ID="cbbConducta"
                            EnableVirtualScrolling="True" DropDownWidth="1000px" DataTextField="conducta"
                            DataValueField="id_conducta" OnItemsRequested="cbbConducta_ItemsRequested">
                        </telerik:RadComboBox>
                    </td>       
                </tr>
                <tr>
                    <td colspan="2"><asp:Button runat="server" ID="bt_buscador_buscar" Text="Buscar"
                        onclick="bt_buscador_buscar_Click"/>
                    </td>
                </tr>
            </table>
            <br /><asp:Label runat="server" Text="Documentos encontrados: "></asp:Label>
            <br />
            <telerik:RadGrid ID="grid_buscador_busqueda" runat="server" AllowPaging="True"
                AllowMultiRowSelection="True" AutoGenerateColumns="False"
                OnItemDataBound="grid_buscador_busqueda_ItemDataBound"
                DataSourceID="sds_cargar_grid_consultas" GridLines="None"
                >
                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"
                    EnableImageSprites="True">
                </HeaderContextMenu>
                <MasterTableView DataSourceID="sds_cargar_grid_consultas">
                    <CommandItemSettings ExportToPdfText="Export to Pdf" />
                    <Columns>
                        <telerik:GridBoundColumn DataField="nombre" HeaderText="Documento">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="pagina" HeaderText="Pagina">
                        </telerik:GridBoundColumn>
                        <telerik:GridHyperLinkColumn DataNavigateUrlFields="ruta" HeaderText="Ver"
                            Target="Vista_PDF.aspx" Text="Ver" UniqueName="linkColumn">
                        </telerik:GridHyperLinkColumn>
                    </Columns>
                </MasterTableView>
                <ClientSettings>
                    <Selecting AllowRowSelect="true" EnableDragToSelectRows="true"/>
                </ClientSettings>
            </telerik:RadGrid>
            <asp:SqlDataSource ID="sds_cargar_grid_consultas" runat="server"
                ConnectionString="<%$ ConnectionStrings:prod_credichile_20110117.1509_2 %>"
                SelectCommand="se_CargarGridConsulta" SelectCommandType="StoredProcedure">
                <SelectParameters>
                    <asp:ControlParameter ControlID="cbbCanal" Name="parIntIdCanal"
                        PropertyName="SelectedValue" Type="Int32"
                        ConvertEmptyStringToNull="true" />
                    <asp:ControlParameter ControlID="cbbConducta" Name="parIntIdConducta"
                        PropertyName="SelectedValue" Type="Int32"
                        ConvertEmptyStringToNull="true" />
                </SelectParameters>
            </asp:SqlDataSource>
        </telerik:RadPageView>
        <telerik:RadPageView runat="server" ID="pageMantenedor"><br />
            <table>
                <tr>
                <td><asp:Button runat="server" ID="btAgregar" Text="Agregar Docuento" OnClientClick="mostrarDiv('Agregar');return false;"/></td>
                <td><asp:Button runat="server" ID="btModificar" Text="Modificar Documento" OnClientClick="mostrarDiv('Modificar');return false;"/></td>
                <td><asp:Button runat="server" ID="btEliminar" Text="Eliminar Documento" OnClientClick="mostrarDiv('Eliminar');return false;"/></td>
                </tr>
            </table>
            <div runat="server" id="divAgregar" style="display:none"><br />
                <table>
                    <tr>
                        <td colspan="2">
                            <telerik:RadUpload runat="server" ID="uploader"
                            MaxFileInputsCount="1" AllowedFileExtensions=".pdf"
                            Localization-Add="Agregar" Localization-Select="Archivo"
                            Localization-Remove="Quitar" Localization-Delete="Borrar"
                            EnableTheming="True" ControlObjectsVisibility="None">
                                <Localization Add="Agregar" Delete="Borrar" Remove="Quitar" />
                            </telerik:RadUpload></td>
                    </tr>
                    <tr>
                        <td><asp:Label runat="server" ID="lbl_agregar_nombre" Text="Nombre"></asp:Label></td>
                        <td><telerik:RadTextBox runat="server" ID="tbx_agregar_nombre"></telerik:RadTextBox></td>
                    </tr>
                    <tr>
                        <td><asp:Button runat="server" id="bt_agregar" Text="Agregar"
                                onclick="bt_agregar_Click"/></td>
                        <td>
                            <asp:CustomValidator runat="server" ID="CustomValidator1"
                                Display="Dynamic" ClientValidationFunction="validarUpload">
                                <span>Extension Invalida</span>
                            </asp:CustomValidator>
                        </td>
                    </tr>
                </table>
                <br />
                <br />
                <asp:Label runat="server" ID="lbl_agregar_mensaje" Text="Seleccione conducta(s) asociada(s): "></asp:Label>
                <telerik:RadGrid ID="grid_conductas" runat="server"
                    AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
                    AllowAutomaticUpdates="True" AllowFilteringByColumn="True"
                    AllowMultiRowSelection="True" AllowPaging="true" AllowSorting="False"
                    AutoGenerateColumns="False" DataSourceID="sds_cargar_grid_conductas"
                    GridLines="None" OnInit="grid_conductas_Init">
                    <MasterTableView DataKeyNames="id_conducta,id_canal"
                        DataSourceID="sds_cargar_grid_conductas">
                        <CommandItemSettings ExportToPdfText="Export to Pdf" />
                        <Columns>
                            <telerik:GridClientSelectColumn>
                            </telerik:GridClientSelectColumn>
                            <telerik:GridBoundColumn DataField="id_conducta" DataType="System.Int32"
                                HeaderText="id_conducta" ReadOnly="True" SortExpression="id_conducta"
                                UniqueName="id_conducta" Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn HeaderText="Pagina" UniqueName="pagina">
                                <ItemTemplate>
                                    <telerik:RadNumericTextBox runat="server" MinValue="0"
                                        ID="tbx_pagina_agregar" NumberFormat-DecimalDigits="0">
                                    </telerik:RadNumericTextBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="conducta"
                                FilterListOptions="VaryByDataTypeAllowCustom" HeaderText="Conducta"
                                SortExpression="conducta" UniqueName="conducta">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="id_canal" HeaderText="ID_Canal"
                                ReadOnly="True" SortExpression="id_canal" UniqueName="id_canal"
                                Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="canal"
                                FilterListOptions="VaryByDataTypeAllowCustom" HeaderText="Canal"
                                SortExpression="canal" UniqueName="canal">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings>
                        <Selecting AllowRowSelect="true" />
                    </ClientSettings>
                </telerik:RadGrid>
                <asp:SqlDataSource ID="sds_cargar_grid_conductas" runat="server"
                    ConnectionString="<%$ ConnectionStrings:prod_credichile_20110117.1509_2 %>"
                    SelectCommand="se_CargarConductasGrid" SelectCommandType="StoredProcedure">
                </asp:SqlDataSource>
            </div>
            <div runat="server" id="divModificar" style="display:none"><br />
                <table>
                    <tr>
                        <td><asp:Label runat="server" id="lbl_modificar_canal" Text="Seleccione un Canal"></asp:Label></td>
                        <td><telerik:RadComboBox runat="server" id="cbb_modificar_canal"
                            OnClientSelectedIndexChanging="cbbCanal_Modificar_IndexChanging"
                            DataTextField="canal" DataValueField="id_canal"></telerik:RadComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td><asp:Label runat="server" ID="lbl_modificar_conducta" Text="Seleccione una Conducta"></asp:Label></td>
                        <td><telerik:RadComboBox runat="server" ID="cbb_modificar_conducta"
                            EnableVirtualScrolling="true" OnItemsRequested="cbb_modificar_conducta_ItemsRequested"
                            DropDownWidth="1000px" OnClientSelectedIndexChanging="cbbConducta_Modificar_IndexChanging"></telerik:RadComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td><asp:Label runat="server" ID="lbl_modificar_documento" Text="Seleccione un Documento"></asp:Label></td>
                        <td><telerik:RadComboBox runat="server" ID="cbb_modificar_documento"
                            EnableVirtualScrolling="true" OnItemsRequested="cbb_modificar_documento_ItemsRequested"
                            ></telerik:RadComboBox>
                        </td>
                    </tr>
                    <tr>
                        <td><asp:Button runat="server" ID="bt_modificar_cargar" Text="Cargar Documento"
                                OnClick="bt_modificar_cargar_Click"/></td>
                        <td><asp:Button runat="server" ID="bt_modificar" Text="Modificar"
                                OnClick="bt_modificar_Click"/></td>
                        <td>
                            <asp:CustomValidator runat="server" ID="CustomValidator2"
                                Display="Dynamic" ClientValidationFunction="validarUpload_Modificar">
                                <span>Extension Invalida</span>
                            </asp:CustomValidator>
                        </td>
                    </tr>
                </table>
                <br />
                <table>
                    <tr>
                        <td colspan="2"><telerik:RadUpload runat="server" ID="uploaderModificar"
                            MaxFileInputsCount="1" EnableTheming="True" AllowedFileExtensions=".pdf"
                            Localization-Add="Agregar" Localization-Select="Archivo"
                            Localization-Remove="Quitar" Localization-Delete="Borrar"
                            ControlObjectsVisibility="None"
                            >
                                <Localization Add="Agregar" Delete="Borrar" Remove="Quitar" />
                            </telerik:RadUpload></td>
                    </tr>
                    <tr>
                        <td><asp:Label runat="server" ID="lbl_modificar_nombre" Text="Nombre"></asp:Label></td>
                        <td><telerik:RadTextBox runat="server" ID="tbx_modificar_nombre"></telerik:RadTextBox></td>
                    </tr>
                </table>
                <asp:Label runat="server" ID="lbl_modificar_mensaje" Text="Seleccione conductas asociadas: "></asp:Label>
                <br />
                <telerik:RadGrid runat="server" id="grid_modificar_conductas"
                    AllowAutomaticDeletes="true" AllowAutomaticInserts="true"
                    AllowAutomaticUpdates="true" AllowFilteringByColumn="true"
                    AllowMultiRowSelection="true" AutoGenerateColumns="false"
                    DataSourceID="sds_cargar_grid_modificar" OnInit="grid_conductas_Init">
                    <MasterTableView AllowPaging="true" DataSourceID="sds_cargar_grid_modificar">
                        <Columns>
                            <telerik:GridClientSelectColumn>
                            </telerik:GridClientSelectColumn>
                            <telerik:GridBoundColumn DataField="id_documento" HeaderText="id_documento"
                                Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="id_conducta" HeaderText="id_conducta"
                                Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridTemplateColumn>
                                <ItemTemplate>
                                    <telerik:RadNumericTextBox runat="server" id="tbx_pagina_modificar"
                                        DbValue='<%# Bind("pagina")%>' MinValue="0" NumberFormat-DecimalDigits="0">
                                    </telerik:RadNumericTextBox>
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridBoundColumn DataField="conducta" UniqueName="conducta" HeaderText="Conducta">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings>
                        <Selecting AllowRowSelect="true"/>
                    </ClientSettings>
                </telerik:RadGrid>
                <asp:SqlDataSource ID="sds_cargar_grid_modificar" runat="server"
                    ConnectionString="<%$ ConnectionStrings:prod_credichile_20110117.1509_2 %>"
                    SelectCommand="se_CargarConductas_Modificar"
                    SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="cbb_modificar_documento"
                            Name="parIntIdDocumento" PropertyName="SelectedValue" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </div>
            <div runat="server" id="divEliminar" style="display:none"><br />
                <table>
                    <tr>
                        <td><asp:Label runat="server" ID="lbl_eliminar_canal" Text="Seleccione un Canal" /></td>
                        <td><telerik:RadComboBox runat="server" ID="cbb_eliminar_canal"
                                DataTextField="canal" DataValueField="id_canal"
                                OnClientSelectedIndexChanging="cbbCanal_Eliminar_IndexChanging"></telerik:RadComboBox>
                        </td>                       
                    </tr>
                    <tr>
                        <td><asp:Label runat="server" ID="lbl_eliminar_conducta" Text="Seleccione una Conducta"></asp:Label></td>
                        <td><telerik:RadComboBox runat="server" ID="cbb_eliminar_conducta"
                                EnableVirtualScrolling="True" DropDownWidth="1000px"
                                DataTextField="conducta" DataValueField="id_conducta"
                                OnItemsRequested="cbbConducta_Eliminar_ItemsRequested"></telerik:RadComboBox>
                        </td>       
                    </tr>
                    <tr>
                        <td ><asp:Button runat="server" ID="bt_eliminar" Text="Eliminar"
                        onclick="bt_eliminar_Click"/>
                        </td>
                        <td><asp:Button runat="server" ID="Button1" Text="Buscar"
                        onclick="bt_buscador_buscar_eliminar_Click"/>
                        </td>
                    </tr>
                </table>
                <br /><asp:Label ID="Label1" runat="server" Text="Documentos encontrados: "></asp:Label>
                <br />
                <telerik:RadGrid ID="grid_eliminar_buscar" runat="server"
                    AllowMultiRowSelection="True" AllowPaging="True" AllowSorting="False"
                    AutoGenerateColumns="False" DataSourceID="sds_cargar_grid_documentos"
                    GridLines="None">
                    <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default"
                        EnableImageSprites="True">
                    </HeaderContextMenu>
                    <MasterTableView DataSourceID="sds_cargar_grid_documentos">
                        <CommandItemSettings ExportToPdfText="Export to Pdf" />
                        <Columns>
                            <telerik:GridClientSelectColumn>
                            </telerik:GridClientSelectColumn>
                            <telerik:GridBoundColumn DataField="id_documento" HeaderText="id_documento"
                                Visible="false">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="nombre" HeaderText="Documento">
                            </telerik:GridBoundColumn>
                        </Columns>
                    </MasterTableView>
                    <ClientSettings>
                        <Selecting AllowRowSelect="true" />
                    </ClientSettings>
                </telerik:RadGrid>
                <asp:SqlDataSource ID="sds_cargar_grid_documentos" runat="server"
                    ConnectionString="<%$ ConnectionStrings:prod_credichile_20110117.1509_2 %>"
                    SelectCommand="se_CargarDocumentosGrid" SelectCommandType="StoredProcedure">
                    <SelectParameters>
                        <asp:ControlParameter ControlID="cbb_eliminar_conducta" DefaultValue="0"
                            Name="parIntIdConducta" PropertyName="SelectedValue" Type="Int32" />
                    </SelectParameters>
                </asp:SqlDataSource>
            </div>
        </telerik:RadPageView>   
    </telerik:RadMultiPage>
    </form>
</body>
</html>


The error:

//<![CDATA[
Sys.WebForms.PageRequestManager._initialize('RadScriptManager1', document.getElementById('form1'));
Sys.WebForms.PageRequestManager.getInstance()._updateControls(['tRadAjaxManager1SU'], [], [], 90);
//]]>

Sys.Application.add_init(function() {

web.config:

<?xml version="1.0"?>
<configuration>
    <configSections>
        <sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
            <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                <section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35">
                    <section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/>
                    <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                    <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/>
                </sectionGroup>
            </sectionGroup>
        </sectionGroup>
    </configSections>
    <appSettings/>
    <connectionStrings>
        ...
    </connectionStrings>
    <system.web>
        <compilation debug="true">
            <assemblies>
                <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
                <add assembly="System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
                <add assembly="System.Speech, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></assemblies>
        </compilation>
        <!-- <authentication mode="Windows"/> -->
        <customErrors mode="Off"/>
        <pages>
            <controls>
                <add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
                <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            </controls>
        </pages>
        <httpHandlers>
            <remove verb="*" path="*.asmx"/>
            <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" validate="false"/>
            <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false"/>
        </httpHandlers>
        <httpModules>
            <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </httpModules>
    </system.web>
    <system.codedom>
        <compilers>
            <compiler language="c#;cs;csharp" extension=".cs" warningLevel="4" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="WarnAsError" value="false"/>
            </compiler>
            <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" warningLevel="4" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
                <providerOption name="CompilerVersion" value="v3.5"/>
                <providerOption name="OptionInfer" value="true"/>
                <providerOption name="WarnAsError" value="false"/>
            </compiler>
        </compilers>
    </system.codedom>
    <!--
        La sección system.webServer es necesaria para ejecutar ASPN.NET AJAX en Internet
        Information Services 7.0. No es necesaria para la versión anterior de IIS.
    -->
    <system.webServer>
        <validation validateIntegratedModeConfiguration="false"/>
        <modules>
            <remove name="ScriptModule"/>
            <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
        </modules>
        <handlers>
            <remove name="WebServiceHandlerFactory-Integrated"/>
            <remove name="ScriptHandlerFactory"/>
            <remove name="ScriptHandlerFactoryAppServices"/>
            <remove name="ScriptResource"/>
            <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
            <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource"/>
        </handlers>
    </system.webServer>
    <runtime>
        <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/>
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
            <dependentAssembly>
                <assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/>
                <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/>
            </dependentAssembly>
        </assemblyBinding>
    </runtime>
</configuration>


Search the internet and found some possible solutions:

Adding RadControls for ASP.NET Ajax

But none has worked for me, please help

Best regards
Tsvetina
Telerik team
 answered on 03 Feb 2011
2 answers
199 views
I'm trying to create a radgrid dynamically and bind it to a dynamically created ObjectDataSource, but grid is always empty (maxRows is 0 in GetData method).  What did I do  wrong?

Next question is this._grid.DataBind() in OnLoad method. Is it necessary? After it grid will show data, but paging will not work (other pages will by empty).

Standard GridView seems to be working correctly.

Here is full sources

using System;
using System.ComponentModel;
using System.Data;
using System.Globalization;
using System.Web.UI;
using System.Web.UI.WebControls;
using Oracle.DataAccess.Client;
using Parus.Core;
using Telerik.Web.UI;
 
namespace WebDesigner
{
    public partial class WebForm1 : Page
    {
        private RadGrid _grid;
        private GridView _grid2;
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);
            this._grid = CreateGrid();
            this.GridPlaceHolder.Controls.Add(this._grid);
            this._grid2 = CreateGrid2();
            this.GridPlaceHolder.Controls.Add(this._grid2);
        }
 
        protected override void OnLoad(EventArgs e)
        {
            base.OnLoad(e);
            RadAjaxManager.AjaxSettings.AddAjaxSetting(this._grid, this._grid);
            RadAjaxManager.AjaxSettings.AddAjaxSetting(this._grid2, this._grid2);
            //_grid.DataBind();
            _grid2.DataBind();
        }
 
        private static RadGrid CreateGrid()
        {
            var grid = new RadGrid
                           {
                               Width = new Unit(100, UnitType.Percentage),
                               ID = "grid_test",
                               Skin = "Windows7",
                               PageSize = 10,
                               AllowPaging = true,
                               AutoGenerateColumns = false,
                               GroupingEnabled = false,
                               ShowGroupPanel = false,
                           };
            grid.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
            grid.PagerStyle.AlwaysVisible = true;
            grid.NeedDataSource += Grid_NeedDataSource;
 
            grid.MasterTableView.Width = new Unit(100, UnitType.Percentage);
            grid.MasterTableView.PageSize = grid.PageSize;
            grid.MasterTableView.AllowPaging = grid.AllowPaging;
            grid.MasterTableView.PagerStyle.Mode = grid.PagerStyle.Mode;
            grid.MasterTableView.PagerStyle.AlwaysVisible = grid.PagerStyle.AlwaysVisible;
            grid.MasterTableView.AutoGenerateColumns = grid.AutoGenerateColumns;
 
            var gridColumn = new GridBoundColumn();
            gridColumn.DataField = "NRN";
            gridColumn.HeaderText = "Ident";
            grid.MasterTableView.Columns.Add(gridColumn);
 
            gridColumn = new GridBoundColumn();
            gridColumn.DataField = "SCODE";
            gridColumn.HeaderText = "Caption";
            grid.MasterTableView.Columns.Add(gridColumn);
 
            return grid;
        }
 
        private GridView CreateGrid2()
        {
            var grid = new GridView
                           {
                               Width = new Unit(100, UnitType.Percentage),
                               ID = "grid_test2",
                               PageSize = 10,
                               AllowPaging = true,
                               AutoGenerateColumns = false,
                               DataSource = new MyDataSource(typeof(CustomDataProxy))
                           };
 
            grid.PageIndexChanging += Grid2_PageIndexChanging;
 
            var gridColumn = new BoundField();
            gridColumn.DataField = "NRN";
            gridColumn.HeaderText = "Ident";
            grid.Columns.Add(gridColumn);
 
            gridColumn = new BoundField();
            gridColumn.DataField = "SCODE";
            gridColumn.HeaderText = "Caption";
            grid.Columns.Add(gridColumn);
 
            return grid;
 
        }
 
        private void Grid2_PageIndexChanging(object sender, GridViewPageEventArgs e)
        {
            this._grid2.PageIndex = e.NewPageIndex;
            this._grid2.DataBind();
        }
 
        private static void Grid_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            var grid = sender as RadGrid;
            grid.DataSource = new MyDataSource(typeof(CustomDataProxy));
        }
    }
 
    #region MyObjectDataSource
 
    [DataObject]
    public class MyDataSource : ObjectDataSource
    {
        public MyDataSource(Type type)
        {
            this.DataProxy = type;
            TypeName = type.FullName;
            SelectCountMethod = "GetTotalRowsCount";
            SelectMethod = "GetData";
            EnablePaging = true;
            MaximumRowsParameterName = "maxRows";
            StartRowIndexParameterName = "firstRow";
            SortParameterName = "orderFields";
            ObjectCreating += OnObjectCreating;
        }
 
        private Type DataProxy
        {
            get;
            set;
        }
 
        private void OnObjectCreating(object sender, ObjectDataSourceEventArgs e)
        {
            e.ObjectInstance = Activator.CreateInstance(DataProxy, new[] { "V_WEBTEST_CODE" });
        }
    }
 
    #endregion
 
    #region Custom DataObject
 
    public class CustomDataProxy : BaseDataProxy
    {
        private readonly string _tableName;
        public CustomDataProxy(string tableName)
        {
            this._tableName = tableName;
        }
 
 
        public override string TableName
        {
            get
            {
                return this._tableName;
            }
        }
    }
 
    [DataObject]
    public abstract class BaseDataProxy
    {
        private const string CCountQuery = "select count(*) from {0}";
        private const string CSelectTemplate = "select * from {0}";
        private const string COrderTemplate = " order by {0}";
        private const string CPagingQuery = "select * from (select rownum rownum#, T.* from ({0}) T) where rownum# between :StartRow and :EndRow";
 
        abstract public string TableName
        {
            get;
        }
 
        public int GetTotalRowsCount()
        {
            using (var connection = Dispatcher.Instance.CreateConnection())
            {
                var queryText = string.Format(CCountQuery, this.TableName);
                using (var query = new OracleCommand(queryText, connection)
                                       {
                                           CommandType = CommandType.Text
                                       })
                {
                    var result = query.ExecuteScalar();
                    return result != null ? Convert.ToInt32(result, CultureInfo.CurrentCulture) : 0;
                }
            }
        }
 
        [DataObjectMethod(DataObjectMethodType.Select, true)]
        public DataTable GetData(int firstRow, int maxRows, string orderFields)
        {
            using (var connection = Dispatcher.Instance.CreateConnection())
            {
                var queryText = string.Format(CSelectTemplate, this.TableName);
                if (!string.IsNullOrEmpty(orderFields))
                {
                    queryText += string.Format(COrderTemplate, orderFields);
                }
 
                queryText = string.Format(CPagingQuery, queryText);
 
                var query = new OracleCommand(queryText, connection)
                {
                    CommandType = CommandType.Text
                };
 
                query.Parameters.Add(@"StartRow", firstRow + 1);
                query.Parameters.Add(@"EndRow", firstRow + maxRows);
 
                using (var a = new OracleDataAdapter(query))
                {
                    var dt = new DataTable
                    {
                        Locale = CultureInfo.CurrentCulture
                    };
 
                    a.Fill(dt);
                    return dt;
                }
            }
        }
    }
 
    #endregion
}

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebDesigner.WebForm1" %>
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
  <title></title>
</head>
<body>
  <form id="form1" runat="server">
  <telerik:RadScriptManager ID="RadScriptManager" runat="server">
  </telerik:RadScriptManager>
  <asp:PlaceHolder ID="GridPlaceHolder" runat="server"></asp:PlaceHolder>
  <telerik:RadAjaxManager ID="RadAjaxManager" runat="server">
  </telerik:RadAjaxManager>
  </form>
</body>
</html>
alex lexx
Top achievements
Rank 1
 answered on 03 Feb 2011
1 answer
102 views
Hi Telerik,

I have a dynamically created Dock and its content is a chart. I load the content for the dock like so:

private void LoadDockContent(RadDock dock)
{
    System.Web.UI.Control ctrl = Page.LoadControl("PowerUsage.ascx");
    dock.ContentContainer.Controls.Add(ctrl);
}

I need to be able to access the name of the control ClientSide.

I suspect it's something like this, but I'm not quite on:

<script type="text/javascript">
    function OnClientInitialize(dock, args) {
        var content = dock.get_contentContainer();
        var control = $telerik.isIE ? content.childNodes[0].innerHTML : content.childNodes[1].innerHTML;
        alert(control);
    }
</script>

The alert displays a dump of all the HTML in the dock. This does include the control I am looking for, but there would be some extremely heavy parsing necessary to isolate the string that I want from the HTML. I've attached to this post "html.png" which is the output of the alert.

If I could just get the img id instead of all the HTML I would be happier, but I would be happiest if I could capture the control name without any parsing, obviously. Ultimately, my goal is to utilize some jQuery to resize the chart control stored on the RadDock. Just to make sure I'm not headed down a dark path, I would also just like to get a quick, "Yep. That should work!" from you guys.

<script type="text/javascript">
    jQuery(function($) {
            $(window).wresize(SetPageChartSizes<%= Chart.ClientID %>);
            SetPageChartSizes<%= Chart.ClientID %>();
        });
                 
        function SetPageChartSizes<%= Chart.ClientID %>() {
            document.getElementById('<%= hfChartWidth.ClientID %>').value = (document.getElementById('<%= updatePanel.ClientID %>').offsetWidth - 4);
            <%=Page.GetPostBackEventReference(btnHidden_Charts)%>;
    }
</script>

So, this code isn't 100% relevant to what I've got going on, yet. This function waits for the window to be resized and then resizes Chart based on the new window size. I am going to rewrite this so that whenever the size of the Dock changes the content it controls (a chart) will resize to fill the size of the dock. Chart doesn't just exist on the page, though. I have to get a handle on that -- which means I need to get the control name from the Dock.

Let me know if anything here is unclear.

Thanks,

Sean
Pero
Telerik team
 answered on 03 Feb 2011
1 answer
76 views
Hi Team,

i have the below code for enabling the VirtualScrollPaging on grid. this is working fine on Mozilla. but on IE 7 (not checked on other IE version) when i am scrolling it jumping the scroll to 20-40 pages. here i noticed one thing is that the scroll bar size is diffrent in both MOzilla and IE 7. i had attached the screen shots with mail.

Code :
<telerik:RadGrid CssClass="RadGrid" GridLines="None" BorderStyle="None" ID="grdNominationDetails"
                        Width="100%" runat="server" AutoGenerateColumns="false" AllowPaging="true" AllowSorting="true"
                        alternatingrowstyle-cssclass="alternate" OnDeleteCommand="grdNominationDetails_RowDeleting"
                        OnSortCommand="grdNominationDetails_Sorting" OnItemDataBound="grdNominationDetails_RowDataBound" PageSize="20">
                        <PagerStyle Mode="NumericPages" PageButtonCount="20" AlwaysVisible="true" />
                        
                        <%--<EmptyDataTemplate>
                                            <center>
                                                <asp:Label ID="lblNoNominationsMessage" CssClass="error-message" runat="server" Text="Nomination Data not available.<br>Please click 'Import HIPO Nomination Data' to upload nomination data."></asp:Label>
                                            </center>
                                        </EmptyDataTemplate>--%>
                        <MasterTableView AllowNaturalSort="true" >
                            <Columns>
                                <telerik:GridTemplateColumn HeaderText="Nominated" ItemStyle-HorizontalAlign="Center"
                                    SortExpression="PMConfirmation" HeaderStyle-Width="14%" >
                                    <ItemTemplate>
                                        <div style="text-align: center;">
                                            <asp:CheckBox ID="chkPMConfirmation" runat="server" Checked='<%# ConvertNominationStatusToBool(Eval("PMConfirmation") as bool?) %>' />
                                        </div>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Employee Name" HeaderStyle-Width="30%"
                                    SortExpression="LastName">
                                    <ItemTemplate>
                                        <a href="../../Develop/CandidateProfile.aspx?uid=<%# GetUserId( Eval("UserId")) %>">
                                            <%# FormatName(Eval("FirstName"),Eval("LastName"))%>
                                        </a>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Nominator Name" HeaderStyle-Width="28%"
                                    SortExpression="NominatorLastName">
                                    <ItemTemplate>
                                        <div class="wordwrap">
                                            <asp:Literal ID="ltlNominatorName" runat="server" Text='<%# FormatName(Eval("NominatorFirstName"), Eval("NominatorLastName")) %>'></asp:Literal>
                                        </div>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderText="Status" ItemStyle-HorizontalAlign="Center"
                                    HeaderStyle-Width="20%"  SortExpression="Nominated">
                                    <ItemTemplate>
                                        <asp:DropDownList ID="ddlNominationStatus" runat="server">
                                        </asp:DropDownList>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                                <telerik:GridTemplateColumn HeaderStyle-Width="8%"  HeaderText="Edit">
                                    <ItemTemplate>
                                        <div style="text-align: center;">
                                            <asp:ImageButton ToolTip="Delete" OnClientClick="ShowModal(this,'HIPO Candidate Delete Warning','Are you sure you want to delete this HIPO candidate?');return false;"
                                                ID="imgDelete" ImageUrl="~/images/icon_delete_competency.gif" runat="server"
                                                CausesValidation="false" CommandName="Delete" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "UserId") %>'
                                                Text="Delete"></asp:ImageButton>
                                        </div>
                                    </ItemTemplate>
                                </telerik:GridTemplateColumn>
                            </Columns>
                        </MasterTableView>
                        <ClientSettings EnableRowHoverStyle="true" EnableAlternatingItems="true">
                            
                            <Scrolling AllowScroll="True" UseStaticHeaders="True" EnableVirtualScrollPaging="true">
                            </Scrolling>
                        </ClientSettings>
                    </telerik:RadGrid>
Tsvetina
Telerik team
 answered on 03 Feb 2011
1 answer
81 views
Hi,

I'm using the example posted on the following link
http://demos.telerik.com/aspnet-ajax/tooltip/examples/tooltipcalendar/defaultcs.aspx


When I try to click on a date associated with a tooltip in IE8 (8.0.6001.18702), I get an unknown runtime error in ScriptResource.axd
The page works fine in Firefox, Chrome and Opera..

Any Ideas??

Source Code for page containing the calendar
public partial class rcalendar : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {    }
    protected void RadCalendar1_DayRender(object sender, Telerik.Web.UI.Calendar.DayRenderEventArgs e)
    {
        int ID = e.Day.Date.Day;
         if (ID == 3 || ID == 5 || ID == 14)
        {
            TableCell cell = e.Cell;
            cell.Attributes.Add("onclick", "ShowToolTip(this);");
            cell.Attributes.Add("id", "Calendar_" + ID.ToString());
        }
     }
    protected void RadToolTipManager1_AjaxUpdate(object sender, Telerik.Web.UI.ToolTipUpdateEventArgs e)
    {
        CalendarTT cdrTTobj = (CalendarTT)this.LoadControl("CalendarTT.ascx");
         cdrTTobj.Dateid = int.Parse(e.Value);
        cdrTTobj.ID = Guid.NewGuid().ToString();
         e.UpdatePanel.ContentTemplateContainer.Controls.Add(cdrTTobj);
    }
}

aspx page for calendar
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="rcalendar.aspx.cs" Inherits="CdrApp.rcalendar" %>
<%@ Register Src="CalendarTT.ascx" TagName="CalendarTT" TagPrefix="uc1" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
    <style type="text/css">
 
         
 
    .RadCalendar .rcRow td
    {
        text-align: center !important;
        vertical-align: middle !important;
        width: 50px;
    }
 
 
</style>
</head>
<body style="height: 462px">
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
    <script type="text/javascript">
 
        function ShowToolTip(sender) {
            var tooltipManager = $find("<%=RadToolTipManager1.ClientID %>");
 
            //If the user hovers the image before the page has loaded, there is no manager created
            if (!tooltipManager) return;
 
            //Find the tooltip for this element if it has been created
            var tooltip = tooltipManager.getToolTipByElement(sender);
 
            //Create a tooltip if no tooltip exists for such element
            if (!tooltip) {
                tooltip = tooltipManager.createToolTip(sender);
                var longValue = sender.getAttribute("ID");
                var neededValue = longValue.substring(longValue.indexOf('_') + 1)
                tooltip.set_value(neededValue);
                tooltip.show();
            }
        }
 
        </script>
     
    </telerik:RadCodeBlock>
 
    <div>
     
                <telerik:RadCalendar ID="RadCalendar1" Runat="server" DayNameFormat="Full"
                    EnableMultiSelect="False" Height="300px" SelectedDate="" TitleAlign="Center"
                    ViewSelectorText="x" Width="300px" PresentationType="Preview"
                    ShowRowHeaders="False"
                    ondayrender="RadCalendar1_DayRender">
                    </telerik:RadCalendar>
                    <telerik:RadToolTipManager ID="RadToolTipManager1" runat="server"
        onajaxupdate="RadToolTipManager1_AjaxUpdate" Animation="Fade"
        AutoCloseDelay="30000" EnableShadow="True" EnableTheming="True"
        HideEvent="LeaveTargetAndToolTip" ShowEvent="OnClick" BorderStyle="Outset"
        Position="Center">
    </telerik:RadToolTipManager>
    </div>
    </form>
</body>
</html>




Thanks..
Ron
Top achievements
Rank 1
 answered on 03 Feb 2011
2 answers
262 views
I am trying to updated a RadGrid based on what is selected in a RadComboBox but the grid displays nothing.  The Grid's SQL DataSource is tied to a stored procedure which accepts a parameter (CustBill) from the RadComboBox.  Ajax Manager is setup to update both the RadGrid and RadComboBox but the stored procedure returns 0 results no matter what is selected in the combo box.  Here is the AjaxManager, RadComboBox, and SQL Datasource code.  Is AjaxManager refreshing the controls properly?  Your help is appreciated. 
-Scott

 

 

***
<
telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"

 

 

 

DefaultLoadingPanelID="RadAjaxLoadingPanel1">

 

 

 

  <AjaxSettings>

 

 

 

  <telerik:AjaxSetting AjaxControlID="RadComboBox1">

 

 

 

    <UpdatedControls>

 

 

 

        <telerik:AjaxUpdatedControl ControlID="RadComboBox1" />

 

 

 

        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

 

    </UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

 

 

</AjaxSettings>

 

 

 

</telerik:RadAjaxManager>



***
<telerik:RadComboBox ID="RadComboBox1" Runat="server"

 

 

 

    DataSourceID="SqlDataSource1" DataTextField="CustBill"

 

 

 

    DataValueField="CustBill" Height="122px" Skin="Windows7" Width="319px">

 

 

 

 

 

 

 

    <Items>

 

 

 

 

 

 

 

        <telerik:RadComboBoxItem Text="All" Value="0" Selected="true" />

 

 

 

 

 

 

 

    </Items>

 

 

 

 

 

 

 

</telerik:RadComboBox>

 

 

 

 


*** This SQL Data Source populates the combo box ***

 

<

 

 

asp:SqlDataSource ID="SqlDataSource1" runat="server"

 

 

 

    ConnectionString="<%$ ConnectionStrings:crmDashboardConnectionString %>"

 

 

 

    SelectCommand="SELECT TOP (10) CustBill FROM crmSalesSuperior WHERE (CustBill IN (SELECT CustBill FROM crmSalesSuperior AS crmSalesSuperior_1 WHERE (Branch = 102))) GROUP BY CustBill ORDER BY CustBill">

 

 

 

 

</asp:SqlDataSource>

 

 

 

 



*** This is the Grid's SQL data source, calling a stored procedure with a parameter from combo box. ***

 

 

 

 

<asp:SqlDataSource ID="SqlDataSource2" runat="server"

 

 

 

ConnectionString="<%$ ConnectionStrings:crmDashboardConnectionString %>"

 

 

 

SelectCommand="CRMDashboardSales" SelectCommandType="StoredProcedure">

 

 

 

 

    <SelectParameters>

 

 

 

 

        <asp:ControlParameter Name="CustBill" ControlID="RadComboBox1"

 

 

 

            PropertyName="SelectedValue" Type="String"

 

 

 

            DefaultValue="Power Equipment Co " />

 

 

 

 

    </SelectParameters>

 

 

 

 

</asp:SqlDataSource>

 

 

 

 




 

Scott
Top achievements
Rank 1
 answered on 03 Feb 2011
3 answers
96 views
I am using the Q3 2008 controls currently.

I have a radWindow I am opneing and setting options via JavaScript:

 

 

 

function openWindow() {  
        window.setTimeout(function() {  
            var oManager = GetRadWindowManager();  
            var rdWin = oManager.open('<%=WindowURL%> ''rwVideoTutorial');  
            rdWin.set_status('Video Tutorial <%=HelpVideoID %> ');  
            rdWin.set_behaviors(Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move);  
            rdWin.center;  
            rdWin.remove_resize;  
            rdWin.add_dragEnd(OnClientDragEnd);  
            rdWin.setSize(620, 430);  
        }, 1000);  
    }  
 
    function OnClientDragEnd(sender, eventArgs) {  
        var oManager = GetRadWindowManager();  
        var oWnd = oManager.getWindowById(sender.get_id());  
                oWnd.reload();  
 
          
    } 

I am embeding a YouTube video on a page that is loaded by the RadWindow. In IE8 some strange things are happening. I added the OnClinetDragEnd in hopes that the content would reload, but it doesn't in IE8 unless I have IE8 in compatability mode. If hte winodw is draged in IE8 the audio cuts out fromt he video, so I thought I could jsut reload the content. Also, when the window closes and the video is still running, you can still hear the audio after the window is clsoed. I am not experiencing any of these issues with FireFox. 

Ultimately, I would like the content to reload as it does in FireFox, but in FireFox I really don't need to reload the content, because even after the window is done being dragged the video plays from where it left off.

If I can;t get this to work IN IE8 like it does in FF, how can I set the window to be destroyed via Javascript? I have the window set to be destroyed in the ASPX code, but I guess, since I am openeing it via javascript that doesn't matter.

Daniel

 

 

Georgi Tunev
Telerik team
 answered on 03 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?