Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
307 views
I have a treeview where the text on some nodes are relatively long. As it is now all text is shown on one line, which expands the whole page horizontally making scrollbars appear. Is there any way to make the node text automatically break into multiple lines?

So instead of:

blah blah blah blah blah blah

The node text will be:

blah blah blah blah
blah blah

(if the text is too long)
Magnus Ostberg
Top achievements
Rank 1
 answered on 20 Jan 2011
2 answers
51 views
I want to use the spanish ñ and Ñ in my RadEditor for MOSS 2007.

<symbols>
<!--...-->
<!--spanish-->
    <symbol value="¥" />
    <symbol value="¤" />
<!--...-->
</symbols>

As you see in the code: It doesn't work although the ASCII table told me the numbers 164 and 165. Does anybody got a solution?
Rumen
Telerik team
 answered on 20 Jan 2011
6 answers
202 views
Dear support,

When i use Bars everything is OK (attach image).
When i use Pie, the item labels are not visible (attach image).

Can you please help me to fix this?
Below you will find my design code of the chart.

Thank you in advance for your time.

Best Regards,
George
Navarino Technology Dept.

<telerik:RadChart ID="chCardTypes" runat="server" DefaultType="Pie"
                    Width="200px" AutoLayout="True" Skin="Inox">
                    <Series>
                        <telerik:ChartSeries Name="Series 1" Type="Pie">
                            <Appearance>
                                <FillStyle FillType="ComplexGradient" MainColor="211, 185, 123">
                                    <FillSettings>
                                        <ComplexGradient>
                                            <telerik:GradientElement Color="222, 202, 152" />
                                            <telerik:GradientElement Color="211, 185, 123" Position="0.5" />
                                            <telerik:GradientElement Color="183, 154, 84" Position="1" />
                                        </ComplexGradient>
                                    </FillSettings>
                                </FillStyle>
                                <LabelAppearance LabelLocation="Inside">
                                </LabelAppearance>
                                <TextAppearance TextProperties-Color="160, 160, 160">
                                </TextAppearance>
                                <Border Color="187, 149, 58" />
                            </Appearance>
                        </telerik:ChartSeries>
                    </Series>
                    <PlotArea>
                        <XAxis>
                            <Appearance Color="Transparent">
                                <MajorGridLines Color="213, 213, 213" />
                                <TextAppearance TextProperties-Color="17, 17, 17">
                                </TextAppearance>
                            </Appearance>
                            <AxisLabel>
                                <TextBlock>
                                    <Appearance TextProperties-Color="17, 17, 17">
                                    </Appearance>
                                </TextBlock>
                            </AxisLabel>
                        </XAxis>
                        <YAxis>
                            <Appearance Color="Transparent" MinorTick-Width="0">
                                <MajorGridLines Color="213, 213, 213" PenStyle="Dash" />
                                <MinorGridLines Color="213, 213, 213" Width="0" />
                                <TextAppearance TextProperties-Color="17, 17, 17">
                                </TextAppearance>
                            </Appearance>
                            <AxisLabel>
                                <TextBlock>
                                    <Appearance TextProperties-Color="17, 17, 17">
                                    </Appearance>
                                </TextBlock>
                            </AxisLabel>
                        </YAxis>
                        <Appearance>
                            <FillStyle FillType="Solid" MainColor="White">
                            </FillStyle>
                            <Border Color="142, 142, 142" />
                        </Appearance>
                    </PlotArea>
                    <Appearance Corners="Round, Round, Round, Round, 10">
                        <FillStyle FillType="Image">
                            <FillSettings BackgroundImage="{chart}" ImageDrawMode="Flip">
                            </FillSettings>
                        </FillStyle>
                        <Border Color="111, 111, 111" />
                    </Appearance>
                    <ChartTitle>
                        <Appearance>
                            <FillStyle MainColor="Transparent">
                            </FillStyle>
                        </Appearance>
                        <TextBlock Text="Card Types">
                            <Appearance TextProperties-Color="17, 17, 17" TextProperties-Font="Arial, 16pt">
                            </Appearance>
                        </TextBlock>
                    </ChartTitle>
                    <Legend Visible="False">
                        <Appearance Position-AlignedPosition="Bottom"
                            Dimensions-Margins="16%, 3%, 1px, 1px" Visible="False">
                            <ItemTextAppearance TextProperties-Color="Black">
                            </ItemTextAppearance>
                            <FillStyle MainColor="Transparent">
                            </FillStyle>
                            <Border Width="0" />
                        </Appearance>
                    </Legend>
                </telerik:RadChart>
Technology
Top achievements
Rank 1
 answered on 20 Jan 2011
5 answers
110 views
I am upgrading Telerik controls Q3 2008 to Q2 2010. I am using RadEditor in one of my page which has HyperLink Manager tool. This tool has some weird design. I have attached the screen shot and highlighted that design. I want to get rid of that design. I have tried all ways but I am not able to remove it. So far I have found this. I have attached the Style screen shot for this. If I play around .RadWindow table .rwTitlebar with background-position property, it does something. And if I also change this <ul class="rwControlButtons".. to <ul class="rwControlButtons1"....  , then it is working exactly what I want except the 'Close' title at the top right corner of the window.

The last screen shot is what exactly I want it to look like. I have been playing with this since 3 days but I am not able to do it. Please help!

Thanks!

Rumen
Telerik team
 answered on 20 Jan 2011
1 answer
38 views
I was wondering if you can set a Appointment in the Scheduler to open a different web page for the edit versus using a raddock. Also if this is possible can you have different appointment types that open different pages.
Nikolay Tsenkov
Telerik team
 answered on 20 Jan 2011
2 answers
70 views
Hi!

I am in the process of moving from RadControls using .NET2 to .NET4.
The content of the GridTableView.FilterExpression has changed format between .NET2 and .NET4.
In .NET2 the FilterExpression might look like: "([Name] LIKE '%m%')"
In .NET4 the FilterExpression looks like: "(it[\"Name\"].ToString().ToUpper().Contains(\"m\".ToUpper()))"

When a user is working with a grid I am saving the grid settings including filter expressions in database to be used next time. The problem is that when loading settings (filter expression) saved with .NET2 in.NET4 I get a runtime error saying:  Sys.WebForms.PageRequestManagerServerErrorException: Expression expected

Does anyone have a solution for this?

Thanks
/Mats

Mats
Top achievements
Rank 1
 answered on 20 Jan 2011
1 answer
126 views
I am using the NeedDataSource to handle my grid's sorting and paging and I am running into an issue. I do not want my grid to display its records on page load, so I wire up the OnNeedDataSource event handler in the page load when its a postback. Now, I need to distinguish when the user clicks the search button (which calls grid.rebind()) and when the user pages or sorts. I thought I could just check the re-bind reason, but it always states "InitialLoad".  

Any ideas?
Maria Ilieva
Telerik team
 answered on 20 Jan 2011
1 answer
131 views
Hello and sorry for my bad english.
I have an error when i change the selectcommand property in radscheduller.
i have a page with a RadComboBox before the radscheduller. When i selected an item on the RadComboBox i change the select in the RadScheduller at runtime.
The first load from data is ok but when i change the combo i have an exception. Please help me...

The Code aspx Is:

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<%@ Register TagPrefix="uc" TagName="BCComboBox" Src="~/Componentes/BCComboBox.ascx"%>
<%@ Register TagPrefix="uc" TagName="BCNumericTextBox" Src="~/Componentes/BCNumericTextBox.ascx" %>
<%@ Register TagPrefix="uc" TagName="BCTextBox" Src="~/Componentes/BCTextBox.ascx" %>
<%@ Register TagPrefix="uc" TagName="BCChkBox" Src="~/Componentes/BCChkBox.ascx" %>
<%@ Register TagPrefix="uc" TagName="BCLinkButton" Src="~/Componentes/BCLinkButton.ascx" %>
<%@ Register TagPrefix="uc" TagName="BCLabelMain" Src="~/Componentes/BCLabelMain.ascx" %>
<%@ Register TagPrefix="uc" TagName="BCDateTimePicker" Src="~/Componentes/BCDateTimePicker.ascx" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
<link rel="stylesheet" href="../Css/styles.css" type="text/css" />
     
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <div align="center">
        <uc:BCLabelMain ID="lblTitleMain" runat="server" Caption="CALENDARIO" />
    </div>   
    <div align="left">
        <uc:BCComboBox ID="cboSala" runat="server" Caption="Salas:" AutoPostBack="true"/>
     
    </div>
    <div align="center">
    <div id="content">
    <br />
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="CreateAppointment">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" />
  
    <div class="exampleContainer">
     
                             
        <telerik:RadScheduler runat="server" ID="RadScheduler1"
            DataSourceID="SqlDataSourceTurno" SelectedView="MonthView" OverflowBehavior="Expand"
              DataKeyField = "IdTurno" DataStartField = "Ini"
              DataEndField = "Fin" DataSubjectField = "Asu"
              DataDescriptionField = "Des" MinutesPerRow="15" OnAppointmentInsert="RadScheduler1_AppointmentInsert"
               OnAppointmentUpdate="RadScheduler1_AppointmentUpdate"
            NumberOfHoveredRows="1" AdvancedForm-EnableCustomAttributeEditing="true"
            EnableCustomAttributeEditing="True" Culture="Spanish (Argentina)"
            ShowAllDayRow="false"  StartEditingInAdvancedForm="true"
            OnAppointmentCommand="RadScheduler1_AppointmentCommand"
            OnFormCreated="RadScheduler1_FormCreated"
            OnFormCreating="RadScheduler1_FormCreating"
            onappointmentdatabound="RadScheduler1_AppointmentDataBound"
            ondatabinding="RadScheduler1_DataBinding" ondatabound="RadScheduler1_DataBound">
             
            <localization advancedalldayevent="Todo el Día"
                advancedcalendarcancel="Cancelar" advancedcalendarok="Aceptar"
                advancedcalendartoday="Hoy" advancedclose="Cerrar" advanceddaily="Diariamente"
                advancedday="Día" advanceddays="Día(s)" advanceddescription="Descripción"
                advanceddone="Listo" advancededitappointment="Editar Turno"
                advancedendafter="Fin después de" advancedendbythisdate="Fin por"
                advancedenddaterequired="Fecha Fin requerida"
                advancedendtimerequired="Hora Fin requerida" advancedevery="Todos"
                advancedeveryweekday="Todos los días de la semana" advancedfirst="Primero"
                advancedfourth="Cuarto" advancedfrom="Fecha Inicio" advancedhourly="Por hora"
                advancedhours="Hora(s)" advancedinvalidnumber="Número Inválido"
                advancedlast="último" advancedmaskday="día"
                advancednewappointment="Nuevo Turno" advancedsecond="segundo"
                advancedstartdaterequired="Fecha Inicio requerida"
                advancedstarttimebeforeendtime="Hora de inicio debe ser antes de la hora final"
                advancedstarttimerequired="Hora Inicio requerida" advancedsubject="Asunto"
                advancedsubjectrequired="Ingrese asunto de la cita" advancedthird="Tercero"
                advancedto="Fecha Fin" advancedworking="Trabajando..."
                advancedyearly="Anualmente" allday="Todos los Días" cancel="Cancelar"
                confirmcancel="Cancelar" confirmdeletetext="Está seguro de eliminar esta cita?"
                confirmdeletetitle="Confirma Eliminar" confirmok="Aceptar"
                contextmenuaddappointment="Nuevo turno" contextmenudelete="Eliminar"
                contextmenuedit="Editar" contextmenugototoday="Ir al día" headerday="Día"
                headermonth="Mes" headermultiday="Multi-Día" headernextday="siguiente día"
                headerprevday="anterior día" headertimeline="Línea de Tiempo" headertoday="Hoy"
                headerweek="Semana" save="Guardar" show24hours="Mostrar 24 horas..."
                showadvancedform="Opciones" showbusinesshours="Mostrar Horario de Comercio..."
                showmore="más..." />
              
            <AdvancedForm Modal="true" />
            <TimelineView GroupBy="Calendar" GroupingDirection="Vertical" />
            <TimeSlotContextMenuSettings EnableDefault="true" />
            <AppointmentContextMenuSettings EnableDefault="true" />
         
            <ResourceTypes>
                  
                 <telerik:ResourceType KeyField="IdProducto" Name="IdProducto" TextField="Des" ForeignKeyField="IdProducto"
                DataSourceID="SqlDataSourceProducto" />
                <telerik:ResourceType KeyField="IdCliente" Name="IdCliente" TextField="Nombre" ForeignKeyField="IdCliente"
                DataSourceID="SqlDataSourceCliente" />
            </ResourceTypes>
            
           <%--
            <ResourceStyles>
             
                <telerik:ResourceStyleMapping Type="AppointmentType" Text="technical" ApplyCssClass="rsCategoryGreen" />
             
                <telerik:ResourceStyleMapping Type="AppointmentType" Text="specification_review"ApplyCssClass="rsCategoryOrange" />
             </ResourceStyles> --%>
                 
     
       <AdvancedEditTemplate>
            <div id="qsfexAdvEditWrapper">
                <div id="qsfexAdvEditInnerWrapper" >
                    <div class="qsfexAdvAppType">
                    </div>
                    <div class="qsfexAdvEditControlWrapper">
                         
                        <telerik:RadTextBox runat="server" ID="txtAsunto" Width="100%" Label='<%# RadScheduler1.Localization.AdvancedSubject + ":" %>'
                        Text='<%# Bind("Asu") %>' /><br />
                             
                    </div>
                    <div class="qsfexAdvEditControlWrapper">
                        <asp:Label ID="Label2" AssociatedControlID="StartInput" runat="server" CssClass="inline-label" Text='<%# RadScheduler1.Localization.AdvancedFrom + ":" %>'></asp:Label>
                         
                        <telerik:RadDateInput ID="StartInput" SelectedDate='<%# Bind("Ini") %>' runat="server">
                        </telerik:RadDateInput><br />
                    </div>
                    <div class="qsfexAdvEditControlWrapper">
                        <asp:Label ID="Label3" AssociatedControlID="EndInput" runat="server" CssClass="inline-label" Text="Fecha Fin"></asp:Label>
                        <telerik:RadDateInput ID="EndInput" SelectedDate='<%# Bind("Fin") %>' runat="server">
                        </telerik:RadDateInput><br />
                    </div>
                    <div class="qsfexAdvEditControlWrapper">
                        <div class="inline-label">
                           </div>
                        <div id="qsfexAdvEditColorCodeChooser">
                                
                            <asp:CheckBox ID="chkEstado" runat="server" Text="Estado" DataValueField="IdEstado" DataSourceID="SqlDataSourceTurno" />
                                 
                        </div>
                    </div>
                    <div class="qsfexAdvEditControlWrapper" style="text-align: right;">
                        <asp:LinkButton ID="UpdateButton" runat="server" CommandName="Update">
                            <asp:Image runat="server" ID="insertImage" ImageUrl="../Imagenes/ok.png" AlternateText="Actualizar" /></asp:LinkButton>
                            <asp:LinkButton ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="CommandActualizar"
                                             Style="margin-right: 8px;">
                            <asp:Image runat="server" ID="Image2" ImageUrl="../Imagenes/cancel.png" AlternateText="Cancelar" /></asp:LinkButton>
                    </div>
                </div>
            </div>
        </AdvancedEditTemplate>
         
        </telerik:RadScheduler>
 
      
       
         
        
         <asp:SqlDataSource ID="SqlDataSourceTurno" runat="server"
            ConnectionString="<%$ ConnectionStrings:PuraPielConnectionString2 %>"></asp:SqlDataSource>
            
            <asp:SqlDataSource ID="SqlDataSourceProducto" runat="server"
            ConnectionString="<%$ ConnectionStrings:PuraPielConnectionString2 %>"></asp:SqlDataSource>
            
            <asp:SqlDataSource ID="SqlDataSourceCliente" runat="server"
            ConnectionString="<%$ ConnectionStrings:PuraPielConnectionString2 %>"></asp:SqlDataSource>
         
<%--         <sds:SessionDataSource ID="AppointmentsDataSource" runat="server" DisplayWarning="false"
            PrimaryKeyFields="ID" ProviderName="System.Data.SqlClient" ConnectionString="<%$ ConnectionStrings:TelerikConnectionString %>"
            SelectCommand="SELECT * FROM [Appointments]" InsertCommand="INSERT INTO [Appointments] ([Subject], [Description], [Start], [End], [RecurrenceRule], [RecurrenceParentID], [Reminder]) VALUES (@Subject, @Description, @Start, @End , @RecurrenceRule, @RecurrenceParentID, @Reminder)"
            UpdateCommand="UPDATE [Appointments] SET [Subject] = @Subject, [Description] = @Description, [Start] = @Start, [End] = @End, [RecurrenceRule] = @RecurrenceRule, [RecurrenceParentID] = @RecurrenceParentID, [Reminder] = @Reminder WHERE (ID = @ID)"
            DeleteCommand="DELETE FROM [Appointments] WHERE [ID] = @ID">
            <DeleteParameters>
                <asp:Parameter Name="ID" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="ID" Type="Int32" />
                <asp:Parameter Name="Subject" Type="String" />
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="Start" Type="DateTime" />
                <asp:Parameter Name="End" Type="DateTime" />
                <asp:Parameter Name="RecurrenceRule" Type="String" />
                <asp:Parameter Name="RecurrenceParentID" Type="Int32" />
                <asp:Parameter Name="Reminder" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="Subject" Type="String" />
                <asp:Parameter Name="Description" Type="String" />
                <asp:Parameter Name="Start" Type="DateTime" />
                <asp:Parameter Name="End" Type="DateTime" />
                <asp:Parameter Name="RecurrenceRule" Type="String" />
                <asp:Parameter Name="RecurrenceParentID" Type="Int32" />
                <asp:Parameter Name="Reminder" Type="String" />
            </InsertParameters>
        </sds:SessionDataSource>
--%><%--<uc:BCChkBox ID="chkEstado" runat="server" Caption="Activo:" Visible="false" />--%>
    </div>
     
 
    </div
</div>
</asp:Content>



The Code .cs is:

public partial class Calendario : FormGrillaWeb
{
  
 
 #region "Properties"
    private int _idturno;
    private int _idfranquicia;
    private int _idcliente;
    private int _idestado;
    private int _idtipoestado;
    private int _prod;
    private int _sala;
    private string _asu;
    private string _des;
    private DateTime _ini;
    private DateTime _fin;
     
 
    public int IdTurno
    {
        get { return _idturno; }
        set { _idturno = value; }
    }
    public int IdFranquicia
    {
        get { return _idfranquicia; }
        set { _idfranquicia = value; }
    }
    public int IdCliente
    {
        get { return _idcliente; }
        set { _idcliente = value; }
    }
    public int IdSala
    {
        get { return _sala; }
        set { _sala = value; }
    }
    public int IdEstado
    {
        get { return _idestado; }
        set { _idestado = value; }
    }
    public int IdTipoEstado
    {
        get { return _idtipoestado; }
        set { _idtipoestado = value; }
    }
    public int Prod
    {
        get { return _prod; }
        set { _prod = value; }
    }
    public string Asu
    {
        get { return _asu; }
        set { _asu = value; }
    }
    public string Des
    {
        get { return _des; }
        set { _des = value; }
    }
    
    public DateTime Ini
    {
        get { return _ini; }
        set { _ini = value; }
    }
    public DateTime Fin
    {
        get { return _fin; }
        set { _fin = value; }
    }
    
#endregion
     
       
     
    protected override void Page_Load(object sender, EventArgs e)
    {
        AtributoSeguridad = Constantes.AtributoSeguridad.Dueño;
        BCLabelError = lblTitleMain;
        RadScheduler1.DataSource = null;
        RadScheduler1.Appointments.Clear();
        if (!IsPostBack)
        {
            List<SqlParameter> parametros = new List<SqlParameter>();
            parametros.Add(new SqlParameter()
            {
                DbType = DbType.Int32,
                ParameterDirection = ParameterDirection.Input,
                ParameterName = "@IdFranquicia",
                Valor = Convert.ToInt32(Session["IdFranquicia"].ToString()),
            });
            cboSala.LlenarComboClave("FRANQUICIAS_SALAS_COMBO", parametros, Constantes.ComboEmptyText.TODAS);
            cboSalaSelectedindex(null,null);
                
                //RadScheduler1.DataKeyField = "IdTurno";
                //RadScheduler1.DataStartField = "Ini";
                //RadScheduler1.DataEndField = "Fin";
                //RadScheduler1.DataSubjectField = "Asu";
                //RadScheduler1.DataDescriptionField = "Des";
 
                 //Creo el resource(combo) con Productos.
                //ResourceType rt = new ResourceType("IdProducto");
                SqlDataSourceProducto.SelectCommand = "SELECT P.* FROM Productos P, ProductosFranquicia PF WHERE P.IdProducto = PF.IdProducto AND P.IdTipoProducto = 2 AND PF.IdFranquicia = " + Session["IdFranquicia"].ToString();
                //rt.DataSource = SqlDataSourceProducto;
                //rt.KeyField = "IdProducto";
                //rt.ForeignKeyField = "IdProducto";
                //rt.TextField = "Des";
                 
                //RadScheduler1.ResourceTypes.Add(rt);
 
                //Creo el resource(combo) con Clientes.
                //ResourceType rCl = new ResourceType("IdCliente");
                ////  Ver si hay que seleccionar segun la franquicia
               SqlDataSourceCliente.SelectCommand = "SELECT IdCliente,  (Nom + ' ' + Ape) as Nombre FROM Clientes WHERE IdFranquicia = "+ Session["IdFranquicia"].ToString();
                //rCl.DataSource = SqlDataSourceCliente;
                //rCl.KeyField = "IdCliente";
                //rCl.ForeignKeyField = "IdCliente";
                //rCl.TextField = "Nombre";
                 
            
                
            //RadScheduler1.DataSource = SqlDataSource2;
            //command para agregar combo con la sala en formEdit
            //SqlDataSourceProducto.SelectCommand = "SELECT IdSala FROM [FRANQUICIAS_SALAS] WHERE IdFranquicia = " + Session["IdFranquicia"].ToString();
                
          
        }
        this.cboSala.ComboBox.SelectedIndexChanged += new RadComboBoxSelectedIndexChangedEventHandler(cboSalaSelectedindex);
         
         
    }
 
    
 
    protected void RadScheduler1_AppointmentUpdate(object sender, AppointmentUpdateEventArgs e)
    {
         
        IdTurno = Convert.ToInt32(e.ModifiedAppointment.ID);
        Des = e.ModifiedAppointment.Description.ToString();
        Asu = e.ModifiedAppointment.Subject.ToString();
        Ini = e.ModifiedAppointment.Start;
        Fin = e.ModifiedAppointment.End;
        Prod = Convert.ToInt32(e.ModifiedAppointment.Resources.GetResourceByType("IdProducto").Key);
        IdFranquicia = Convert.ToInt32(Session["IdFranquicia"].ToString());
        IdSala = Convert.ToInt32(cboSala.ComboBox.SelectedValue.ToString());
        IdCliente = Convert.ToInt32(e.ModifiedAppointment.Resources.GetResourceByType("IdCliente").Key);
        //IdEstado = 0;
        IdTipoEstado = 3;
      
    }
 
    protected void RadScheduler1_AppointmentInsert(object sender, SchedulerCancelEventArgs e)
    {
        //IdTurno = Convert.ToInt32(e.Appointment.ID);
        if (Convert.ToInt32(cboSala.ComboBox.SelectedValue.ToString()) != -1)
        {
            Des = e.Appointment.Description.ToString();
            Asu = e.Appointment.Subject.ToString();
            Ini = e.Appointment.Start;
            Fin = e.Appointment.End;
            Prod = Convert.ToInt32(e.Appointment.Resources.GetResourceByType("IdProducto").Key);
            IdFranquicia = Convert.ToInt32(Session["IdFranquicia"].ToString());
            IdSala = Convert.ToInt32(cboSala.ComboBox.SelectedValue.ToString());
            IdCliente = Convert.ToInt32(e.Appointment.Resources.GetResourceByType("IdCliente").Key);
            IdEstado = 0;
            IdTipoEstado = 3;
 
            this.EjecutarComandoInsert();
            this.setearMensaje("Turno cargado correctamente", Constantes.ColorMensaje.Correcto);
 
        }
        else
        {
            this.setearMensaje("Debe seleccionar una Sala", Constantes.ColorMensaje.InCorrecto);
        }
      
 
 
 
    }
    protected override void setearMensaje(string mensaje, string color)
    {
        base.setearMensaje(mensaje, color);
    }
    
    private void EjecutarComandoUpdate()
    {
        List<SqlParameter> parametros = new List<SqlParameter>();
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.Int32,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@IdTurno",
            Valor = IdTurno,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.String,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@Asu",
            Valor = Asu,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.String,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@Des",
            Valor = Des,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.Int32,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@IdCliente",
            Valor = IdCliente,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.Int32,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@IdProducto",
            Valor = Prod,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.Int32,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@IdFranquicia",
            Valor = IdFranquicia,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.Int32,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@IdSala",
            Valor = IdSala,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.DateTime,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@Ini",
            Valor = Ini,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.DateTime,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@Fin",
            Valor = Fin,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.Int32,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@IdEstado",
            Valor = IdEstado,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.Int32,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@IdTipoEstado",
            Valor = IdTipoEstado,
        });
 
 
        DataBase dataBase = new DataBase();
        dataBase.ExecuteReader(Constantes.procedures.TurnosUpdate, parametros);
 
 
    }
    private void EjecutarComandoInsert()
    {
        List<SqlParameter> parametros = new List<SqlParameter>();
        
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.String,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@Asu",
            Valor = Asu,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.String,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@Des",
            Valor = Des,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.Int32,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@IdCliente",
            Valor = IdCliente,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.Int32,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@IdProducto",
            Valor = Prod,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.Int32,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@IdFranquicia",
            Valor = IdFranquicia,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.Int32,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@IdSala",
            Valor = IdSala,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.DateTime,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@Ini",
            Valor = Ini,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.DateTime,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@Fin",
            Valor = Fin,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.Int32,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@IdEstado",
            Valor = IdEstado,
        });
        parametros.Add(new SqlParameter()
        {
            DbType = DbType.Int32,
            ParameterDirection = ParameterDirection.Input,
            ParameterName = "@IdTipoEstado",
            Valor = IdTipoEstado,
        });
 
 
        DataBase dataBase = new DataBase();
        dataBase.ExecuteReader(Constantes.procedures.TurnosAlta, parametros);
 
 
    }
    //protected void CreateAppointment_Click(object sender, EventArgs e)
    //{
       
 
    //}
 
    protected void cboSalaSelectedindex(object sender, EventArgs e)
    {
        
        int sala = Convert.ToInt32(cboSala.ComboBox.SelectedValue.ToString());
         
        if (sala != -1)
        {
         SqlDataSourceTurno.SelectCommand = "SELECT * FROM [Turnos] WHERE IdSala = " + sala.ToString() + " AND IdFranquicia = " + Session["IdFranquicia"].ToString();
        }
        else
        {
         SqlDataSourceTurno.SelectCommand = "SELECT * FROM [Turnos] WHERE IdFranquicia = " + Session["IdFranquicia"].ToString();
        }
    }
 
 
 
    protected void RadScheduler1_AppointmentCommand(object sender, AppointmentCommandEventArgs e)
    {
        //if (e.CommandName == "Insert" || e.CommandName == "Update")
        //{
        //    CheckBox repeatCheck = e.Container.FindControl("RepeatCheckBox") as CheckBox;
        //    if (repeatCheck != null)
        //    {
        //        if (repeatCheck.Checked)
        //        {
        //            RecurrenceRange range = new RecurrenceRange();
        //            range.Start = RadScheduler1.DisplayToUtc(e.Container.Appointment.Start);
        //            range.EventDuration = e.Container.Appointment.Duration;
        //            range.MaxOccurrences = 10;
        //            DailyRecurrenceRule rule = new DailyRecurrenceRule(1, range);
        //            e.Container.Appointment.RecurrenceRule = rule.ToString();
        //        }
        //        else
        //        {
        //            e.Container.Appointment.RecurrenceRule = string.Empty;
        //        }
        //    }
        //}
    }
 
    protected void RadScheduler1_FormCreated(object sender, SchedulerFormCreatedEventArgs e)
    {
        //RadScheduler scheduler = (RadScheduler)sender;
 
 
 
        //if (e.Container.Mode == SchedulerFormMode.AdvancedInsert || e.Container.Mode == SchedulerFormMode.AdvancedEdit)
        //{
        //    TextBox subjectBox = (TextBox)e.Container.FindControl("TitleTextBox");
        //    subjectBox.Text = e.Appointment.Subject;
 
        //    RadDateInput startInput = (RadDateInput)e.Container.FindControl("StartInput");
        //    startInput.DateFormat = scheduler.AdvancedForm.DateFormat + " " + scheduler.AdvancedForm.TimeFormat;
        //    startInput.SelectedDate = RadScheduler1.DisplayToUtc(e.Appointment.Start);
 
        //    RadDateInput endInput = (RadDateInput)e.Container.FindControl("EndInput");
        //    endInput.DateFormat = scheduler.AdvancedForm.DateFormat + " " + scheduler.AdvancedForm.TimeFormat;
        //    endInput.SelectedDate = RadScheduler1.DisplayToUtc(e.Appointment.End);
 
        //    CheckBox repeatCheck = e.Container.FindControl("RepeatCheckBox") as CheckBox;
        //    if (repeatCheck != null)
        //    {
        //        repeatCheck.Checked = e.Appointment.RecurrenceState == RecurrenceState.Master;
        //    }
        //}
    }
 
    protected void RadScheduler1_FormCreating(object sender, SchedulerFormCreatingEventArgs e)
    {
        //if (e.Mode == SchedulerFormMode.Insert || e.Mode == SchedulerFormMode.AdvancedInsert)
        //{
        //    e.Appointment.Resources.Add(RadScheduler1.Resources.GetResourceByType("AppointmentType"));
        //}
    }
 
    protected void RadScheduler1_AppointmentDataBound(object sender, SchedulerEventArgs e)
    {
 
    }
 
    protected void RadScheduler1_DataBound(object sender, EventArgs e)
    {
 
    }
 
    protected void RadScheduler1_DataBinding(object sender, EventArgs e)
    {
 
    }
  
 
 
}


The Error when execute cboSalaSelectedindex is:

Referencia a objeto no establecida como instancia de un objeto.
Descripción: Excepción no controlada al ejecutar la solicitud Web actual. Revise el seguimiento de la pila para obtener más información acerca del error y dónde se originó en el código.
 
Detalles de la excepción: System.NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.
 
Error de código fuente:
 
Se ha generado una excepción no controlada durante la ejecución de la solicitud Web actual. La información sobre el origen y la ubicación de la excepción pueden identificarse utilizando la excepción del seguimiento de la pila siguiente.
 
Seguimiento de la pila:
 
[NullReferenceException: Referencia a objeto no establecida como instancia de un objeto.]
   Telerik.Web.UI.ResourceTypeControl.PerformDataBinding(IEnumerable data) +246
   System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +114
   System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +31
   System.Web.UI.WebControls.DataBoundControl.PerformSelect() +142
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
   Telerik.Web.UI.RadScheduler.BindResourcesFromDataSource() +635
   Telerik.Web.UI.RadScheduler.PerformSelect() +279
   System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +73
   System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
   Telerik.Web.UI.RadScheduler.EnsureDataBound() +30
   Telerik.Web.UI.RadScheduler.CreateChildControls(Boolean bindFromDataSource) +131
   Telerik.Web.UI.RadScheduler.CreateChildControls() +34
   System.Web.UI.Control.EnsureChildControls() +87
   Telerik.Web.UI.RadScheduler.OnPreRender(EventArgs e) +119
   System.Web.UI.Control.PreRenderRecursiveInternal() +80
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Control.PreRenderRecursiveInternal() +171
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842

Than you very much


Nikolay Tsenkov
Telerik team
 answered on 20 Jan 2011
1 answer
148 views
I have a pretty simple request, I just can't seem to figure out how to do it =)

I have an AJAXified grid with a GridTemplateColumn defined as follows

<telerik:GridTemplateColumn HeaderText="Request #" DataField="ReqNm" UniqueName="ReqNm"
    Groupable="false" SortExpression="ReqID" AllowFiltering="true" HeaderStyle-Wrap="false"
    ItemStyle-Wrap="false">
    <ItemTemplate>
        <asp:LinkButton ID="btn_ReqID" Text='<%# Eval("ReqID") %>' OnClick="btn_ReqID_Click"
            CommandArgument='<%# Eval("ReqID") %>' runat="server" />
        <br />
        <asp:Label ID="lbl_ReqNm" Text='<%# Eval("ReqNm") %>' runat="server" />
    </ItemTemplate>
    <FilterTemplate>
        <telerik:RadComboBox ID="dd_type_filter" Skin="Default" Width="120px" Font-Size="11px"
            MarkFirstMatch="true" AppendDataBoundItems="true" SelectedValue='<%# (Container as GridItem).OwnerTableView.GetColumn("ReqNm").CurrentFilterValue %>'
            OnClientSelectedIndexChanged="TypeIndexChanged" runat="server">
            <Items>
                <telerik:RadComboBoxItem Text="All" />
            </Items>
        </telerik:RadComboBox>
        <telerik:RadScriptBlock ID="RadScriptBlock1" runat="server">
            <script type="text/javascript">
                function TypeIndexChanged(sender, args) {
                    var tableView = $find("<%# (Container as GridItem).OwnerTableView.ClientID %>");
                    tableView.filter("ReqNm", args.get_item().get_value(), "EqualTo");
                }
            </script>
        </telerik:RadScriptBlock>
    </FilterTemplate>
</telerik:GridTemplateColumn>

In the ItemTemplate, there is a LinkButton that executes the code below:

protected void btn_ReqID_Click(object sender, EventArgs e)
{
    LinkButton btn_ReqID = (LinkButton)sender;
 
    Session["s_ReqID"] = int.Parse(btn_ReqID.CommandArgument.ToString());
 
    string url = "~/eis/request/";
    var AjaxManager = RadAjaxManager.GetCurrent(this.Page);
    AjaxManager.Redirect(url);
}

This is in Sitefinity, so I have to use the AjaxManager to redirect or I get a funky URL. When I click on the LinkButton, I get the LoadingPanel displaying in the center of the grid, then it disappears and the page redirects.

What I'd like to do is to disable the LoadingPanel when these LinkButtons are clicked so that it just redirects like a normal page click.

I have to keep Ajax enabled on the grid though because there are other grid functions that require having Ajax.

Is there a way in the LinkButton click event or in the Grid's ItemDataBound event that I can turn off the loading panel for these LinkButtons?

Thanks =)
Princy
Top achievements
Rank 2
 answered on 20 Jan 2011
2 answers
80 views
Hello,
  
Today I install RadEditorMOSS_4_5_6, I can use RadEditor Web Part ,but RadEdiot not used in List Items.I still see the default editor or a simple textbox after I activate the RadEditor feature! And I had rebot the machine!
alex
Top achievements
Rank 1
 answered on 20 Jan 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?