Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
84 views
I would like to display some of the grid columns always in the edit mode and once the user enters the data perform batch update (save button at the bottom of the form).

What is the best approach to accomplish this task?
Shinu
Top achievements
Rank 2
 answered on 15 Dec 2010
1 answer
50 views
I'm having a problem were multiple status "windows" are appearing at the bottom of the edit window.  See attached.  Now doubt I did something silly, but am have a problem tracking it down.  Any ideas where to look?

Thanks in advance.
John
Top achievements
Rank 1
 answered on 14 Dec 2010
4 answers
105 views
I am having a couple issues with setting custom colors to a chart:
  1. The legend and datachart are not the same as the chart
  2. The second color is transparent which is not consistent with the other items
  3. how to remove a repeating color
below is what I have been doing. 
protected void rcNetworkBroadcastChange_ItemDataBound(object sender, Telerik.Charting.ChartItemDataBoundEventArgs e)
{
    string net = ((DataRowView)e.DataItem)["Net"].ToString();
    e.SeriesItem.ActiveRegion.Tooltip = "Network: " + net + "\n" + ((DataRowView)e.DataItem)["Demo"].ToString() + ": " + ((DataRowView)e.DataItem)["Demo_Value"].ToString();
   if (NetworkColor.ContainsKey(net))
    {
        e.SeriesItem.Appearance.FillStyle.MainColor = (Color)NetworkColor[net];
        e.ChartSeries.Appearance.FillStyle.MainColor = (Color)NetworkColor[net];
      //  e.SeriesItem.Appearance.FillStyle.SecondColor = Color.Black;
    }
}

John Giblin
Top achievements
Rank 1
 answered on 14 Dec 2010
3 answers
133 views
Hi telerik gurus ... i'm almost new to this components and i'm learning a lot

i'll try to explain my problem in the easiest way possible

background
  1. all code in grids are execution-time and the structure and declaration in Page_init method (zero design-mode)
  2. using masterpage / contentpage and using an ajaxmanager
  3.  i'm using 2 grids in a multipage control (one using a checkbox template row, and the another using radiobutton as template row) both of them using a radtoolbar inserted in the grid
  4. in the radiobutton's one is ajaxified and i'm using a RadDock to simulate an external edit of my row (the later one inserted into a ajaxpanel)
  5. i'm using javascript to manage my radiobuttons and to display the RadDock
Everything is almost fine but a bug is pissing me:

the problem is in the Radgrid with RadioButtons . in that radgrid the toolbar has 3 buttons (New, Edit and Delete) the 2 first buttons calls the RadDock. When i press the first time the new or edit button the Raddock shows and data is displayed as i want but when close the dock and try to do the same operation the dock is not displayed aparently the second and successive times that i press button ; the event generate 2 AjaxRequest for each button (one the both aborted by the later one) and thats generate the problem

the first time i press the buttons only do 1 Ajax Request.

I'm glad to provide more information if needed

VB code behind

Imports mnlib
Imports System.Data
Imports System.Data.OleDb
Imports System.IO
Imports adquisiciones
 
Partial Public Class Proceso
    Inherits System.Web.UI.Page
    Protected oConn As Connection
    Protected oDts As DataSet
    Protected oProc As abProceso
    Protected oLSer As LosFormatter
    Protected WithEvents grdCalendario As Telerik.Web.UI.RadGrid
    Protected WithEvents grdSolpedPos As Telerik.Web.UI.RadGrid
    Protected WithEvents tbSol As tbGridProceso
    Protected WithEvents tbCal As tbGridCalendario
    Protected WithEvents oColChk As grdChkTemplate
    Protected WithEvents oColRadio As grdRadioTemplate
 
#Region "Propiedades"
    Private ReadOnly Property ChkSolped() As Hashtable
        Get
            Dim res As Object = ViewState("_csp0")
            If (res Is Nothing) Then
                res = New Hashtable
                ViewState("_csp0") = res
            End If
            Return CType(res, Hashtable)
        End Get
    End Property
 
    Private ReadOnly Property ChkSolpedPos() As Hashtable
        Get
            Dim res As Object = ViewState("_csp1")
            If (res Is Nothing) Then
                res = New Hashtable
                ViewState("_csp1") = res
            End If
            Return CType(res, Hashtable)
        End Get
    End Property
#End Region
 
    Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        Me.oConn = New Connection(System.Web.Configuration.WebConfigurationManager.OpenWebConfiguration("~"))
        oDts = New DataSet("datos")
        adquisiciones.Catalogos.getTipoProceso(oConn, oDts)
        adquisiciones.Catalogos.getResponsables(oConn, oDts)
        adquisiciones.Catalogos.getTipoSubProceso(oConn, oDts)
        adquisiciones.Catalogos.getRazonPrioridad(oConn, oDts)
        adquisiciones.Catalogos.getSolpeds(oConn, oDts)
        Intranet.Catalogos.getEspecialidad(oConn, oDts)
        '******* recreacion de la estructura en este punto es necesario segun TELERIK ***********
        Me.restoreSolPosCampos()
        Me.restoreCalCampos()
        Me.phGrdCal.Controls.Add(Me.grdCalendario)
        Me.phGrdSolPos.Controls.Add(Me.grdSolpedPos)
        '****************************************************************************************
    End Sub
 
    Private Sub FillComponents()
        If Not IsNothing(oProc) Then
            Me.txtImporte.Text = Me.oProc.importe
            Me.txtNomEvento.Text = Me.oProc.concepto
            Me.cmbResp.SelectedValue = Me.oProc.responsable
            Me.cmbTipEvento.SelectedValue = Me.oProc.tipo
            Me.cmbPrioridad.SelectedValue = Me.oProc.prioridad
            Me.cmbRazon.SelectedValue = Me.oProc.razonPrioridad
            Me.cmbEspecialidad.SelectedValue = Me.oProc.especialidad
        End If
    End Sub
 
    Protected Sub grdLista_DetailTableDataBind(ByVal source As Object, ByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles grdSolpedPos.DetailTableDataBind
        Dim a As String = ""
        Dim oVw As DataView
        Dim parentItem As Telerik.Web.UI.GridDataItem = CType(e.DetailTableView.ParentItem, Telerik.Web.UI.GridDataItem)
        Select Case e.DetailTableView.Name
            Case "SolpedPosicion"
                'e.DetailTableView.DataSource = Nothing
                oVw = New DataView(oDts.Tables("SolpedPosicion"), " num_solped='" & parentItem.GetDataKeyValue("num_solped").ToString() & "'", "", DataViewRowState.OriginalRows)
                e.DetailTableView.DataSource = oVw
        End Select
    End Sub
 
    Protected Sub grdLista_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles grdSolpedPos.NeedDataSource
        If Not e.IsFromDetailTable Then
            'restoreProcCampos()
            Me.grdSolpedPos.MasterTableView.DataSource = oDts.Tables("Solped")
            Me.grdSolpedPos.MasterTableView.Name = oDts.Tables("Solped").TableName
            If Not Page.IsPostBack Then
                restoreChkViewStateData()
            End If
        End If
    End Sub
 
    Protected Sub grdCalendario_CheckChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim oData As Telerik.Web.UI.GridDataItem
        oData = DirectCast(DirectCast(sender, RadioButton).NamingContainer, Telerik.Web.UI.GridDataItem)
        Me.hdnIds.Value = oData("cve_subproceso").Text.ToString() & "_" & oData("num_subproceso").Text.ToString()
    End Sub
 
    Private Sub restoreCalCampos()
        Dim oDgr As Telerik.Web.UI.GridBoundColumn
        Dim cont As Integer
        Dim bVacio As Boolean = True
        Dim oCTmp As Telerik.Web.UI.GridTemplateColumn
 
        Me.grdCalendario = New Telerik.Web.UI.RadGrid()
        Me.grdCalendario.ID = "grdCalendario"
        Me.grdCalendario.AllowFilteringByColumn = False
        Me.grdCalendario.AllowMultiRowSelection = False
        Me.grdCalendario.AutoGenerateColumns = False
        Me.grdCalendario.AllowPaging = True
        Me.grdCalendario.AllowSorting = True
        Me.grdCalendario.GridLines = GridLines.Both
        Me.grdCalendario.MasterTableView.CommandItemDisplay = Telerik.Web.UI.GridCommandItemDisplay.Top
        Me.grdCalendario.PagerStyle.Mode = Telerik.Web.UI.GridPagerMode.NextPrevAndNumeric
        'Me.grdCalendario.
 
        If Me.grdCalendario.Columns.Count > 0 Then
            bVacio = False
        Else
            bVacio = True
        End If
        For cont = 0 To 9
            If bVacio Then
                oDgr = New Telerik.Web.UI.GridBoundColumn()
            Else
                oDgr = Me.grdCalendario.Columns(cont)
            End If
            Select Case cont
                Case 0
                    oDgr.DataField = "num_proceso"
                    oDgr.HeaderText = "# Proceso"
                    oDgr.DataType = GetType(Long)
                    oDgr.Visible = False
                Case 1
                    oDgr.DataField = "num_subproceso"
                    oDgr.HeaderText = "# Subproceso"
                    oDgr.DataType = GetType(Long)
                    oDgr.Visible = False
                Case 2
                    oDgr.DataField = "cve_subproceso"
                    oDgr.HeaderText = "Tipo SubProceso"
                    oDgr.DataType = GetType(String)
                Case 3
                    oDgr.DataField = "titulo"
                    oDgr.HeaderText = "Titulo"
                    oDgr.DataType = GetType(String)
                Case 4
                    oDgr.DataField = "descripcion"
                    oDgr.HeaderText = "Descripcion"
                    oDgr.DataType = GetType(String)
                Case 5
                    oDgr.DataField = "fecProgIni"
                    oDgr.HeaderText = "Inicio"
                    oDgr.DataType = GetType(DateTime)
                Case 6
                    oDgr.DataField = "fecProgFin"
                    oDgr.HeaderText = "Fin"
                    oDgr.DataType = GetType(DateTime)
                Case 7
                    oDgr.DataField = "fecRealIni"
                    oDgr.HeaderText = "Fecha Inicial(Real)"
                    oDgr.DataType = GetType(DateTime)
                    oDgr.Visible = False
                Case 8
                    oDgr.DataField = "fecRealFin"
                    oDgr.HeaderText = "Fecha Final(Real)"
                    oDgr.DataType = GetType(DateTime)
                    oDgr.Visible = False
                Case 9
                    oDgr.DataField = "responsable"
                    oDgr.HeaderText = "Responsable"
                    oDgr.DataType = GetType(String)
            End Select
            If bVacio Then
                Me.grdCalendario.Columns.Add(oDgr)
            End If
        Next
        '********************* Adicion de RadioButtons ***********************
        '********************* Creacion RadioButtons ***************************
        Me.oColRadio = New grdRadioTemplate()
        oCTmp = New Telerik.Web.UI.GridTemplateColumn()
        oCTmp.ItemTemplate = Me.oColRadio
        oCTmp.HeaderText = ""
        oCTmp.UniqueName = "Rad"
        oCTmp.ReadOnly = False
        Me.grdCalendario.MasterTableView.Columns.AddAt(0, oCTmp)
        '*******************************************************************
        '************ Generar Toolbar *************
        Me.tbCal = New tbGridCalendario()
        Me.grdCalendario.MasterTableView.CommandItemTemplate = Me.tbCal
        'Me.grdCalendario.Rebind()
    End Sub
 
    Private Sub restoreSolPosCampos()
        Dim oDgr As Telerik.Web.UI.GridBoundColumn
        Dim oVw As Telerik.Web.UI.GridTableView
        Dim oGrf As Telerik.Web.UI.GridRelationFields
        Dim cont As Integer
        Dim bVacio As Boolean = True
        Dim oCTmp As Telerik.Web.UI.GridTemplateColumn
 
        Me.grdSolpedPos = New Telerik.Web.UI.RadGrid()
        Me.grdSolpedPos.ID = "grdSolpedPos"
        Me.grdSolpedPos.AllowFilteringByColumn = False
        Me.grdSolpedPos.MasterTableView.AutoGenerateColumns = False
        Me.grdSolpedPos.MasterTableView.CommandItemDisplay = Telerik.Web.UI.GridCommandItemDisplay.Top
        Me.grdSolpedPos.AllowPaging = True
        Me.grdSolpedPos.AllowSorting = True
        Me.grdSolpedPos.GridLines = GridLines.Both
        Me.grdSolpedPos.PagerStyle.Mode = Telerik.Web.UI.GridPagerMode.NextPrevAndNumeric
        'Me.grdSolpedPos.PagerStyle.Position = Telerik.Web.UI.GridPagerPosition.TopAndBottom
 
        oVw = New Telerik.Web.UI.GridTableView()
        Me.grdSolpedPos.MasterTableView.Columns.Clear()
        For cont = 0 To 6
            oDgr = New Telerik.Web.UI.GridBoundColumn()
            Select Case cont
                Case 0
                    oDgr.DataField = "num_solped"
                    oDgr.HeaderText = "Solped"
                    oDgr.DataType = GetType(Long)
                    oDgr.ReadOnly = True
                Case 1
                    oDgr.DataField = "importe"
                    oDgr.HeaderText = "Importe"
                    oDgr.DataType = GetType(Double)
                    oDgr.Visible = False
                    oDgr.ReadOnly = True
                Case 2
                    oDgr.DataField = "concepto"
                    oDgr.HeaderText = "Concepto"
                    oDgr.DataType = GetType(String)
                    oDgr.ReadOnly = True
                Case 3
                    oDgr.DataField = "creado"
                    oDgr.HeaderText = "Creado por"
                    oDgr.DataType = GetType(String)
                    oDgr.ReadOnly = True
                Case 4
                    oDgr.DataField = "cve_documento"
                    oDgr.HeaderText = "Clave Doc."
                    oDgr.DataType = GetType(String)
                    oDgr.ReadOnly = True
                    oDgr.Visible = False
                Case 5
                    oDgr.DataField = "solicitante"
                    oDgr.HeaderText = "Solicitante"
                    oDgr.DataType = GetType(String)
                    oDgr.ReadOnly = True
                Case 6
                    oDgr.DataField = "CentroGestor"
                    oDgr.HeaderText = "Centro Gestor"
                    oDgr.DataType = GetType(String)
                    oDgr.ReadOnly = True
                    oDgr.Visible = False
            End Select
            Me.grdSolpedPos.MasterTableView.Columns.Add(oDgr)
        Next
        '********************* Adicion de ChackBoxes ***********************
        '********************* Creacion CheckBox ***************************
        Me.oColChk = New grdChkTemplate()
        oCTmp = New Telerik.Web.UI.GridTemplateColumn()
        oCTmp.ItemTemplate = Me.oColChk
        oCTmp.HeaderText = ""
        oCTmp.UniqueName = "ChkAll"
        oCTmp.ReadOnly = False
        Me.grdSolpedPos.MasterTableView.Columns.AddAt(0, oCTmp)
        '*******************************************************************
        Me.grdSolpedPos.MasterTableView.DataKeyNames = New String() {"num_solped"}
        Me.grdSolpedPos.MasterTableView.HierarchyLoadMode = Telerik.Web.UI.GridChildLoadMode.ServerOnDemand
        Me.grdSolpedPos.MasterTableView.DetailTables.Clear()
        Me.grdSolpedPos.MasterTableView.EditMode = Telerik.Web.UI.GridEditMode.InPlace
        Me.grdSolpedPos.AllowMultiRowEdit = True
        oVw.DataSource = oDts.Tables("SolpedPosicion")
        oVw.DataKeyNames = New String() {"num_solped", "pos_solped"}
        oGrf = New Telerik.Web.UI.GridRelationFields()
        oGrf.MasterKeyField = "num_solped"
        oGrf.DetailKeyField = "num_solped"
        oVw.ParentTableRelation.Add(oGrf)
        oVw.Name = oDts.Tables("SolpedPosicion").TableName
        oVw.Columns.Clear()
        oVw.AutoGenerateColumns = False
        Me.grdSolpedPos.MasterTableView.DetailTables.Add(oVw)
        For cont = 0 To 6
            oDgr = New Telerik.Web.UI.GridBoundColumn()
            Select Case cont
                Case 0
                    oDgr.DataField = "num_solped"
                    oDgr.HeaderText = "Solped"
                    oDgr.DataType = GetType(Long)
                    oDgr.ReadOnly = True
                    oDgr.Visible = False
                Case 1
                    oDgr.DataField = "pos_solped"
                    oDgr.HeaderText = "Posicion"
                    oDgr.DataType = GetType(Integer)
                    oDgr.ReadOnly = True
                Case 2
                    oDgr.DataField = "pedido"
                    oDgr.HeaderText = "pedido"
                    oDgr.DataType = GetType(Double)
                    oDgr.ReadOnly = True
                Case 3
                    oDgr.DataField = "creado"
                    oDgr.HeaderText = "Creado por"
                    oDgr.DataType = GetType(String)
                    oDgr.ReadOnly = True
                    oDgr.Visible = False
                Case 4
                    oDgr.DataField = "descripcion_breve"
                    oDgr.HeaderText = "Descripcion"
                    oDgr.DataType = GetType(String)
                    oDgr.ReadOnly = True
                Case 5
                    oDgr.DataField = "cantidad"
                    oDgr.HeaderText = "Cantidad"
                    oDgr.DataType = GetType(Double)
                    oDgr.ReadOnly = True
                Case 6
                    oDgr.DataField = "fechaSolicitud"
                    oDgr.HeaderText = "Solicitado"
                    oDgr.DataType = GetType(DateTime)
                    oDgr.ReadOnly = True
                    oDgr.Visible = False
            End Select
            Me.grdSolpedPos.MasterTableView.DetailTables(0).Columns.Add(oDgr)
        Next
        '********************* Adicion de CheckBoxes ***********************
        Me.oColChk = New grdChkTemplate()
        oCTmp = New Telerik.Web.UI.GridTemplateColumn()
        oCTmp.ItemTemplate = Me.oColChk
        oCTmp.HeaderText = ""
        oCTmp.UniqueName = "Chk"
        oCTmp.ReadOnly = False
        Me.grdSolpedPos.MasterTableView.DetailTables(0).Columns.AddAt(0, oCTmp)
        '*******************************************************************
        '************ Generar Toolbar *************
        Me.tbSol = New tbGridProceso()
        Me.grdSolpedPos.MasterTableView.CommandItemTemplate = Me.tbSol
    End Sub
 
    Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Me.realoadProc()
        If Not Page.IsPostBack Then
            Me.FillComponents()
            Me.cmbTipEvento.DataSource = oDts.Tables("TipoProceso")
            Me.cmbTipEvento.DataTextField = "descripcion"
            Me.cmbTipEvento.DataValueField = "cve_proceso"
            Me.cmbTipEvento.DataBind()
            Me.cmbResp.DataSource = oDts.Tables("Responsable")
            Me.cmbResp.DataTextField = "nombrecompleto"
            Me.cmbResp.DataValueField = "rpe"
            Me.cmbResp.DataBind()
            Me.cmbRazon.DataSource = oDts.Tables("RazonPrioridad")
            Me.cmbRazon.DataTextField = "descripcion"
            Me.cmbRazon.DataValueField = "cve_razonPrior"
            Me.cmbRazon.DataBind()
            Me.cmbEspecialidad.DataSource = oDts.Tables("Especialidad")
            Me.cmbEspecialidad.DataTextField = "nombre"
            Me.cmbEspecialidad.DataValueField = "abreviacion"
            Me.cmbEspecialidad.DataBind()
            Me.cmbSubProceso.DataSource = oDts.Tables("TipoSubProceso")
            Me.cmbSubProceso.DataTextField = "descripcion"
            Me.cmbSubProceso.DataValueField = "cve_subproceso"
            Me.cmbSubProceso.DataBind()
            Me.cmbRespEvento.DataSource = oDts.Tables("Responsable")
            Me.cmbRespEvento.DataTextField = "nombrecompleto"
            Me.cmbRespEvento.DataValueField = "rpe"
            Me.cmbRespEvento.DataBind()
        End If
        If RadAjaxManager1.AjaxSettings.Count = 0 Then
            Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.grdCalendario, Me.grdCalendario)
            Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.grdCalendario, Me.RadDock1)
            Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.grdCalendario, Me.cmbSubProceso)
            Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.grdCalendario, Me.cmbRespEvento)
            Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.grdCalendario, Me.dpFecIni)
            Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.grdCalendario, Me.dpFecFin)
            Me.RadAjaxManager1.AjaxSettings.AddAjaxSetting(Me.grdCalendario, Me.txtSPDesc)
        End If
    End Sub
 
    Protected Sub Grid_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles grdSolpedPos.ItemCommand, grdCalendario.ItemCommand
        Dim oStr As String() = {"", ""}
        Select Case e.CommandName
            Case "DelSolPos"
                oStr(0) = e.Item.Cells(3).Text
                oStr(1) = e.Item.Cells(4).Text
                Me.oProc.Posiciones.Remove(Me.oProc.Posiciones.GetElementByName(oStr))
                Me.grdSolpedPos.Rebind()
            Case "DelCal"
                oStr(0) = e.Item.Cells(4).Text
                oStr(1) = e.Item.Cells(3).Text
                Me.oProc.Calendario.Remove(Me.oProc.Calendario.GetElementByName(oStr))
                Me.grdCalendario.Rebind()
            Case "cmdGuardar"
                If Not IsNothing(oConn) Then
                    If IsNothing(Me.oProc) Then
                        Me.oProc = New abProceso(Me.oConn.Clone())
                    Else
                        Me.oProc.Conexion = Me.oConn.Clone()
                    End If
                    Me.oProc.importe = Me.txtImporte.Value
                    Me.oProc.concepto = Me.txtNomEvento.Text
                    Me.oProc.responsable = Me.cmbResp.SelectedValue
                    'Me.cmbRespEvento.SelectedValue = Me.cmbResp.SelectedValue
                    Me.oProc.moneda = "MXN"
                    Me.oProc.tipo = Me.cmbTipEvento.SelectedValue
                    Me.oProc.razonPrioridad = Me.cmbRazon.SelectedValue
                    Me.oProc.prioridad = Me.cmbPrioridad.SelectedValue
                    Me.oProc.especialidad = Me.cmbEspecialidad.SelectedValue
                    If Not IsNothing(Request.QueryString.GetValues("id")) Then
                        If Request.QueryString("id") = oProc.numero Then
                            Me.oProc.UpdateData()
                        Else
                            Me.oProc.insertData()
                        End If
                    Else
                        Me.oProc.insertData()
                    End If
                    saveChkViewStateData()
                    oLSer = New LosFormatter()
                    Dim oSw As New StringWriter()
                    oLSer.Serialize(oSw, Me.oProc)
                    ViewState("prc" & Session("guid")) = oSw.ToString()
                    If oTabMan.Tabs(1).Enabled = False Then
                        oTabMan.Tabs(1).Enabled = True
                    End If
                    grdSolpedPos.Rebind()
                End If
            Case "cmdReset"
                'If Not IsNothing() Then
                grdSolpedPos.Rebind()
                'End If
            Case "cmdNew"
                Me.hdnAction.Value = "n"
                CargarEvento()
                ScriptManager.RegisterStartupScript(Page, [GetType](), "openForm", "Sys.Application.add_load(openForm);", True)
            Case "cmdEdit"
                Me.hdnAction.Value = "e"
                CargarEvento()
                ScriptManager.RegisterStartupScript(Page, [GetType](), "openForm", "Sys.Application.add_load(openForm);", True)
            Case "cmdDelete"
                Me.hdnAction.Value = "d"
                RadAjaxManager1.ResponseScripts.Add("confirm('hola','¿Desea realmente eliminar este evento?');")
                'RadAjaxManager1.Alert("hola")
                'ScriptManager.RegisterStartupScript(Page, [GetType](), "radalert", "window.radalert('Welcome to Rad<b>window</b>!', 330, 210);", True)
        End Select
    End Sub
 
    Protected Sub grdCalendario_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles grdCalendario.NeedDataSource
        Dim oVw As DataView
        If IsNothing(oProc) Then
            Me.grdCalendario.DataSource = Nothing
        Else
            adquisiciones.Catalogos.getProcesoCalendario(oConn, oDts)
            oVw = New DataView(oDts.Tables("ProcesoCalendario"), "num_proceso='" & Me.oProc.numero & "'", "", DataViewRowState.OriginalRows)
            Me.grdCalendario.DataSource = oVw
        End If
    End Sub
 
    Protected Sub realoadProc()
        Dim oSr As StringReader
        Dim oLser As New LosFormatter()
        If IsNothing(Me.oProc) Then
            If Not IsNothing(ViewState("prc" & Session("guid"))) Then
                oSr = New StringReader(ViewState("prc" & Session("guid")))
                Me.oProc = oLser.Deserialize(oSr)
                Me.oProc.Conexion = oConn
            Else
                If Not IsNothing(Request.QueryString.Item("id")) Then
                    oProc = New abProceso(oConn, CInt(Request.QueryString("id")))
                    Me.oTabMan.Tabs(1).Enabled = True
                End If
            End If
        End If
    End Sub
 
    Protected Sub grdSolpedPos_CheckChanged(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim box As CheckBox = CType(sender, CheckBox)
        Dim item As Telerik.Web.UI.GridDataItem = CType(box.NamingContainer, Telerik.Web.UI.GridDataItem)
        Dim sID As String = ""
        Dim i As Integer
        Dim oSol As adquisiciones.abSolped
        Dim target As Hashtable = Nothing
 
        If (item.OwnerTableView.Name = "Solped") Then
            target = ChkSolped()
            sID = item.GetDataKeyValue("num_solped").ToString()
        Else
            target = ChkSolpedPos()
            sID = item.GetDataKeyValue("num_solped").ToString() & "_" & item.GetDataKeyValue("pos_solped").ToString()
        End If
 
        If box.Checked Then
            target(sID) = True
        Else
            target(sID) = Nothing
        End If
        ' **************** ASIGNACION DE CHECK A DESCENDIENTES ***********************
        If item.OwnerTableView.Name = "Solped" And box.Checked Then
            oSol = New adquisiciones.abSolped(Me.oConn, sID)
            target = ChkSolpedPos()
            If oSol.posiciones.Count > 0 Then
                For i = 0 To oSol.posiciones.Count - 1
                    If oSol.posiciones(i).NumeroPedido = 0 Then
                        target(oSol.Clave & "_" & oSol.posiciones(i).PosicionSolped.ToString()) = True
                    End If
                Next
                'Me.grdSolpedPos
            End If
        End If
 
        'If item.OwnerTableView.Name = "SolpedPosicion" Then
        '    oSol = New adquisiciones.abSolped(Me.oConn, sID)
        '    target = ChkSolpedPos()
        '    If oSol.posiciones.Count > 0 Then
        '        For i = 0 To oSol.posiciones.Count - 1
        '            If oSol.posiciones(i).NumeroPedido = 0 Then
        '                target(oSol.Clave & "_" & oSol.posiciones(i).PosicionSolped.ToString()) = True
        '            End If
        '        Next
        '    End If
        'End If
 
    End Sub
 
    Private Sub grdSolpedPos_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles grdSolpedPos.ItemDataBound
        If TypeOf e.Item Is Telerik.Web.UI.GridDataItem Then
            Dim item As Telerik.Web.UI.GridDataItem = CType(e.Item, Telerik.Web.UI.GridDataItem)
            Dim box As CheckBox = CType(item.FindControl("oChk"), CheckBox)
            Dim isChecked As Object = Nothing
 
            Select Case item.OwnerTableView.Name
                Case "Solped"
                    isChecked = ChkSolped(item.GetDataKeyValue("num_solped").ToString())
                Case "SolpedPosicion"
                    isChecked = ChkSolpedPos(item.GetDataKeyValue("num_solped").ToString() & "_" & item.GetDataKeyValue("pos_solped").ToString())
            End Select
            If Not (isChecked Is Nothing) Then
                box.Checked = CType(isChecked, Boolean)
            End If
        End If
    End Sub
 
    Private Sub oGrid_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles grdSolpedPos.ItemCreated, grdCalendario.ItemCreated
        If e.Item.ItemType = Telerik.Web.UI.GridItemType.Item Or e.Item.ItemType = Telerik.Web.UI.GridItemType.AlternatingItem Then
            Select Case sender.ID
                Case "grdSolpedPos"
                    Dim oChk As CheckBox = CType(e.Item.FindControl("oChk"), CheckBox)
                    If Not IsNothing(oChk) Then
                        AddHandler oChk.CheckedChanged, AddressOf Me.grdSolpedPos_CheckChanged
                    End If
                Case "grdCalendario"
                    Dim oRad As RadioButton = CType(e.Item.FindControl("oRad"), RadioButton)
                    If Not IsNothing(oRad) Then
                        oRad.Attributes.Add("OnClick", "SelectMeOnly(" & oRad.ClientID & ", " & "'grdCalendario'" & ")")
                        AddHandler oRad.CheckedChanged, AddressOf Me.grdCalendario_CheckChanged
                    End If
            End Select
        End If
    End Sub
 
    Private Sub restoreChkViewStateData()
        Dim oSolP As abSolpedPosicion
        If Not IsNothing(Me.oProc) Then
            For Each oSolP In Me.oProc.Posiciones
                ChkSolpedPos(oSolP.NumeroSolped.ToString() & "_" & oSolP.PosicionSolped.ToString()) = True
                ' TODO: Implementar deteccion de check en todos cuando los todos elementos del detalle esten en true
            Next
        End If
    End Sub
 
    Private Sub saveChkViewStateData()
        Dim oSolP As abSolpedPosicion
        Dim oEle As DictionaryEntry
        Dim aId() As String
        If Not IsNothing(Me.oProc) Then
            For Each oEle In ChkSolpedPos
                If oEle.Value = True Then
                    aId = oEle.Key.ToString.Split("_")
                    oSolP = New abSolpedPosicion(Me.oConn, aId(0), aId(1))
                    Me.oProc.Posiciones.Add(oSolP)
                End If
            Next
        End If
    End Sub
 
    Protected Sub SubmitButton_Click(ByVal sender As Object, ByVal e As EventArgs) Handles cbtnGuardar.Click
        Dim sID As String = ""
        Dim sAct As String = ""
        Dim aStr() As String
        Dim oEve As abEvento
        sID = Me.hdnIds.Value
        sAct = Me.hdnAction.Value
        Select Case sender.ID
            Case "cbtnGuardar"
                If sAct = "n" Then
                    If sID.Length > 0 Then
                        aStr = sID.Split("_")
                        If aStr.Count = 2 Then
                            oEve = New abEvento(oConn.Clone(), aStr(0), aStr(1))
                        Else
                            Exit Sub
                        End If
                    Else
                        Exit Sub
                    End If
                Else
                    oEve = New abEvento(oConn.Clone(), Me.cmbSubProceso.SelectedValue.ToString())
                End If
                oEve.Titulo = Me.txtNomEvento.Text
                oEve.Descripcion = Me.txtSPDesc.Text
                oEve.FechaProgramadoInicial = Me.dpFecIni.SelectedDate
                oEve.FechaProgramadoFinal = Me.dpFecFin.SelectedDate
                If Me.cmbResp.SelectedValue <> Me.cmbRespEvento.SelectedValue Then
                    oEve.Responsable = Me.cmbRespEvento.SelectedValue
                End If
                If Me.oProc.Calendario.Add(oEve) Then
                    Me.txtSPDesc.Text = ""
                    Me.cmbTipEvento.SelectedIndex = 0
                    Me.dpFecIni.SelectedDate = DateTime.Today
                    Me.dpFecFin.SelectedDate = DateTime.Today
                End If
                'Me.grdCalendario.Rebind()
        End Select
    End Sub
 
    Private Sub CargarEvento()
 
        Dim sSprc As String = ""
        Dim sAct As String = ""
        Dim aStr() As String
        Dim oEve As abEvento
 
        sSprc = Me.hdnIds.Value
        sAct = Me.hdnAction.Value
 
        If sAct = "e" And sSprc.Length > 0 Then
            aStr = sSprc.Split("_")
            If aStr.Length > 1 Then
                oEve = New abEvento(oConn, aStr(0), aStr(1))
                Me.RadDock1.Title = "Editar " & oEve.Descripcion
                Me.txtSPDesc.Text = oEve.Descripcion
                Me.dpFecIni.SelectedDate = oEve.FechaProgramadoInicial
                Me.dpFecFin.SelectedDate = oEve.FechaProgramadoFinal
                Me.cmbRespEvento.SelectedValue = oEve.Responsable
            End If
        Else
            Me.RadDock1.Title = "Nuevo Evento"
            Me.txtSPDesc.Text = ""
            Me.dpFecIni.SelectedDate = DateTime.Today()
            Me.dpFecFin.SelectedDate = DateTime.Today()
            Me.cmbRespEvento.SelectedValue = Me.cmbResp.SelectedValue
        End If
    End Sub
End Class

ASPX:
<%@ Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/Templates/1Col.Master"
    CodeBehind="Proceso.aspx.vb" Inherits="adquisicioneNET.Proceso" %>
 
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <link type="text/css" rel="Stylesheet" href="../Templates/dialogo.css" />
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cuerpo" runat="server">
    <telerik:RadScriptBlock runat="server" ID="RadScriptBlock2">
        <script type="text/javascript">
            function SelectMeOnly(objRadioButton, grdName) {
                var i, obj, pageElements;
                if (navigator.userAgent.indexOf("MSIE") != -1) {
                    pageElements = document.all; //IE browser
                }
                else if (navigator.userAgent.indexOf("Mozilla") != -1 || navigator.userAgent.indexOf("Opera") != -1) {
                    pageElements = document.documentElement.getElementsByTagName("input"); //FireFox/Opera browser
                }
                for (i = 0; i < pageElements.length; i++) {
                    obj = pageElements[i];
                    if (obj.type == "radio") {
                        if (objRadioButton.id.indexOf(grdName, 0) >= 0) {
                            if (objRadioButton.id == obj.id) {
                                obj.checked = true;
                            }
                            else {
                                obj.checked = false;
                            }
                        }
                    }
                }
            }
            function openForm() {
                var dock = $find("<%= RadDock1.ClientID %>");
                // Center the RadDock on the screen
                var viewPort = $telerik.getViewPortSize();
                var xPos = Math.round((viewPort.width - parseInt(dock.get_width())) / 2);
                var yPos = Math.round((viewPort.height ) / 2);//- parseInt(dock.get_height())
                $telerik.setLocation(dock.get_element(), { x: xPos, y: yPos });
                dock.set_closed(false);
                var descriptionTextBox = $get('<%= txtSPDesc.ClientID %>');
                descriptionTextBox.focus();
                Sys.Application.remove_load(openForm);
            }
 
            function hideForm() {
                var dock = $find("<%= RadDock1.ClientID %>");
                Sys.Application.remove_load(openForm);
                dock.set_closed(true);
                return true;
            }
 
            function dockMoved(sender, args) {
                //Return RadDock to his original HTML parent so it gets updated via ajax
                $get("<%= panDlgData.ClientID %>").appendChild(sender.get_element());
            }
        </script>
    </telerik:RadScriptBlock>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"></telerik:RadAjaxManager>
    <asp:UpdatePanel runat="server" ID="UpdPan1">
        <ContentTemplate>
            <table>
                <tr>
                    <td>
                        Nombre del proceso:
                    </td>
                    <td>
                        <asp:TextBox ID="txtNomEvento" runat="server" Width="232px"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Tipo de proceso:
                    </td>
                    <td>
                        <telerik:RadComboBox ID="cmbTipEvento" runat="server" Width="235px" AutoPostBack="True">
                        </telerik:RadComboBox>
                    </td>
                </tr>
                <tr>
                    <td class="style1">
                        Responsable:
                    </td>
                    <td class="style1">
                        <telerik:RadComboBox ID="cmbResp" runat="server" Width="235px" AutoPostBack="True">
                        </telerik:RadComboBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Importe:
                    </td>
                    <td>
                        <telerik:RadNumericTextBox ID="txtImporte" runat="server" Culture="Spanish (Mexico)"
                            Type="Currency" Width="232px">
                        </telerik:RadNumericTextBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Prioridad:
                    </td>
                    <td>
                        <telerik:RadComboBox ID="cmbPrioridad" runat="server" Width="50px">
                            <Items>
                                <telerik:RadComboBoxItem runat="server" Text="A" Value="A" />
                                <telerik:RadComboBoxItem runat="server" Text="B" Value="B" />
                                <telerik:RadComboBoxItem runat="server" Selected="True" Text="C" Value="C" />
                            </Items>
                        </telerik:RadComboBox>
                        <telerik:RadComboBox ID="cmbRazon" runat="server" Width="187px">
                        </telerik:RadComboBox>
                    </td>
                </tr>
                <tr>
                    <td>
                        Especialidad:
                    </td>
                    <td>
                        <telerik:RadComboBox ID="cmbEspecialidad" runat="server" Width="235px">
                        </telerik:RadComboBox>
                    </td>
                </tr>
                <tr>
                    <td colspan="2">
                        <asp:HiddenField ID="hdnAction" runat="server" />
                        <asp:HiddenField ID="hdnIds" runat="server" />
                        <telerik:RadFormDecorator ID="RadFormDecorator1" runat="server" DecoratedControls="Default, Textbox, Textarea, Fieldset, Label, Select"
                            Skin="WebBlue" />
                        <div class="r2k_err">
                            <input id="Hidden1" type="hidden" />
                            <div class="r2k_iicon">
                                <asp:Image ID="Image2" runat="server" ImageUrl="~/imgs/icons/dialog-error.png"></asp:Image></div>
                            <div class="r2k_imsg">
                                Prueba de Validaciones
                            </div>
                        </div>
                        <div class="r2k_warn">
                            <div class="r2k_iicon">
                                <asp:Image ID="Image1" runat="server" ImageUrl="~/imgs/icons/dialog-warning.png">
                                </asp:Image></div>
                            <div class="r2k_imsg">
                                La pestaña de eventos se mantendra deshabilitada hasta que Ud. agregue cuando menos
                                una solped en el proceso
                            </div>
                        </div>
                        <telerik:RadTabStrip ID="oTabMan" runat="server" MultiPageID="RadMultiPage2" SelectedIndex="0">
                            <Tabs>
                                <telerik:RadTab runat="server" Text="Solpeds y Posiciones" PageViewID="pagSolPos"
                                    Selected="True">
                                </telerik:RadTab>
                                <telerik:RadTab runat="server" Text="Eventos" PageViewID="pagEventos" Enabled="False">
                                </telerik:RadTab>
                            </Tabs>
                        </telerik:RadTabStrip>
                        <telerik:RadMultiPage ID="RadMultiPage2" runat="server" BorderColor="Black" BorderStyle="Solid"
                            BorderWidth="1px" SelectedIndex="0">
                            <telerik:RadPageView ID="pagSolPos" runat="server">
                                <contenttemplate>
                                        <asp:PlaceHolder ID="phGrdSolPos" runat="server"></asp:PlaceHolder>
                                        </contenttemplate>
                            </telerik:RadPageView>
                            <telerik:RadPageView ID="pagEventos" runat="server">
                                <contenttemplate>
                                        <asp:PlaceHolder ID="phGrdCal" runat="server"></asp:PlaceHolder>
                                    </contenttemplate>
                                
                            </telerik:RadPageView>
                             
                        </telerik:RadMultiPage>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel>
    <telerik:RadAjaxPanel ID="panDlgData" runat="server" width="400px">
        <telerik:RadDock ID="RadDock1" runat="server" Width="400px" Closed="True" style="z-index:2410;">
            <ContentTemplate>
                    <div class="editForm">
        <table>
            <tr>
                <td>
                    Responsable:
                </td>
                <td>
                    <telerik:RadComboBox ID="cmbRespEvento" runat="server" AutoPostBack="True" Width="235px">
                    </telerik:RadComboBox>
                </td>
            </tr>
            <tr>
                <td>
                    Tipo Evento:
                </td>
                <td>
                    <telerik:RadComboBox ID="cmbSubProceso" runat="server" AutoPostBack="True">
                    </telerik:RadComboBox>
                </td>
            </tr>
            <tr>
                <td>
                    Incio:
                </td>
                <td>
                    <telerik:RadDateTimePicker ID="dpFecIni" runat="server" Culture="Spanish (Mexico)">
                        <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x">
                        </Calendar>
                        <TimeView CellSpacing="-1" Culture="Spanish (Mexico)" HeaderText="Seleccione la hora">
                        </TimeView>
                        <TimePopupButton HoverImageUrl="" ImageUrl="" />
                        <DatePopupButton HoverImageUrl="" ImageUrl="" />
                        <DateInput DateFormat="dd/MM/yyyy" DisplayDateFormat="dd/MM/yyyy">
                        </DateInput>
                    </telerik:RadDateTimePicker>
                </td>
            </tr>
            <tr>
                <td>
                    Fin:
                </td>
                <td>
                    <telerik:RadDateTimePicker ID="dpFecFin" runat="server" Culture="Spanish (Mexico)">
                        <Calendar UseColumnHeadersAsSelectors="False" UseRowHeadersAsSelectors="False" ViewSelectorText="x">
                        </Calendar>
                        <TimeView CellSpacing="-1" Culture="Spanish (Mexico)" HeaderText="Seleccione la hora">
                        </TimeView>
                        <TimePopupButton HoverImageUrl="" ImageUrl="" />
                        <DatePopupButton HoverImageUrl="" ImageUrl="" />
                        <DateInput DateFormat="dd/MM/yyyy" DisplayDateFormat="dd/MM/yyyy">
                        </DateInput>
                    </telerik:RadDateTimePicker>
                </td>
            </tr>
            <tr>
                <td>
                    Descripcion:
                </td>
                <td>
                    <telerik:RadTextBox ID="txtSPDesc" runat="server" Width="300px">
                    </telerik:RadTextBox>
                </td>
            </tr>
        </table>
    </div>
    <div class="footer">
        <asp:Button runat="server" ID="cbtnGuardar" Text="Guardar" OnClick="SubmitButton_Click"
            OnClientClick="return hideForm()" />
        <button onclick="javascript:hideForm();" type="button">
            Cancelar</button>
    </div>
            </ContentTemplate>
        </telerik:RadDock>
    </telerik:RadAjaxPanel>
</asp:Content>

a bit complex ;)
Rafaga2k
Top achievements
Rank 1
 answered on 14 Dec 2010
1 answer
134 views
I have two issues with a RadNumericTextbox and a JS error in a RadWindow.

RadNumericTextBox:

<

 

telerik:RadNumericTextBox ID="radtxtConsolePrice" MinValue="0" MaxLength="7" NumberFormat-DecimalDigits="2" NumberFormat-AllowRounding="false" NumberFormat-DecimalSeparator="." NumberFormat-KeepTrailingZerosOnFocus="true" runat="server" TabIndex="1" Width="200px" />

 

In Page_Command:

fgs.ConsolePrice =

Decimal.Round(Utils.ToDecimal(radtxtConsolePrice.Text), 2);

 

This is returning ZERO no matter what value I enter into the box. It is the only input control in the form.

After reading the NumericTextBox and saving the value, I am trying to close the window and rebind my grid on the opener.

ClientScript.RegisterStartupScript(Page.GetType(),

"mykey", "CloseAndRebind();", true);

 

function

 

CloseAndRebind(args) {

 

GetRadWindow().BrowserWindow.refreshGrid(args);

GetRadWindow().close();

}

On Opener:

function

 

refreshGrid(arg){

 

 

if(!arg)

 

{

$find(

"<%= RadAjaxManager1.ClientID %>").ajaxRequest("Rebind");

 

}

 

else

 

{

$find(

"<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");

 

}

}


Error:   htmlfile: Unexpected call to method or property access.

The bold line below is where it breaks.

case

 

Telerik.Web.UI.SelectionOnFocus.SelectAll:this.selectAllText();

 

break

 

;

 

default

 

:this.set_caretPosition(0);

 

break

 

;

 

}},_isInVisibleContainer:

function(a){var b=a;

 

while

 

((typeof(b)!="undefined")&&(b!=null)){if(b.disabled||(typeof(b.style)!="undefined"&&((typeof(b.style.display)!="undefined"&&b.style.display=="none")||(typeof(b.style.visibility)!="undefined"&&b.style.visibility=="hidden")))){return false;

 

}

if(typeof(b.parentNode)!="undefined"&&b.parentNode!=null&&b.parentNode!=b&&b.parentNode.tagName.toLowerCase()!="body"){b=b.parentNode;

 

}

else{return true;

 

}}

return true;

 

},_applySelection:

function(){if(!this._isInVisibleContainer(this._textBoxElement)){return;

 

}

var a=this;

 

if

 

((Sys.Browser.agent==Sys.Browser.Opera)||!document.selection){this._textBoxElement.selectionStart=a._selectionStart;

 

this

 

._textBoxElement.selectionEnd=a._selectionEnd;

 

return

 

;

 

}

this._textBoxElement.select();

 

sel=document.selection.createRange();

sel.collapse();

sel.moveStart(

"character",this._selectionStart);

 

sel.collapse();

sel.moveEnd(

"character",this._selectionEnd-this._selectionStart);

 

sel.select();

},_clearHiddenValue:

function(){this._hiddenElement.value="";

 

this

 

._setValidationField("");

 

},_handleWheel:

function(a){},_setHiddenValue:function(a){if(a==null){a="";

 

}

if(this._hiddenElement.value!=a.toString()){this._hiddenElement.value=a;

 

}

this._setValidationField(a);

 

return

 

true;

Here is the HTML TEXT from the sel:

"<DIV
style="Z-INDEX: 9504; POSITION: absolute; WIDTH: 350px; DISPLAY: none; HEIGHT: 250px; VISIBILITY: hidden; TOP: 279px; LEFT: 409px"
id=RadWindowWrapper_ctl00_radwinConsolePrice
class="RadWindow RadWindow_Default rwNormalWindow rwTransparentWindow"
unselectable="on">
<TABLE style="HEIGHT: 211px" class=rwTable cellSpacing=0 cellPadding=0>
<TBODY>
<TR class=rwTitleRow>
<TD class="rwCorner rwTopLeft">&nbsp;</TD>
<TD style="CURSOR: move" class=rwTitlebar>
<DIV class=rwTopResize></DIV></TD></TR></TBODY></TABLE></DIV>"

not sure if it is relevant but it seems to be doing a select, and this text has unselectable="on"  ?? 

 

Jeff Reinhardt
Top achievements
Rank 1
 answered on 14 Dec 2010
6 answers
182 views
Hello,
I am trying to set the value in the RAD Combo Box. My situation is: I have one Page from which I popup other page..And before I close the popup, I set the value of the Combobox in the Parent Page using Javascript Function.
I know I can set the Combobox value if I access it like, 
var combo = $find("<%= RadComboBox1.ClientID %>");   
in the javascript function.
But I can not access it like that bcz it is on another page..
I have only one option to access it through,

var

 

 

objstate = document.getElementById('maincontent_RadcomboBox');

 


So I can only access using its PageRendered name and not by the actual name...
The ASP DROPDOWN works fine if I access it like this.
Plz suggest any solution ASAP...

Thasnk,
Deepa
Deepa
Top achievements
Rank 1
 answered on 14 Dec 2010
2 answers
263 views
Hi all,
I am implementing custom radGrid column with datefrom, dateto and datebetween filtering. I derived my column from GridBoundColumn similar as described in article http://www.telerik.com/help/aspnet-ajax/grdimplementingfilteringfortemplatecolumns.html. My column uses two datepickers for filtering. I provide filtering in registered clientscript. CurrentFilterValue is set correct whenever SetCurrentFilterValueToControl is invoked. Only one problem is that I am not able to detect CurrentFilterFunction in overriden method. It becomes always value NoFilter. How can I detect CurrentFilterFunction?
-Thanks
protected override void SetCurrentFilterValueToControl(TableCell cell)
{
    base.SetCurrentFilterValueToControl(cell);
    if (!string.IsNullOrWhiteSpace(this.CurrentFilterValue))
    {
        // this.CurrentFilterFuncion always returns NoFilter
        switch (this.CurrentFilterFuncion)
            case GridKnownFunction.Between:
               // ...
            case GridKnownFunction.LessThanOrEqualTo:
               // ...
            case GridKnownFunction.GreatherThanOrEqualTo:
               // ...
    }
}
Marian
Top achievements
Rank 1
 answered on 14 Dec 2010
2 answers
80 views
Developers,

I am new to this, and I need to identify (locate)  the file that is used to display the alert icon (exclamation sign) that appears after a user has entered an invalid date.  I need to replace that file with another picture.  Please see the attachment.

Thanks for your help.

EDP
Eduardo Dulanto
Top achievements
Rank 1
 answered on 14 Dec 2010
13 answers
498 views

Greetings.

I'd like to have some custom templates for my template column in addition to ItemTemplate, EditTemplate, etc.

So i inherited from GridTemplateColumn and addted ITemplate properties, for instance, ExportItemTemplate.

The question is HOW to use this in the code? For instance:

1.<MyGridTemplateColumn ...>
2.  <ExportItemTemplate>
3.    <asp:Label ID="Name" runat="server" />
4.  </ExportItemTemplate>
5.  <ItemTemplate>
6.    <asp:Label ID="Name" runat="server" />
7.  </ItemTemplate>
8.</MyGridTemplateColumn>
1.In c#:
2.[access controls in ItemTemplate only] 
3.[access controls in ExportItemTemplate only]

And by the way! I want to use this templates in client-side binding!

Bruno
Top achievements
Rank 2
 answered on 14 Dec 2010
3 answers
108 views
Hello,
   We recently moved our web site to a new host, and have lost the ability for RadCharts to show custom colors on the series displays.  I found a post about adding a custom palette which works for Bar / Line charts that use a MainColor and SecondColor.  But is there a way to do this for Complex Gradient Colors?  Seems to be a security/trust issue or something not letting me programmatically change the colors via VB or even take custom settings through the control properties, am always getting the default skin palette showing up.  (Does work when using "View in Browser") option on local development PC, however.)

VB and ASPX below.  Suggestions appreciated.

Regards,
Dave

 

 

Protected Sub SetupChart()

 

 

 

'RadChart1.Clear()

 

 

 

'Dim series0 As ChartSeries = New ChartSeries("Develop", ChartSeriesType.StackedBar)

 

 

 

'Dim series1 As ChartSeries = New ChartSeries("Work", ChartSeriesType.StackedBar)

 

 

 

'Dim series2 As ChartSeries = New ChartSeries("Retirement", ChartSeriesType.StackedBar)

 

 

 

'Dim series3 As ChartSeries = New ChartSeries("Years", ChartSeriesType.StackedBar)

 

 

 

''

 

 

 

'' Note: series 3 is not displayed, it is just used to set the "years" range on the

 

 

 

'' secondary axis display.

 

 

 

''

 

 

 

'RadChart1.SeriesOrientation = ChartSeriesOrientation.Horizontal

 

 

 

'RadChart1.Series.Add(series0)

 

 

 

'RadChart1.Series.Add(series1)

 

 

 

'RadChart1.Series.Add(series2)

 

 

 

'RadChart1.Series.Add(series3)

 

RadChart1.Series(3).YAxisType =

 

ChartYAxisType.Secondary

 

RadChart1.Series(3).Appearance.LegendDisplayMode =

 

ChartSeriesLegendDisplayMode.Nothing

 

RadChart1.AutoLayout =

 

False

 

RadChart1.PlotArea.YAxis2.AutoScale =

 

False

 

RadChart1.Series(3).Visible =

 

False

 

 

 

With RadChart1.Series(0).Appearance

 

.LabelAppearance.Position.Auto =

 

True

 

.LabelAppearance.Position.AlignedPosition =

 

AlignedPositions.Center

 

.LabelAppearance.LabelLocation =

 

LabelLocation.InsidePlotArea

 

.TextAppearance.TextProperties.Font =

 

New Font("Verdana", 12, FontStyle.Bold)

 

.FillStyle.FillSettings.GradientMode =

 

GradientFillStyle.Circle

 

.FillStyle.FillType =

 

FillType.Gradient

 

.FillStyle.FillSettings.ComplexGradient.Add(

 

New GradientElement(Color.Red, 0))

 

.FillStyle.FillSettings.ComplexGradient.Add(

 

New GradientElement(Color.Orange, 0.5))

 

.FillStyle.FillSettings.ComplexGradient.Add(

 

New GradientElement(Color.Yellow, 1))

 

.TextAppearance.Position.AlignedPosition =

 

AlignedPositions.Center

 

 

 

' .Border.Color = Color.Black

 

.Corners.BottomLeft =

 

CornerType.Round

 

.Corners.BottomRight =

 

CornerType.Round

 

.Corners.TopLeft =

 

CornerType.Round

 

.Corners.TopRight =

 

CornerType.Round

 

.Corners.RoundSize = 10

 

 

End With

 

 

 

'With series0.Appearance

 

 

 

' .LabelAppearance.Position.Auto = True

 

 

 

' .LabelAppearance.Position.AlignedPosition = AlignedPositions.Center

 

 

 

' .LabelAppearance.LabelLocation = LabelLocation.InsidePlotArea

 

 

 

' .TextAppearance.TextProperties.Font = New Font("Verdana", 12, FontStyle.Bold)

 

 

 

' .FillStyle.FillSettings.GradientMode = GradientFillStyle.Circle

 

 

 

' .FillStyle.FillType = FillType.Gradient

 

 

 

' .FillStyle.FillSettings.ComplexGradient.Add(New GradientElement(Color.Red, 0))

 

 

 

' .FillStyle.FillSettings.ComplexGradient.Add(New GradientElement(Color.Orange, 0.5))

 

 

 

' .FillStyle.FillSettings.ComplexGradient.Add(New GradientElement(Color.Yellow, 1))

 

 

 

' .TextAppearance.Position.AlignedPosition = AlignedPositions.Center

 

 

 

' ' .Border.Color = Color.Black

 

 

 

' .Corners.BottomLeft = CornerType.Round

 

 

 

' .Corners.BottomRight = CornerType.Round

 

 

 

' .Corners.TopLeft = CornerType.Round

 

 

 

' .Corners.TopRight = CornerType.Round

 

 

 

' .Corners.RoundSize = 10

 

 

 

'End With

 

 

 

With RadChart1.Series(1).Appearance

 

.LabelAppearance.Position.Auto =

 

True

 

.LabelAppearance.Position.AlignedPosition =

 

AlignedPositions.Center

 

.LabelAppearance.LabelLocation =

 

LabelLocation.InsidePlotArea

 

.TextAppearance.TextProperties.Font =

 

New Font("Verdana", 12, FontStyle.Bold)

 

.FillStyle.FillSettings.GradientMode =

 

GradientFillStyle.Circle

 

.FillStyle.FillType =

 

FillType.Gradient

 

.FillStyle.FillSettings.ComplexGradient.Add(

 

New GradientElement(Color.Blue, 0))

 

.FillStyle.FillSettings.ComplexGradient.Add(

 

New GradientElement(Color.Azure, 0.5))

 

.FillStyle.FillSettings.ComplexGradient.Add(

 

New GradientElement(Color.LightBlue, 1))

 

.FillStyle.MainColor =

 

Color.Red

 

.FillStyle.SecondColor =

 

Color.White

 

.TextAppearance.Position.AlignedPosition =

 

AlignedPositions.Center

 

.Corners.BottomLeft =

 

CornerType.Round

 

.Corners.BottomRight =

 

CornerType.Round

 

.Corners.TopLeft =

 

CornerType.Round

 

.Corners.TopRight =

 

CornerType.Round

 

.Corners.RoundSize = 10

 

 

End With

 

 

 

With RadChart1.Series(2).Appearance

 

.LabelAppearance.Position.Auto =

 

True

 

.LabelAppearance.Position.AlignedPosition =

 

AlignedPositions.Center

 

.LabelAppearance.LabelLocation =

 

LabelLocation.InsidePlotArea

 

.TextAppearance.TextProperties.Font =

 

New Font("Verdana", 12, FontStyle.Bold)

 

.FillStyle.FillSettings.GradientMode =

 

GradientFillStyle.Circle

 

.FillStyle.FillType =

 

FillType.Gradient

 

.FillStyle.FillSettings.ComplexGradient.Add(

 

New GradientElement(Color.Green, 0))

 

.FillStyle.FillSettings.ComplexGradient.Add(

 

New GradientElement(Color.LightGreen, 0.5))

 

.FillStyle.FillSettings.ComplexGradient.Add(

 

New GradientElement(Color.Aquamarine, 1))

 

.FillStyle.MainColor =

 

Color.Red

 

.FillStyle.SecondColor =

 

Color.White

 

.TextAppearance.Position.AlignedPosition =

 

AlignedPositions.Center

 

.Corners.BottomLeft =

 

CornerType.Round

 

.Corners.BottomRight =

 

CornerType.Round

 

.Corners.TopLeft =

 

CornerType.Round

 

.Corners.TopRight =

 

CornerType.Round

 

.Corners.RoundSize = 10

 

 

End With

 

 

 

'With (RadChart1.Series(0).Appearance)

 

 

 

' .LabelAppearance.Position.AlignedPosition = Telerik.Charting.Styles.AlignedPositions.Top

 

 

 

' '.FillStyle.FillSettings.ComplexGradient(0).Color = System.Drawing.Color.Green

 

 

 

' '.FillStyle.FillSettings.ComplexGradient(2).Color = Drawing.Color.DarkGreen

 

 

 

'End With

 

 

 

' RadChart1.PlotArea.Appearance.Dimensions.Width = 400

 

 

 

' RadChart1.Visible = True

 

 

 

End Sub

<telerik:RadChart ID="RadChart1" runat="server"
   AlternateText="Loading..." DefaultType="StackedBar" Height="180px" SeriesOrientation="Horizontal"
   Skin="Desert" Width="500px">
  <Appearance>
    <Border Color="183, 181, 159" />
  </Appearance>
  <series>
    <telerik:ChartSeries Name="Developing" Type="StackedBar">
      <Appearance BarWidthPercent="50" Corners="Round, Round, Round, Round, 3">
        <FillStyle FillType="ComplexGradient" MainColor="Red" SecondColor="Orange">
          <FillSettings>
            <ComplexGradient>
              <telerik:GradientElement Color="Red" />
              <telerik:GradientElement Color="Orange" Position="0.5" />
              <telerik:GradientElement Color="Yellow" Position="1" />
            </ComplexGradient>
          </FillSettings>
        </FillStyle>
        <LabelAppearance LabelLocation="Inside" Position-AlignedPosition="Center">
        </LabelAppearance>
        <TextAppearance TextProperties-Color="108, 105, 87">
        </TextAppearance>
        <Border Color="187, 149, 58" />
      </Appearance>
    </telerik:ChartSeries>
    <telerik:ChartSeries Name="Work" Type="StackedBar">
      <Appearance Corners="Round, Round, Round, Round, 3">
        <FillStyle FillType="ComplexGradient" MainColor="Blue" SecondColor="LightBlue">
          <FillSettings>
            <ComplexGradient>
              <telerik:GradientElement Color="Blue" />
              <telerik:GradientElement Color="Azure" Position="0.5" />
              <telerik:GradientElement Color="LightBlue" Position="1" />
           </ComplexGradient>
         </FillSettings>
       </FillStyle>
       <LabelAppearance LabelLocation="Inside" Position-AlignedPosition="Center"
          Position-Auto="true">
       </LabelAppearance>
       <TextAppearance Position-AlignedPosition="Center"
          TextProperties-Color="108, 105, 87">
       </TextAppearance>
       <Border Color="129, 180, 193" />
     </Appearance>
   </telerik:ChartSeries>
   <telerik:ChartSeries Name="Retirement" Type="StackedBar">
     <Appearance Corners="Round, Round, Round, Round, 3">
       <FillStyle FillType="ComplexGradient">
         <FillSettings>
           <ComplexGradient>
             <telerik:GradientElement Color="Green" />
             <telerik:GradientElement Color="LightGreen" Position="0.5" />
             <telerik:GradientElement Color="Aquamarine" Position="1" />
           </ComplexGradient>
         </FillSettings>
       </FillStyle>
       <TextAppearance TextProperties-Color="108, 105, 87">
       </TextAppearance>
       <Border Color="123, 154, 69" />
     </Appearance>
   </telerik:ChartSeries>
   <telerik:ChartSeries Name="CalendarYears" Type="StackedBar" Visible="False"
      YAxisType="Secondary">
     <Appearance LegendDisplayMode="Nothing">
       <FillStyle FillType="ComplexGradient">
         <FillSettings>
           <ComplexGradient>
             <telerik:GradientElement Color="187, 174, 165" />
             <telerik:GradientElement Color="163, 146, 135" Position="0.5" />
             <telerik:GradientElement Color="134, 115, 103" Position="1" />
           </ComplexGradient>
         </FillSettings>
       </FillStyle>
       <TextAppearance TextProperties-Color="108, 105, 87"></TextAppearance>
       <Border Color="136, 119, 102" />
     </Appearance>
   </telerik:ChartSeries>
  </series>
  <Legend>
    <Appearance Dimensions-Margins="8px, 10px, 1px, 5px" Overflow="Auto"
       Position-AlignedPosition="TopRight">
      <ItemTextAppearance AutoTextWrap="False" TextProperties-Color="87, 84, 65">
      </ItemTextAppearance>
      <FillStyle MainColor="243, 243, 229"></FillStyle>
      <Border Color="208, 207, 195" />
    </Appearance>
  </Legend>
  <PlotArea>
    <XAxis MaxItemsCount="1">
      <Appearance Color="215, 214, 202" MajorTick-Color="226, 225, 207">
        <MajorGridLines Color="226, 225, 207" PenStyle="Solid" />
        <LabelAppearance Visible="False"></LabelAppearance>
        <TextAppearance TextProperties-Color="87, 84, 65"></TextAppearance>
      </Appearance>
      <AxisLabel>
        <Appearance RotationAngle="270"></Appearance>
        <TextBlock Text="" Visible="False">
          <Appearance TextProperties-Color="96, 93, 75"></Appearance>
        </TextBlock>
      </AxisLabel>
    </XAxis>
    <YAxis>
      <Appearance Color="212, 211, 199" MajorTick-Color="226, 225, 207"
         MinorTick-Color="226, 225, 207" MinorTick-Width="0">
         <MajorGridLines Color="226, 225, 207" PenStyle="Solid" />
         <MinorGridLines Color="226, 225, 207" PenStyle="Solid" Width="0" />
         <LabelAppearance Position-AlignedPosition="Top"></LabelAppearance>
         <TextAppearance Position-AlignedPosition="Top" TextProperties-Color="DarkGreen">
         </TextAppearance>
       </Appearance>
       <AxisLabel Visible="True">
          <Appearance Position-Auto="False" Position-X="220" Position-Y="155"
              RotationAngle="0" Visible="True">
          </Appearance>
          <TextBlock Text="Age (years)">
            <Appearance Position-AlignedPosition="Top" TextProperties-Color="DarkGreen"></Appearance>
          </TextBlock>
       </AxisLabel>
     </YAxis>
     <YAxis2 AutoScale="False" MaxValue="100" MinValue="0" Step="10" Visible="True">
       <Appearance MinorTick-MinorTickCount="4" ValueFormat="General">
          <TextAppearance TextProperties-Color="DarkBlue"></TextAppearance>
       </Appearance>
       <AxisLabel Visible="True">
         <Appearance Dimensions-Paddings="0px, 1px, 0px, 1px" RotationAngle="0"
            Visible="True" Position-Auto="False" Position-X="236" Position-Y="50">
         </Appearance>
         <TextBlock Text="Year">
           <Appearance TextProperties-Color="DarkBlue"></Appearance>
         </TextBlock>
       </AxisLabel>
     <Items>
       <telerik:ChartAxisItem></telerik:ChartAxisItem>
       <telerik:ChartAxisItem Value="10"></telerik:ChartAxisItem>
       <telerik:ChartAxisItem Value="20"></telerik:ChartAxisItem>
       <telerik:ChartAxisItem Value="30"></telerik:ChartAxisItem>
       <telerik:ChartAxisItem Value="40"></telerik:ChartAxisItem>
       <telerik:ChartAxisItem Value="50"></telerik:ChartAxisItem>
       <telerik:ChartAxisItem Value="60"></telerik:ChartAxisItem>
       <telerik:ChartAxisItem Value="70"></telerik:ChartAxisItem>
       <telerik:ChartAxisItem Value="80"></telerik:ChartAxisItem>
       <telerik:ChartAxisItem Value="90"></telerik:ChartAxisItem>
       <telerik:ChartAxisItem Value="100"></telerik:ChartAxisItem>
     </Items>
   </YAxis2>
   <Appearance Dimensions-AutoSize="False" Dimensions-Height="40px"
      Dimensions-Margins="2%, 7%, 2%, 5%" Dimensions-Width="440px"
      Position-AlignedPosition="Center" Position-Auto="False" Position-X="35"
      Position-Y="95">
     <FillStyle FillType="Solid" MainColor="243, 243, 229"></FillStyle>
     <Border Color="208, 207, 195" />
   </Appearance>
 </PlotArea>
 <ChartTitle>
   <Appearance Dimensions-Margins="4%, 0px, 0px, 8%"></Appearance>
   <TextBlock Text="Time in Phase">
      <Appearance TextProperties-Color="DarkRed" TextProperties-Font="Verdana, 12pt, style=Bold">
       </Appearance>
  </TextBlock>
 </ChartTitle>
</telerik:RadChart>

 

Velin
Telerik team
 answered on 14 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?