Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 735027
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T07:26:30+00:00 2026-05-14T07:26:30+00:00

I’m customising the Group Headers on a Telerik RadGrid by injecting a LinkButton into

  • 0

I’m customising the Group Headers on a Telerik RadGrid by injecting a LinkButton into it during the ItemDataBound event. The button renders perfectly, but I can’t get it to hit any event handlers.

Here is the code for the button creation:

Private Sub rgWorkRequestItemCosts_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgWorkRequestItemCosts.ItemDataBound

        If TypeOf e.Item Is GridGroupHeaderItem Then

            Dim oItem As GridGroupHeaderItem = DirectCast(e.Item, GridGroupHeaderItem)
            Dim lnkAdd As New LinkButton()
            lnkAdd.ID = "lnkAdd"
            lnkAdd.CommandName = "CustomAddWorkRequestItemCost"
            lnkAdd.CommandArgument = DirectCast(oItem.DataItem, DataRowView).Row("nWorkRequestItemID").ToString()
            lnkAdd.Text = String.Format("<img style=""border:0px"" alt="""" width=""12"" src=""{0}"" /> Add new cost", ResolveUrl(String.Format("~/App_Themes/{0}/Grid/AddRecord.gif", Page.Theme)))
            lnkAdd.Style("color") = "#000000"
            lnkAdd.Style("text-decoration") = "none"
            AddHandler lnkAdd.Click, AddressOf lnkAdd_Click
            Dim tcPlaceholder As GridTableCell = DirectCast(oItem.Controls(1), GridTableCell)
            Dim litText As New LiteralControl(String.Format("&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;{0}", tcPlaceholder.Text))
            tcPlaceholder.Text = String.Empty
            tcPlaceholder.Controls.Add(lnkAdd)
            tcPlaceholder.Controls.Add(litText)
     End If
End Sub

This code explicitly adds a handler for the LinkButton, but that handler is never hit. I’ve also tried events on the RadGrid (ItemCommand, ItemEvent) but none seem to get hit.

Has anyone got any suggestions of other events to try, or ways to make this work?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T07:26:30+00:00Added an answer on May 14, 2026 at 7:26 am

    I wasn’t able to find a “nice” solution to this. In the end I did the following:

    1. Created the button in the
      ItemCreated event handler, setting
      its CommandArgument to a counter
      which was incremented for every
      group header created
    2. Again created the button in the
      ItemDataBound event, again settings
      its CommandArgument to the counter
      value. At this point I added a
      record to a dictionary object
      (stored in ViewState) linking the
      counter to the actual value of the
      group.
    3. Handled the click event of the
      button, extracting the group value
      from the dictionary in viewstate to
      complete the processing.

    Ugly, but it works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I ran into a problem. Wrote the following code snippet: teksti = teksti.Trim() teksti
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.