changing grid header text

3 posts, 0 answers
  1. Webster Velasco
    Webster Velasco avatar
    114 posts
    Member since:
    Jun 2012

    Posted 04 Dec 2009 Link to this post

    hi.

    i want to know if there is any methods to change my default header text value during my itemcreated events?.

    regards
    webster
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 04 Dec 2009 Link to this post

    Hello Webster,

    Check out the following link which explains on how to customize your grid header. This should probably help you:

    Thanks
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Webster Velasco
    Webster Velasco avatar
    114 posts
    Member since:
    Jun 2012

    Posted 04 Dec 2009 Link to this post

    thanks.. your suggestion has solved one of my problem..

    i have a second problem where my radgrid is inside a <asp:content> controls..
    this asp contend is related on my cotentplaceholder..

    now i want to change the header using a method like this

        Public Function ImpostaCampiZoom(ByRef Pagina As Page, ByVal NomePagina As String) As String 
     
            ' imposta label del campi della pagina 
            TestoMessaggio = "" 
            ImpostaCampiZoom = "" 
     
            Dim c As Control 
            Dim childc As Control 
            Dim colGrid As String 
            Dim colHeader As Telerik.Web.UI.GridColumn 
     
            ApriConnessioni() 
            ReDim param(0 To 1) 
            ReDim paramVal(0 To 1) 
            param(0) = "CODICELINGUA" 
            param(1) = "NOMEPAGINA" 
            paramVal(0) = UTE_Lingua 
            paramVal(1) = NomePagina 
     
            EseguiStored("Pagina_Lingua", param, paramVal, kDataReader) 
     
            'ChiudiConnessioni() 
     
            If TestoMessaggio.Length > 0 Then 
                ImpostaCampiZoom = TestoMessaggio 
                ChiudiConnessioni() 
                Exit Function 
            End If 
     
            Try 
                With DR 
                    Do Until .Read = False 
                        Pagina.Title = Nz(.GetValue(.GetOrdinal("TITOLOPAGINA")), "") 
                        colGrid = Nz(.GetValue(.GetOrdinal("CODICECAMPO")), "") 
                        For Each c In Pagina.Controls 
                            For Each childc In c.Controls 
                                If TypeOf childc Is Label Then 
                                    If CType(childc, Label).ID = colGrid Then 
                                        CType(childc, Label).Text = Nz(.GetValue(.GetOrdinal("LABELCAMPO")), "") 
                                        CType(childc, Label).ToolTip = Nz(.GetValue(.GetOrdinal("HELPCAMPO")), "") 
                                    Else 
                                        If CType(childc, Label).ID = "lblTitoloElenco" Then 
                                            CType(childc, Label).Text = Nz(.GetValue(.GetOrdinal("TITOLOPAGINA")), "") 
                                        End If 
                                    End If 
                                ElseIf TypeOf childc Is Telerik.Web.UI.RadGrid Then 
                                    colHeader = CType(childc, Telerik.Web.UI.RadGrid).MasterTableView.Columns.FindByUniqueName(colGrid) 
                                    colHeader.HeaderText = Nz(.GetValue(.GetOrdinal("LABELCAMPO")), "") 
                                ElseIf TypeOf childc Is HtmlInputHidden Then 
                                    If CType(childc, HtmlInputHidden).ID = "lblHelpPagina" Then 
                                        CType(childc, HtmlInputHidden).Value = Nz(.GetValue(.GetOrdinal("HELPPAGINA")), "") 
                                    End If 
                                End If 
                            Next 
                        Next 
                    Loop 
                End With 
                ChiudiConnessioni() 
     
            Catch _err As Exception 
                TestoMessaggio = "Errore etichette / Errors label - " + _err.Source + "->" + _err.Message 
            End Try 
     
        End Function 
     

    function call:
    ImpostaCampiZoom(Page, "Zoom") 




Back to Top