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

I'm Using this default for my grid. i want to change the row color for some condition in rad item databound. but it changing the row color.
when i mouse over the row of the changed color i'm getting default color that from (item Created) on mouse out i'm getting white color (item created) but i need that Changed color from item databound.

protected void Grd1_ItemCreated(object sender, Telerik.Web.UI.GridItemEventArgs e)
        {
            GridItemType item = e.Item.ItemType;

            switch (item)
            {
                case GridItemType.AlternatingItem:
                case GridItemType.Item:

                    TableRow row = e.Item as TableRow;
                    string clr = "white";

                    row.Attributes.Add("onmouseover", "this.style.backgroundColor = 'Yellow';");
                    row.Attributes.Add("onmouseout", "this.style.backgroundColor = '" + clr + "';");
                    break;
            }
        }

protected void Grd1_ItemDataBound(object sender, GridItemEventArgs e)
        {

if ((e.Item.ItemType == GridItemType.Item) || (e.Item.ItemType == GridItemType.AlternatingItem))
            {

string _No= grdScheduledPatients.MasterTableView.DataKeyValues[e.Item.ItemIndex]["Datakey"].ToString();

if (_No == "1")
                {
                    e.Item.BackColor = System.Drawing.Color.Green;
                }

}
        }

Give me idea How to change the row color without change the old row color..


Regards,
Ashok Anbarasu
Pavlina
Telerik team
 answered on 02 Feb 2011
2 answers
140 views
I am trying to filter a grid's data based on values selected in a combo box.  The combo box values are databound to a table and the grid is using a SQL Server stored procedure.  When I try to run the code I receive the following error:

ERROR [42000] [Microsoft][ODBC SQL Server Driver][SQL Server]Procedure or Function 'CRMDashboardSales' expects parameter '@CustBill', which was not supplied.

Why does SQL Server get this error when my SelectParameter is defined? 

Code for the grid's datasource:
<asp:SqlDataSource ID="gridsource2" runat="server"

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

 

 

 

     SelectCommand="CRMDashboardSales" SelectCommandType="StoredProcedure">

 

 

    <SelectParameters>

 

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

 

 

        PropertyName="SelectedValue" Type="String" />

 

    </SelectParameters>

 

</asp:SqlDataSource>

 

The combo box data value contains CustBill column and is specified as the parameter to send to the stored procedure.  I've also included the Ajax Manager code below for reference.  Thx.

<

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"     
DefaultLoadingPanelID
="RadAjaxLoadingPanel1"> 
    <AjaxSettings>

 

 

    <telerik:AjaxSetting AjaxControlID="NamesDDL"> 
        <UpdatedControls
            <telerik:AjaxUpdatedControl ControlID="OrdersGrid" LoadingPanelID="AjaxLoadingPanel1" />

 

 

            <telerik:AjaxUpdatedControl ControlID="NamesDDL" />

 

 

        </UpdatedControls 

    </telerik:AjaxSetting
    </AjaxSettings>
</telerik:RadAjaxManager>

 

 

 

 

 

 

 

 



Scott
Top achievements
Rank 1
 answered on 02 Feb 2011
3 answers
93 views
Hello,
I have a question about the work of the RadEditor with an element of "Select", which you can choose from one of the RadEditor toolbox.
On the form located RadEditor with the ability to upload custom templates in the mode of Design. A template is the text and tables, some of the columns which are drop-down list, or more precisely an element of "Select"
<select style="width: 100px; height: 22px;"> </ select>
When the user clicks on the element he chooses it.
Can I do that he chose not an element but its value from the dropdown list as its done in Word or in Preview mode? Is it possible?

Thanks,
Victor.
Rumen
Telerik team
 answered on 02 Feb 2011
4 answers
199 views
Hi,

I have a chart which can have a number of different series plotted with a numerical y axis and a datetime x axis.  The majority of the y axis points will be clustered around a certain value, say in the range 110-120.  I have set AutoScale to true on the y-axis, but it still starts at 0 and goes up to around 120.  Is there anything I can do to automatically limit the y axis to cover just the plotted values? i.e. start at 100, end at 120 for example.  I could find the min and max y value amongst all my series and set the MinValue and MaxValue properties but this is time consuming when I have large series of several hundred items.

Thanks in advance.
Ves
Telerik team
 answered on 02 Feb 2011
1 answer
174 views
Hello

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

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>


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>

Search the internet and found some possible solutions:

Adding RadControls for ASP.NET Ajax

But none has worked for me, please help

Best regards
Simon
Telerik team
 answered on 02 Feb 2011
1 answer
73 views
Hi All,

I am using two telerik rad grids on same ascx page. I have used below code to give export to excel functionality.

<CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true"
            ShowExportToCsvButton="true" ShowExportToPdfButton="true" ShowAddNewRecordButton="true"
            AddNewRecordText="My Change Orders Queue" />

<ExportSettings HideStructureColumns="true" ExportOnlyData="true" IgnorePaging="true"
        OpenInNewWindow="true">

Now what happens is that export works fine in bottom grid but in top grid when I click export to excel button the grid simply reloads itself and no download occurs.

I have used telerik:RadAjaxManager and I am doing all this under sharepoint.

Please revert me back if you guys have some clue.

Thanks,
Saurabh
Daniel
Telerik team
 answered on 02 Feb 2011
1 answer
76 views
In IE 8 Detail Table is not rendering correclty.
But In Firefox it is ok.
I tried with Cells Columnspan. but couldnt fix.
Pavlina
Telerik team
 answered on 02 Feb 2011
4 answers
93 views
Hi,

          I'm using the RadTreeList and for some reason when clicking on the "+" sign to expand an item it opens a new window and expands the item instead of just expanding the item. Is there anyway to get it to stop opening a new window. I'm pretty sure its not supposed to open up a new window before it expands. Its supposed to expand in place ...

Thanks in advance.
Jon

Jon
Top achievements
Rank 1
 answered on 02 Feb 2011
9 answers
514 views

Can anyone help me with Paging and Radgrid? I've tried looking at the tutorials on the Telerik site but they don't have any real world examples.
I've got my own objects and I don't use an ObjectDataSource...I'm trying to get it to work with my own code. This is what I'm trying to do. On page load, I get my list of Products and set it in Viewstate and then I bind it to my Grid. I then use the RadGrid_PageIndexChanged even to go through my Product List from ViewState and find the next set of products within my collection and re-bind my grid.
Would this work? Here's what I got:

<telerik:RadGrid ID="gridProducts" runat="server" AllowPaging="True" 
        AutoGenerateColumns="False" GridLines="None" 
        Skin="Outlook" width="675px" ShowFooter="True">
  <HeaderContextMenu EnableImageSprites="True" CssClass="GridContextMenu GridContextMenu_Outlook"></HeaderContextMenu>
  
        <PagerStyle AlwaysVisible="True" />
  
        <MasterTableView allowcustompaging="True" PageSize="5">
        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
  
        <RowIndicatorColumn>
        <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
  
        <ExpandCollapseColumn>
        <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
          <Columns>
               
            <telerik:GridTemplateColumn HeaderText="Item" UniqueName="Item">
              <ItemTemplate >
                  <telerik:RadBinaryImage ID="rbiItem" runat="server" /><br />
                  <asp:LinkButton ID="lnkView" runat="server">View Details</asp:LinkButton>  
              </ItemTemplate>
              <ItemStyle VerticalAlign="Top" HorizontalAlign="Center" Width="125px" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Item Description" UniqueName="ItemDescription">
              <ItemTemplate>
                <asp:Label ID="lblItem" CssClass="ItemName" runat="server" Text=""></asp:Label>
                <br />
                <asp:Label ID="lblDescription" runat="server" Text=""></asp:Label>
              </ItemTemplate>
              <ItemStyle VerticalAlign="Top" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Price" UniqueName="Price">
              <ItemTemplate>
                <asp:Label ID="lblPrice" runat="server" Text=""></asp:Label>
              </ItemTemplate>
              <HeaderStyle HorizontalAlign="Center" />
              <ItemStyle HorizontalAlign="Right" Width="50px" />
            </telerik:GridTemplateColumn>
            <telerik:GridTemplateColumn HeaderText="Buy Now">
              <ItemTemplate>
                <asp:ImageButton ID="imgCart" OnCommand="imgCart_Command" CommandName="Add" runat="server" />
              </ItemTemplate>
              <HeaderStyle HorizontalAlign="Center" />
              <ItemStyle HorizontalAlign="Center" Width="100px" />
            </telerik:GridTemplateColumn>
          </Columns>
  
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
          <PagerStyle AlwaysVisible="True" />
        </MasterTableView>
        <ClientSettings>
          <Selecting AllowRowSelect="True" />
        </ClientSettings>
  
<FilterMenu EnableImageSprites="False"></FilterMenu>
      </telerik:RadGrid>

...and here's the code behind:

Partial Public Class Products
    Inherits BasePage
  
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            InitializeControls()
        End If
    End Sub
  
    Private Sub InitializeControls()
        '== Labels
        lblTitle.Text = "Products"
        btnSearch.Text = "Search"
        imgBtnSearch.ImageUrl = "~/images/go.bmp"
        imgBtnSearch.Width = Unit.Pixel(30)
        imgBtnSearch.Height = Unit.Pixel(30)
  
        lblNoRecords.Visible = False
  
        lblNoRecords.Text = "There are no items to display."
  
          
        radCategories.DataTextField = "CategoryName"
        radCategories.DataValueField = "CategoryID"
        radCategories.DataSource = CategoryBL.GetAllCategories()
        radCategories.DataBind()
        radCategories.Items.Insert(0, New RadComboBoxItem("select a category", ""))
        radCategories.Items.Insert(1, New RadComboBoxItem("View All", "-1"))
  
        LoadGrid()
    End Sub
  
  
  
    Private Sub LoadGrid()
       'Set the products in ViewState
        Me.Products = ProductBL.GetActiveProducts
        gridProducts.DataSource = Me.Products
        gridProducts.DataBind()
  
    End Sub
  
 Private Sub gridProducts_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles gridProducts.ItemDataBound
        If (TypeOf (e.Item) Is GridDataItem) Then
            Dim dr As PawnShop.Entities.Product = CType(e.Item.DataItem, PawnShop.Entities.Product)
  
            Dim lnkView As LinkButton = CType(e.Item.FindControl("lnkView"), LinkButton)
            lnkView.PostBackUrl = "Details.aspx?id=" & HttpUtility.HtmlEncode(dr.ProductID.ToString)
  
            Dim lblItem As Label = CType(e.Item.FindControl("lblItem"), Label)
            lblItem.Text = HttpUtility.HtmlEncode(dr.Name)
  
            Dim lblDescription As Label = CType(e.Item.FindControl("lblDescription"), Label)
            lblDescription.Text = HttpUtility.HtmlEncode(dr.Description)
  
            Dim lblPrice As Label = CType(e.Item.FindControl("lblPrice"), Label)
            lblPrice.Text = String.Format(Constants.CURRENCY, dr.Price)
  
            Dim imgCart As ImageButton = CType(e.Item.FindControl("imgCart"), ImageButton)
            'imgCart.ImageUrl = "~/images/shoping_cart_sm.png"
            imgCart.ImageUrl = "~/images/buy_now.gif"
            imgCart.CommandArgument = dr.ProductID.ToString
            imgCart.CommandName = "Add"
  
            Dim rbiItem As RadBinaryImage = CType(e.Item.FindControl("rbiItem"), RadBinaryImage)
            rbiItem.DataValue = dr.imgContent
            rbiItem.Width = 100
            'rbiItem.Height = 100
            rbiItem.ResizeMode = BinaryImageResizeMode.Fit
            rbiItem.AutoAdjustImageControlSize = False
            rbiItem.AlternateText = HttpUtility.HtmlEncode(dr.Name)
  
            'Dim imgProduct As Image = CType(e.Item.FindControl("imgProduct"), Image)
            'imgProduct.ImageUrl = "~/Handler.ashx?id=" & dr.ProductID
  
        End If
          
    End Sub
  
   
    Private Sub gridProducts_PageIndexChanged(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridPageChangedEventArgs) Handles gridProducts.PageIndexChanged
        Dim startRowIndex As Integer = gridProducts.CurrentPageIndex * gridProducts.PageSize
        Dim maximumRows As Integer = gridProducts.PageSize
  
        Dim myList As New List(Of Product)
        For i As Integer = 0 To Me.Products.Count
            If i >= gridProducts.CurrentPageIndex AndAlso i <= gridProducts.PageSize Then
                myList.Add(Me.Products(i))
            End If
        Next
        If myList.Count > 0 Then
            gridProducts.DataSource = myList
        End If
    End Sub
  
      
    Private Sub gridProducts_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles gridProducts.SelectedIndexChanged
        Dim startRowIndex As Integer = gridProducts.CurrentPageIndex * gridProducts.PageSize
        Dim maximumRows As Integer = gridProducts.PageSize
  
        Dim myList As New List(Of Product)
        For i As Integer = 0 To Me.Products.Count
            If i >= gridProducts.CurrentPageIndex AndAlso i <= gridProducts.PageSize Then
                myList.Add(Me.Products(i))
            End If
        Next
        If myList.Count > 0 Then
            gridProducts.DataSource = myList
        End If
    End Sub
  
  
Private Property Products() As List(Of Product)
        Get
            Return CType(ViewState("Products"), List(Of Product))
        End Get
        Set(ByVal value As List(Of Product))
            ViewState("Products") = value
        End Set
    End Property
  
End Class

The paging at the bottom of my grid only shows 1 page but I have more products to display. Am I going about this the wrong way? Any help on this would be appreciated.

Thanks
Pavlina
Telerik team
 answered on 02 Feb 2011
2 answers
56 views
I have just started evaluating Telerik controls and in particular, the RadGrid.
I am likely doing something wrong, but is there any reason why I am seeing "Item 0 to 0 of 0" in the pager?

The grid displays 8 rows successfully and correctly shows page 1 of 1 - it's just the item count that is wrong.
But, if I change the number of rows per page to 3, the pager still shows page 1 of 1 and all zero's for the item counts.

I am using a sqlDatasource.
I am using VS2008 and the latest controls (downloaded 2 weeks ago).  My OS is MS SQL Server 2008.
My browser is IE 8.

Any suggestions.

Thanks

Jim
jlj30
Top achievements
Rank 2
 answered on 02 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?