asp.netteleriktelerik-gridaspx-user-control

How to customize Telerik Header Context Menu?


I want to customize the Telerik Header Context Menu by adding additional button to it and I want to change labels of existing buttons. How can I do it? I know that I can set custom CSS class, but this is not I'm looking for.

enter image description here


Solution

  • You can try something like that:

    Protected Overloads Overrides Sub OnPreRenderComplete(ByVal e As EventArgs)Dim menu As RadContextMenu = RadGrid1.HeaderContextMenu
        Dim item As New RadMenuItem()
        item.Text = "Format"
        item.Attributes("ColumnName") = String.Empty
        item.Attributes("TableID") = String.Empty
        BuildColumnsMenu(item, RadGrid1.MasterTableView)
        menu.Items.Add(item)
        MyBase.OnPreRenderComplete(e)End Sub