Geeks With Blogs


Rodney Vinyard - .NET & SQL Developer When all is said and done, more will be said than done



    Private Sub dgList_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles dgList.ItemDataBound

        If e.Item.ItemType.ToString() = "Header" Then


            ' rename DataGrid Columns


            Dim i As Integer

            Dim objDataViewerAPI = New DataViewerAPI

            For i = 0 To e.Item.Cells.Count - 1

                Dim ColumnNameRaw As String = e.Item.Cells(i).Text

                Dim ColumnNamePretty As String = objDataViewerAPI.GetPrettyName(ColumnNameRaw)

                e.Item.Cells(i).Text = ColumnNamePretty



        End If

    End Sub

Posted on Wednesday, April 11, 2007 1:53 PM GridView, Datagrid, DataList & Repeater | Back to top

Comments on this post: Change Datagrid Header At RunTime

No comments posted yet.
Your comment:
 (will show your gravatar)

Copyright © Rodney Vinyard | Powered by: