Telerik Forums
Community Forums Forum
1 answer
84 views
Hi,
     I am new to telerik controls.I trying to use this skin concept in telerik But i am not able to get this how to use .skin file.And to apply custom CSS  to Rad controls what we have to do:
ex: i have to work with Radmenu and radpanelbar.  i am not able to appy forecolor for radmenu controls. Plzzzz help me
and can place usercontrol in radpanelbar???
Pavel Benov
Telerik team
 answered on 20 Jul 2012
0 answers
103 views
Hi,

Where can I get Telerik.Framework.dll and Telerik.Cms.Tools.WebControls.dll

Thanks.
Surya CD
Top achievements
Rank 1
 asked on 18 Jul 2012
0 answers
138 views
Hello All,

I am currently using Rad Scheduler in my project and I am displaying it in different languages using the "culture" property.

I am also using the Hebrew culture but now I want to show the scheduler control in Hebrew format.

For example currently in Hebrew format it is year 5772 and in English Calender it is year 2012.
So i want the whole scheduler to be converted in the Hebrew calender. I don't want to show the scheduler in the Hebrew language but in Hebrew format.

Thanks in advance
Hardik
Hardik
Top achievements
Rank 1
 asked on 16 Jul 2012
3 answers
151 views
All,

I'm trying to turn on the media manager for use in the telerik control - and it appears no matter what I do when I select the media manager in the control - even though - I have some files which meet the filter requirements - I don't see any media to add. Therefore, to date to turn this item on I've edited:

RadControls\Editor\ConfigFile.xml so it has the following items in it - the files/uploads/media path does exist and it has the proper permissions for the website user:

<property name="MediaPaths">
  <item>~/files/uploads/Media</item>
 </property>
 <property name="UploadMediaPaths">
  <item>~/files/uploads/Media</item>
 </property>
 <property name="DeleteMediaPaths">
  <item>~/files/uploads/Media</item>
 </property>
 <property name="MediaFilters">
  <item>*.avi</item>
  <item>*.mpeg</item>
  <item>*.mpg</item>
  <item>*.mov</item>
 </property>

I also edited the ToolsFile.xml so this property is enabled (it was commeneted out at one time)

 <tool name="MediaManager"/>

Therefore, any guidance on how to get this to work would be great.

Rumen
Telerik team
 answered on 12 Jul 2012
0 answers
207 views
Hi,
In our project the menu is done using the telerik radmenu. For some pages that are not shown in navigation, it is throwing an exception.

The website id done using the cms Sitefinity.

'SiteMap.CurrentNode.NextSibling' threw an exception of type 'System.ArgumentNullException' System.Web.SiteMapNode {System.ArgumentNullException}.
It is the same error with PreviousSibling.


public void HorizontalRadMenu_ItemDataBound(object sender, RadMenuEventArgs e)
{
string[] strNavigationPages = { "Home", "About", "Product", "Sales", "Marketing", "Partners", "Resources", "...", "...", "...", "...", "...", "..." };
if (e.Item != null)
{
 
 
if (e.Item.Level == 0)
{
parentPageId = ((Telerik.Sitefinity.Web.PageSiteNode)(e.Item.DataItem)).Id.ToString();
}
 
 
 
 
string currentPageId = ((Telerik.Sitefinity.Web.PageSiteNode)(e.Item.DataItem)).Id.ToString();
string findThisString = e.Item.Text;
 
 
 
 
int strIndex = -1;
int flag = -1;
if (!String.IsNullOrEmpty(findThisString) && ((Telerik.Sitefinity.Web.PageSiteNode)(e.Item.DataItem)).ShowInNavigation)
{
for (int strNumber = 0; strNumber < strNavigationPages.Length; strNumber++)
{
strIndex = strNavigationPages[strNumber].IndexOf(findThisString);
if (strIndex > -1)
{
flag = 1;
}
}
 
 
if (flag == -1 && ((Telerik.Sitefinity.Web.PageSiteNode)(e.Item.DataItem)).ParentKey != parentPageId && e.Item.Level < 2)
{
e.Item.Remove();
}
}
else
{
e.Item.Remove();
}
 
 
}
}



When does the SiteMap.CurrentNode.NextSibling and the PreviousSibling becomes null? 
Can anyone please help me.


Thanks,
Surya.
Surya CD
Top achievements
Rank 1
 asked on 03 Jul 2012
0 answers
160 views
Hello, Telerik guys (and girls). Thank you for this wonderful resource - tv.telerik.com.

I have one question. While downloading some files for offline viewing, I noticed that there is two locations from which files can be downloaded:
1) telerik.a.ec.viddler.com - this is from where video in flash player downloading.
2) (telerik, xxx).src.a.ec.viddler.com, wds.mp.advection.net - this is target for direct download.

My question is - where is video with better quality ( I assume it will be original video)?
Should I prohibit  downloading from telerik.a.ec.viddler.com?

Feature request.
Please, create one torrent file with all video on site. Of course, with tags, and categories support
Pavel
Top achievements
Rank 1
 asked on 24 Jun 2012
5 answers
173 views
Hi, I just signed up for the Q2 2012 Webinars and noticed afterwards that they are very early in the morning for us on the West Coast.  7AM is earlier than most of us start work over here, so if I can make the suggestion that you either:

a) Have a second broadcast later in the day.
b) Have a later broadcast that works for both sides of the country.
Nick
Top achievements
Rank 1
 answered on 21 Jun 2012
1 answer
135 views
Hi,



I am a Window Application developer and I want to start creating Web Application, I am in a company that has 2 developer for inhouse development.



I need to create Web Application Quickly but with flexibility.



First come to mind was Microsoft Lightswitch as I have play with it and quite happy but Some of our data in the database does not have primary key which is required by Lightswitch Application which I then need to create WCF Services, this is where I have stop and rethink.



I am coming from Windows Application Development where I access Database information directly to the Database(store procedure, tsql), When I am moving to Web Application  It seem to me there are a lot of choice in deciding what to use WCF, OData, ... but that would add some time to learn before I can get an App up and running.



Let said I am targeting application delivery time frame in 2 Week (I am converting a few simple windows application).



Also some of our users that have iPad, that mean Silverlight is not available and (Lightswitch Require Silverlight).



I did have a though of ASP.NET MVC but, it require a bit of learning and a lot of the validation in Lightswitch is so temping. Therefore my thinking was to create the app in Microsoft Lightswitch and some how have common data access to the business rule.



Which I can then create App on iPad/Android as needed.



OS: Windows 7/Windows 8

    Web Application

Development Tool:

    VS 2010 Ultimate

    Telerik Ultimate 

Reusability:

    iPad/Android Tablet

    IOS Application Access SQL Server Database

    Android Application Access SQL Server Database



Do you have an suggestion ?

Do I have to create Web Services Before I start my Web Application development.



It's been on my mind, therefore I though I'll drop a line here to stop me wondering.



Thanks in advance for your help.

Regards Dat.
Dat
Top achievements
Rank 1
 answered on 21 Jun 2012
0 answers
1.1K+ views
such good afternoon, I was trying to update the record in the telerik: RadGrid
  I am using SqlDataSource1

alone and unable to perform query, insert, and elimar,
not allow me to perform the update of the record that I'm putting badly, or if there is a better way to perform these operations without using SqlDataSource1

another query, as I can pass values ​​from the aspx form ie values ​​of a combobox or textbox and assign an example:
assign them to the values ​​to insert or remove than the ones in the grid

  <InsertParameters>
                                    <asp:Parameter Name="usuario" />
                                    <asp:Parameter Name="f_actual" />
                                    <asp:Parameter Name="id_cliente" />
                                    <asp:Parameter Name="nomContactoCliente" />
                                    DefaultValue="agondola" <asp:Parameter Name="id_empleado" />
                                    <asp:Parameter Name="id_estado" />
                                    <asp:Parameter Name="f_tarea" />
                                    <asp:Parameter Name="descripcionTarea" />
                                    <asp:Parameter Name="cantidadHoraTarea" />
                                    DefaultValue="1" <asp:Parameter Name="id_proyecto" />
                                </ InsertParameters>


/////////////////////////////////////////////////////////////////////////////////////////////
code aspx in c#


<%@ Page Title="" Language="C#" MasterPageFile="~/ReporteHoras.Master" AutoEventWireup="true" CodeBehind="reporteHoras.aspx.cs"
Inherits="Reporte_Horas.Mantenimiento.reporteHoras" %>

<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>


<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">

    <style type="text/css">
        .GridViewStyle
        {}
        </style>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
   
   

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

     


     <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            <!--
            function RowDblClick(sender, eventArgs) {
              sender.get_masterTableView().editItem(eventArgs.get_itemIndexHierarchical());
            }

            function gridCreated(sender, args) {
//                if (sender.get_editIndexes && sender.get_editIndexes().length > 0) {
//                    document.getElementById("OutPut").innerHTML = sender.get_editIndexes().join();
//                }
//                else {
//                    document.getElementById("OutPut").innerHTML = "";
//                }
            }
            -->
        </script>
    </telerik:RadCodeBlock>

 
   

   <fieldset class="containersintitulo">

                        <fieldset style="width: 865px">
                                 <legend class="titulocontainerinterno">Consulta de Horas</legend>
                                        
                                 <table style="width: 855px">
                                     <tr>
                                         <td>
                                             <asp:Label ID="lblConsultor" runat="server" Text="Consultor"></asp:Label>
                                         </td>
                                         <td>
                                             <telerik:RadComboBox ID="ddlConsultor" Runat="server" Enabled="False"
                                                 Width="258px">
                                             </telerik:RadComboBox>
                                         </td>
                                         <td>
                                             &nbsp;</td>
                                         <td>
                                             <asp:Label ID="lblProyecto" runat="server" Text="Proyecto"></asp:Label>
                                         </td>
                                         <td>
                                             <telerik:RadComboBox ID="dllProyecto" Runat="server" Height="23px"
                                                 Width="165px">
                                             </telerik:RadComboBox>
                                         </td>
                                     </tr>
                                     <tr>
                                         <td>
                                             <asp:Label ID="lblCliente" runat="server" Text="Cliente"></asp:Label>
                                         </td>
                                         <td>
                                             <telerik:RadComboBox ID="ddlCLiente" Runat="server" AutoPostBack="True"
                                                 Width="258px" onselectedindexchanged="ddlCLiente_SelectedIndexChanged">
                                             </telerik:RadComboBox>
                                         </td>
                                         <td>
                                             &nbsp;</td>
                                         <td>
                                             <asp:Label ID="lblFechaInicio" runat="server" Text="Fecha Inicio"></asp:Label>
                                         </td>
                                         <td>
                                             <telerik:RadDatePicker ID="dpFechaInicio" Runat="server" AutoPostBack="True"
                                                 onselecteddatechanged="dpFechaInicio_SelectedDateChanged" Culture="es-PA"
                                                 Skin="Windows7">
                                                      <Calendar UseRowHeadersAsSelectors="False" UseColumnHeadersAsSelectors="False"
                                                          ViewSelectorText="x" Skin="Windows7"></Calendar>

                                                     <DateInput DisplayDateFormat="MM/dd/yyyy" DateFormat="MM/dd/yyyy" EnableSingleInputRendering="True" LabelWidth="64px"
                                                             AutoPostBack="True"></DateInput>

                                                  <DatePopupButton ImageUrl="" HoverImageUrl=""></DatePopupButton>
                                             </telerik:RadDatePicker>
                                         </td>
                                     </tr>
                                     <tr>
                                         <td>
                                             <asp:Label ID="lblContactoCliente" runat="server" Text="Contacto del Cliente"></asp:Label>
                                         </td>
                                         <td>
                                             <asp:TextBox ID="txtContactoCliente" runat="server" Width="255px"></asp:TextBox>
                                         </td>
                                         <td>
                                             &nbsp;</td>
                                         <td>
                                             <asp:Label ID="lblFechaFin" runat="server" Text="Fecha Fin"></asp:Label>
                                         </td>
                                         <td>
                                             <telerik:RadDatePicker ID="dpFechaFin" Runat="server" Skin="Windows7"
                                                 Enabled="False">
                                                 <Calendar Skin="Windows7" UseColumnHeadersAsSelectors="False"
                                                     UseRowHeadersAsSelectors="False" ViewSelectorText="x">
                                                 </Calendar>
                                                 <DateInput DateFormat="MM/dd/yyyy" DisplayDateFormat="MM/dd/yyyy"
                                                     EnableSingleInputRendering="True" LabelWidth="64px">
                                                 </DateInput>
                                                 <DatePopupButton HoverImageUrl="" ImageUrl="" />
                                             </telerik:RadDatePicker>
                                         </td>
                                     </tr>
                                     <tr>
                                         <td>
                                             &nbsp;</td>
                                         <td>
                                             &nbsp;</td>
                                         <td>
                                             &nbsp;</td>
                                         <td>
                                             &nbsp;</td>
                                         <td>
                                             &nbsp;</td>
                                     </tr>
                                 </table>

                                 <%-- campo cantidad de horas--%>

                                <hr style="color: #3366FF;" />                              
                                

                           <asp:Label ID="lblMensajes" runat="server" ForeColor="Red"></asp:Label>

                                   
                                 <br />

                                   
                        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                             <AjaxSettings>
                                   <telerik:AjaxSetting AjaxControlID="RadGrid1">
                                        <UpdatedControls>
                                              <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                                              <telerik:AjaxUpdatedControl ControlID="RadWindowManager1" />
                                        </UpdatedControls>
                                   </telerik:AjaxSetting>

                             </AjaxSettings>
                        </telerik:RadAjaxManager>


                        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanelReporte" runat="server" />


                                 <%--Contiene los totales de horas registradas--%>      
                          
                           <telerik:RadGrid ID="RadGrid1" GridLines="None" runat="server" AllowAutomaticDeletes="True"
        AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowPaging="True"
        AutoGenerateColumns="False" OnUpdateCommand="RadGrid1_UpdateCommand" OnItemUpdated ="RadGrid1_ItemUpdated"
        OnItemDeleted="RadGrid1_ItemDeleted" OnItemInserted="RadGrid1_ItemInserted"
                                     OnDataBound="RadGrid1_DataBound" Skin="Windows7" CellSpacing="0"
                                     onneeddatasource="RadGrid1_NeedDataSource" DataSourceID="SqlDataSource1" >
        <PagerStyle Mode="NextPrevAndNumeric" />
        <MasterTableView Width="100%" CommandItemDisplay="TopAndBottom"
                                   DataKeyNames="id_reporte, f_tarea, id_estado, descripcionTarea, cantidadHoraTarea"
                                   HorizontalAlign="NotSet" AutoGenerateColumns="False"
                                   DataSourceID="SqlDataSource1">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>

<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>

<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn">
                    <ItemStyle CssClass="MyImageButton" />
                </telerik:GridEditCommandColumn>

                <telerik:GridBoundColumn DataField="id_reporte" HeaderText="ID Reporte" SortExpression="id_reporte"
                    UniqueName="id_reporte" ColumnEditorID="GridTextBoxColumnEditor1">
                </telerik:GridBoundColumn>

                  <telerik:GridDateTimeColumn DataField="f_tarea"
                    FilterControlAltText="Filter f_tarea column" HeaderText="Fecha"
                    SortExpression="f_tarea" UniqueName="f_tarea">
                </telerik:GridDateTimeColumn>

                  <telerik:GridDropDownColumn DataField="id_estado" DataSourceID="SqlDataSource2"
                    HeaderText="Estado de Tarea" ListTextField="descripcion" ListValueField="id_estado"
                    UniqueName="id_estado" ColumnEditorID="GridDropDownColumnEditor1">
                </telerik:GridDropDownColumn>

                  <telerik:GridBoundColumn DataField="descripcionTarea"
                    HeaderText="Descripcion de Tareas" SortExpression="descripcionTarea"
                    UniqueName="descripcionTarea" ColumnEditorID="GridTextBoxColumnEditor2"
                    FilterControlAltText="Filter descripcionTarea column">
                </telerik:GridBoundColumn>

                <telerik:GridNumericColumn DataField="cantidadHoraTarea" HeaderText="Cantidad de Horas" SortExpression="cantidadHoraTarea"
                    UniqueName="cantidadHoraTarea" ColumnEditorID="GridNumericColumnEditor1" >
                </telerik:GridNumericColumn>


                <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                    UniqueName="DeleteColumn">
                    <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                </telerik:GridButtonColumn>

            </Columns>

            <EditFormSettings ColumnNumber="2" CaptionDataField="id_reporte" CaptionFormatString="Edit properties of Product {0}"
                InsertCaption="New Product">
                <FormTableItemStyle Wrap="False"></FormTableItemStyle>

<FormTableStyle CellPadding="2" CellSpacing="0" BackColor="White" Height="110px"></FormTableStyle>

<FormMainTableStyle CellPadding="3" CellSpacing="0" BackColor="White" Width="100%"></FormMainTableStyle>

                <FormCaptionStyle CssClass="EditFormHeader"></FormCaptionStyle>
                <FormMainTableStyle GridLines="None" CellSpacing="0" CellPadding="3" BackColor="White"
                    Width="100%" />
                <FormTableStyle CellSpacing="0" CellPadding="2" Height="110px" BackColor="White" />
                <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>
                <EditColumn ButtonType="ImageButton" InsertText="Insert Order" UpdateText="Update record"
                    UniqueName="EditCommandColumn1" CancelText="Cancel edit">
                </EditColumn>
                <FormTableButtonRowStyle HorizontalAlign="Right" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>
            </EditFormSettings>
        </MasterTableView>

        <ClientSettings>
<Selecting CellSelectionMode="None"></Selecting>

            <ClientEvents OnRowDblClick="RowDblClick" OnGridCreated="gridCreated" />

<ClientEvents OnGridCreated="gridCreated" OnRowDblClick="RowDblClick"></ClientEvents>
        </ClientSettings>

<FilterMenu EnableImageSprites="False"></FilterMenu>
    </telerik:RadGrid>


  <%--  fin del grid--%>


                               

                                   <br />

                                 <%--Contiene los totales de horas registradas--%>
                                   <telerik:GridDateTimeColumnEditor ID="GridDateTimeColumnEditor1"  runat="server"  />

                                 <%--Contiene los totales de horas registradas--%>
                                 <telerik:GridDropDownListColumnEditor ID="GridDropDownColumnEditor1" runat="server"  DropDownStyle-Width="110px" />

                                 <%--Contiene los totales de horas registradas--%>
                                  <telerik:GridNumericColumnEditor ID="GridNumericColumnEditor1" runat="server"  NumericTextBox-MaxLength="2" NumericTextBox-MaxValue ="24"
                                      NumericTextBox-MinValue ="1" NumericTextBox-Width="40px" />

                                 <%--Contiene la descripcion de la tarea--%>
                                   <telerik:GridTextBoxColumnEditor ID="GridTextBoxColumnEditor1" runat="server"  TextBoxMaxLength="100" TextBoxStyle-Width="250px" />
                                 
                                

                                   <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Windows7">
                                   </telerik:RadWindowManager>


                             <br />


                           <asp:SqlDataSource ID="SqlDataSource1" runat="server"
                                     ConnectionString="<%$ ConnectionStrings:DBReporteHora %>" DeleteCommand="    DELETE FROM [ReportesHoras]
    WHERE  [ReportesHoras].id_reporte = @ID_REPORTE" InsertCommand="INSERT INTO [DBReporteHoras].[dbo].[ReportesHoras]
           ([usuario]
           ,[f_actual]
           ,[id_cliente]
           ,[nomContactoCliente]
           ,[id_empleado]
           ,[id_estado]
           ,[f_tarea]
           ,[descripcionTarea]
           ,[cantidadHoraTarea]
           ,[id_proyecto])

     VALUES    
            (
            @usuario,
            @f_actual,
            @id_cliente,
            @nomContactoCliente,
            @id_empleado,
            @id_estado,
            CONVERT(NVARCHAR(10),@f_tarea,101),
            @descripcionTarea,
            @cantidadHoraTarea,
            @id_proyecto)    "


                                     SelectCommand="SELECT r.id_reporte, r.nomContactoCliente, CONVERT (NVARCHAR(10), r.f_tarea, 103) AS f_tarea, r.descripcionTarea,
                                     r.id_estado, e.descripcion AS descripcion_estado, r.cantidadHoraTarea, r.id_empleado, r.id_cliente, r.id_proyecto FROM
                                     ReportesHoras AS r
                                     INNER JOIN Estados AS e ON r.id_estado = e.id_estado
                                     WHERE (r.id_empleado = @id_empleado)
                                      AND (r.id_proyecto = @id_cliente) AND (r.id_proyecto = @id_proyecto)
                                      AND (r.f_tarea BETWEEN @ID_F_INICIO AND @ID_F_FIN)
                                      ORDER BY r.id_reporte"
                                     
                                     
       UpdateCommand="    UPDATE  [ReportesHoras]
        SET
            
            [ReportesHoras].id_estado  = @id_estado,    
            [ReportesHoras].descripcionTarea  = @descripcionTarea,            
            [ReportesHoras].cantidadHoraTarea = @cantidadHoraTarea
        WHERE
            [ReportesHoras].ID_REPORTE = @id_reporte    "
                                     ProviderName="<%$ ConnectionStrings:DBReporteHora.ProviderName %>">
                             
                               <DeleteParameters>
                                   <asp:Parameter Name="id_reporte" />
                               </DeleteParameters>

                               <InsertParameters>
                                   <asp:Parameter  DefaultValue="agondola" Name="usuario" />
                                   <asp:Parameter  DefaultValue="datetime" Name="f_actual" />
                                   <asp:Parameter  DefaultValue="1" Name="id_cliente" />
                                   <asp:Parameter DefaultValue="1" Name="nomContactoCliente" />
                                   <asp:Parameter DefaultValue="agondola" Name="id_empleado" />
                                   <asp:Parameter Name="id_estado" />
                                   <asp:Parameter Name="f_tarea" />
                                   <asp:Parameter Name="descripcionTarea" />
                                   <asp:Parameter Name="cantidadHoraTarea" />
                                   <asp:Parameter DefaultValue="1"  Name="id_proyecto" />
                               </InsertParameters>

                               <SelectParameters>
                                   <asp:Parameter  DefaultValue="agondola" Name="id_empleado" />
                                   <asp:Parameter  DefaultValue="1" Name="id_cliente" />
                                   <asp:Parameter  DefaultValue="1" Name="id_proyecto" />
                                   <asp:Parameter  DefaultValue="2012-06-11" Name="ID_F_INICIO" />
                                   <asp:Parameter  DefaultValue="2012-06-11" Name="ID_F_FIN" />
                               </SelectParameters>

                               <UpdateParameters>
                                   <asp:Parameter Name="id_reporte" />
                                   <asp:Parameter Name="id_estado" />
                                   <asp:Parameter Name="descripcionTarea" />
                                   <asp:Parameter Name="cantidadHoraTarea" />
                               </UpdateParameters>

                           
                               </asp:SqlDataSource>



   <asp:SqlDataSource ID="SqlDataSource2" runat="server"
     ConnectionString="<%$ ConnectionStrings:DBReporteHora %>"
          SelectCommand="sp_pp_Select_Estados_Tareas" SelectCommandType="StoredProcedure"
                                     ProviderName="<%$ ConnectionStrings:DBReporteHora.ProviderName %>">
    </asp:SqlDataSource>

                                 <br />


                              <hr style="color: #3366FF; width: 845px;" />



                              <%--Contiene los totales de horas registradas--%>
                              <table>
                               <tr>
                                   <td>
                                       &nbsp;
                                       <asp:Label ID="lblHorasTrabajadas" runat="server"
                                           Text="Total de horas trabajadas:"></asp:Label>
                                   </td>
                                   <td>
                                       &nbsp;
                                       <asp:TextBox ID="txtHorastrabajadas" runat="server" Enabled="False"
                                           Width="40px"></asp:TextBox>
                                   </td>
                               </tr>
                           </table>
                      
                                        
                       </fieldset>

    </fieldset>

 
 
</asp:Content>

////////////////////////////////////////////////////////////////////////////////////////////


///////////////////////////////////////////////////////
code aspx.cs

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Telerik.Web.UI;
using Telerik.Web.UI.Calendar;

using System.Data.Common;
using System.IO;
using System.Data;
using System.Data.SqlClient;
using Reporte_Horas.Clases;

using System.Configuration;
using System.Collections;
using System.Web.Security;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Drawing;




namespace Reporte_Horas.Mantenimiento
{
    public partial class reporteHoras : System.Web.UI.Page
    {
        //Clase que contiene las funciones de insercion, eliminar, modificar y busquedas por criterior
        clsReporteHoras ReporteHotas = new clsReporteHoras();
      
        private string gridMessage = null;


        protected void Page_Load(object sender, EventArgs e)
        {

            //Carga solamente la primera vez que se inicia la pagina, dejando los valores seleccionados despues de hacer otro postback
            if (!Page.IsPostBack)
            {
                        
               //Se inicializan los valores de fecha inicial y fecha final en la seccion de busqueda
               dpFechaInicio.SelectedDate = DateTime.Now.Date;
               string ls_dia = "";
               int li_numDia = 0;

               //Llena la lista de empleados
               LLenarEmpleados();

               //Usuario que se logeo en la aplicacion
               ddlConsultor.SelectedValue = "agondola";

               //LLena la lista de clientes
                LLenarClientes();
                
                //Llena la lista de proyectos dependiendo del cliente seleccionado
                llenarProyectos(Convert.ToInt32(ddlCLiente.SelectedValue));

                //Llena la lista de estados de las tareas del reporte
               // llenarEstadoTareas();

                //Permite asignar el rango de fecha al cual el usuario estara permitido a ingresar los reportes de hora
                 RangoFecha();

                //Permite cargar el grid de reporte de hora del empleado despendiendo de los criterios seleccionados
                //fLLenarGV();

                //Se utiliza para que se permita insertar, modificar y eliminar el registro en la misma fila
                 RadGrid1.MasterTableView.EditMode = GridEditMode.InPlace;

             }

        }


        /// <summary>
        /// Permite cargar la lista de reporte de hora del empleado despendiendo de los criterios seleccionados
        /// </summary>
        public void fLLenarGV()
        {

            try
            {

               DataSet dtsDatos = new DataSet();

               DataTable dt = new DataTable("TblRegistros");

               DataRow dr;

               int li_totalHoras = 0;

               //Limpia el label capturador de los errores
               lblMensajes.Style.Add("display", "");
               lblMensajes.Text = "";

               //Se le asigna al dataSet los valores recuperados del reporte de hora por los criterios seleccionados por el usuario  
               dtsDatos = ReporteHotas.Select_Reporte_Horas(Convert.ToString(ddlConsultor.SelectedValue), Convert.ToInt32(ddlCLiente.SelectedValue), Convert.ToInt32(dllProyecto.SelectedValue),
                          dpFechaInicio.SelectedDate.Value, dpFechaFin.SelectedDate.Value);

                //Se crea un datatable con los nombres de las columnas a desplegar en la lista de reportes de horas
                dt.Columns.Add("id_reporte");
                dt.Columns.Add("f_tarea");
                dt.Columns.Add("id_estado");
                dt.Columns.Add("descripcion_estado");
                dt.Columns.Add("descripcionTarea");
              
                dt.Columns.Add("cantidadHoraTarea");
                dt.Columns.Add("comando"); //campo utilizado para verificar si es un registro nuevo o un registro a actualizar


               //Se utiliza para agregar una nueva fila si no se recuperan datos en la consulta
               if( dtsDatos.Tables[0].Rows.Count == 0 ){
 
                   dr = dt.NewRow();
                   
                   //Se asignan valores a los registros para cargar el data table con informacion
                   dr["id_reporte"] = "";
                   dr["f_tarea"] = "";
                   dr["id_estado"] = "";
                   dr["descripcion_estado"] = "";
                   dr["descripcionTarea"] = "";
                  
                   dr["cantidadHoraTarea"] = "";
                   dr["comando"] = "N";  //campo utilizado para verificar si es un registro nuevo o un registro a actualizar

                   dt.Rows.Add(dr);
                
                    }

                else
               {
                   //Si devuelve registros se le asigna al campo comando: U, que significa que esa fila se actualizara
                   for (int i = 0; i < dtsDatos.Tables[0].Rows.Count; i++)
                   {

                       dr = dt.NewRow();

                       //Se asignan valores a los registros para cargar el data table con informacion
                       dr["id_reporte"] = dtsDatos.Tables[0].Rows[i]["id_reporte"];
                       dr["f_tarea"] = dtsDatos.Tables[0].Rows[i]["f_tarea"];
                       dr["id_estado"] = dtsDatos.Tables[0].Rows[i]["id_estado"];
                       dr["descripcion_estado"] = dtsDatos.Tables[0].Rows[i]["descripcion_estado"];
                       dr["descripcionTarea"] = dtsDatos.Tables[0].Rows[i]["descripcionTarea"];
               
                       dr["cantidadHoraTarea"] = dtsDatos.Tables[0].Rows[i]["cantidadHoraTarea"];

                       //Se calcula el total de horas trabajadas por el empleado, por los criterios selecionados
                       li_totalHoras = li_totalHoras + Convert.ToInt32(dtsDatos.Tables[0].Rows[i]["cantidadHoraTarea"]);

                       dr["comando"] = "U";   //campo utilizado para verificar si es un registro nuevo o un registro a actualizar

                       dt.Rows.Add(dr);

                   }

               }


               //Se asigna el DataTable al grid de "gvDatosReporte" para desplegar la lista de reportes del empleado por los criterios selecionados
                //gvDatosReporte.DataSource = dt;              
                //gvDatosReporte.DataBind();

                //gvDatosReporte.Visible = true;

                //Le asigno la suma de las horas trabajadas por el empleado a la caja de texto
                txtHorastrabajadas.Text = Convert.ToString(li_totalHoras);


                /////////////////////////////////
                //RadGrid1.DataSource = dt;
                //RadGrid1.DataBind();

                //RadGrid1.Visible = true;


                

            }
            catch (Exception ex)
            {
                lblMensajes.Style.Add("display", "");
                lblMensajes.Text = ex.Message;
            }

        }




        /// <summary>
        ///Se utiliza para cargar la lista de empleados
        /// </summary>
        public void LLenarEmpleados()
        {
            try
            {
                DataSet dtsDatos = new DataSet();

                //Se obtiene la lista de empleados
                dtsDatos = ReporteHotas.Select_Empleados();

                //Se carga el combo de consultor
                ddlConsultor.DataSource = dtsDatos;
                ddlConsultor.DataTextField = "nombre";
                ddlConsultor.DataValueField = "id_empleado";
                ddlConsultor.DataBind();

                ddlConsultor.SelectedIndex = 0;
            }

            catch (Exception ex)
            {

                lblMensajes.Style.Add("display", "");
                lblMensajes.Text = ex.Message;
            }
        }


    


        /// <summary>
        ///Se utiliza para cargar la lista de clientes
        /// </summary>
        public void LLenarClientes()
        {
            try
            {
                DataSet dtsDatos = new DataSet();

                //Se obtiene la lista de clientes             
                dtsDatos =  ReporteHotas.Select_Clientes();

                //Se carga el combo de clientes
                ddlCLiente.DataSource = dtsDatos;
                ddlCLiente.DataTextField = "nombre";
                ddlCLiente.DataValueField = "id_cliente";
                ddlCLiente.DataBind();

                ddlCLiente.SelectedIndex = 0;
            }

            catch (Exception ex)
            {

                lblMensajes.Style.Add("display", "");
                lblMensajes.Text = ex.Message;
             }
        }


        /// <summary>
        /// Se utiliza para cargar la lista de proyectos dependiendo el cliente seleccionado
        /// </summary>
        public void llenarProyectos(int li_id_cliente)
        {
            try
            {

                DataSet dtsDatos = new DataSet();

                //Se obtiene la lista de proyectos por el cliente seleccionado
                dtsDatos = ReporteHotas.Select_Proyectos(li_id_cliente);

                //Se carga el combo de proyecto
                dllProyecto.DataSource = dtsDatos;
                dllProyecto.DataTextField = "nombre";
                dllProyecto.DataValueField = "id_proyecto";
                dllProyecto.DataBind();

                dllProyecto.SelectedIndex = 0;

            }

            catch (Exception ex)
            {
                lblMensajes.Style.Add("display", "");
                lblMensajes.Text = ex.Message;
            }

        }




        /// <summary>
        /// Selecciona la lista de proyectos dependiendo del cliente seleccionado
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void ddlCLiente_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            try
            {
                //Se carga la lista de proyectos dependiendo el cliente seleccionado
                llenarProyectos(Convert.ToInt32(ddlCLiente.SelectedValue));

            }
            catch (Exception ex)
            {
                lblMensajes.Style.Add("display", "");
                lblMensajes.Text = ex.Message;
            }
        }

      

        /// <summary>
        /// Permite asignarle el rango de fecha inicio y fin para realizar la carga de reporte de horas
        /// </summary>
        public void RangoFecha ()
           {

             try
             {
            
            //controles de fecha
            string ls_dia = "";
            int li_numDia = 0;

            //Se escoje el nombre del dia para realizar el proceso de armar el rango de fecha inicial y rango de fecha final
            ls_dia = Convert.ToString(dpFechaInicio.SelectedDate.Value.DayOfWeek);

            switch (ls_dia)
            {
                case "Monday":

                    li_numDia = 0;

                    break;
                case "Tuesday":

                    li_numDia = -1;

                    break;
                case "Wednesday":

                    li_numDia = -2;

                    break;
                case "Thursday":

                    li_numDia = -3;

                    break;
                case "Friday":

                    li_numDia = -4;

                    break;
                case "Saturday":

                    li_numDia = -5;

                    break;
                case "Sunday":

                    li_numDia = -6;

                    break;
                default:
                    break;
            }

            //Rango inicial en la seccion de busqueda
            dpFechaInicio.SelectedDate = Convert.ToDateTime(dpFechaInicio.SelectedDate).AddDays(Convert.ToInt32(li_numDia));

            //Rango final en la seccion de busqueda
            dpFechaFin.SelectedDate = Convert.ToDateTime(dpFechaInicio.SelectedDate).AddDays(+6);
            
            //Fecha minima que se podra ingresar la tarea
            //RadGrid1.Item("id_reporte") = Convert.ToDateTime(dpFechaInicio.SelectedDate);

               
            //dpFecha.MinDate = Convert.ToDateTime(dpFechaInicio.SelectedDate);
            //Fecha maxima que se podra ingresar la tarea
            //dpFecha.MaxDate = Convert.ToDateTime(dpFechaFin.SelectedDate);

            }
            catch (Exception ex)
            {
                lblMensajes.Style.Add("display", "");
                lblMensajes.Text = ex.Message;
            }

    }

        /// <summary>
        /// Permite colocar el rango de fecha de inicio y fecha fin al cual el empleado puede ingresar las tareas
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        protected void dpFechaInicio_SelectedDateChanged(object sender, SelectedDateChangedEventArgs e)
        {
            try
            {

                //Permite colocar el rango de fecha de inicio y fecha fin al cual el empleado puede ingresar las tareas
                RangoFecha();

            }
            catch (Exception ex)
            {
                lblMensajes.Style.Add("display", "");
                lblMensajes.Text = ex.Message;
            }
        }



        protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
        {
            Hashtable oldValues = new Hashtable();
            Hashtable newValues = new Hashtable();
            GridEditableItem editedItem = e.Item as GridEditableItem;
            oldValues = (Hashtable)editedItem.SavedOldValues;
            e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);
        }




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


            GridEditableItem item = (GridEditableItem)e.Item;
            String id = Convert.ToString(item.GetDataKeyValue("id_reporte"));


            if (e.Exception != null)
            {
                e.KeepInEditMode = true;
                e.ExceptionHandled = true;
                SetMessage("Reporte con ID " + id + " no pudo ser actualizado. Razón: " + e.Exception.Message);
            }
            else
            {
                SetMessage("Reporte con ID " + id + " fue actualizado!");
            }
        }

        protected void RadGrid1_ItemInserted(object source, GridInsertedEventArgs e)
        {

         
            if (e.Exception != null)
            {
                e.ExceptionHandled = true;
                SetMessage("La tarea no se puede insertar. Razón: " + e.Exception.Message);
            }
            else
            {
                SetMessage("La nueva tarea se inserto!");
            }
        }

        protected void RadGrid1_ItemDeleted(object source, GridDeletedEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.Item;
            String id =  Convert.ToString(dataItem.GetDataKeyValue("id_reporte"));


            if (e.Exception != null)
            {
                e.ExceptionHandled = true;
                SetMessage("Tarea con ID " + id + " no fue eliminada. Razón: " + e.Exception.Message);
            }
            else
            {
                SetMessage("Tarea con ID " + id + " fue eliminada!");
            }
        }





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

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



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

        protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {

            //fLLenarGV();


        }

    }
     
 }
Alexis
Top achievements
Rank 1
 asked on 20 Jun 2012
3 answers
423 views
Hi Telerik Team,

I have a radgrid with skin like Windows7 and I need to set a  border color to rows only in a radgrid.I tried as follows:

 

 

<telerik:RadGrid ID="rgLeaveType" runat="server" AutoGenerateColumns="False" CellSpacing="0"

 

 

 

AllowSorting="True" AllowFilteringByColumn="True" OnItemCommand="rgLeaveType_ItemCommand"

 

 

 

OnItemCreated="rgLeaveType_ItemCreated" OnItemDataBound="rgLeaveType_ItemDataBound"

 

 

 

OnNeedDataSource="rgLeaveType_NeedDataSource" Skin="Windows7" GridLines="Horizontal"

 

 

 

BorderColor="Red">

 


 

 

<telerik:GridButtonColumn FilterControlAltText="Filter column2 column" UniqueName="Delete"

 

 

 

Text="Delete" ConfirmText="Do you want to delete?" CommandName="Delete">

 

 

 

<HeaderStyle BorderColor="Red" />

 

 

 

<ItemStyle BorderColor="Red" />

 

 

 

</telerik:GridButtonColumn>

 


 

 

But I get border color to both rows and columns of the grid.How can I set border color to radgrid rows only.?
Thanks
Dayana

 

Pavlina
Telerik team
 answered on 18 Jun 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?