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 7660083
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T13:25:04+00:00 2026-05-31T13:25:04+00:00

I was able to get part of my answer from another question but cannot

  • 0

I was able to get part of my answer from another question but cannot find a more specific bit of information that I need to finish.

I am trying to combine 2 fields into 1 like the above question but one of them is a GridHyperLinkColumn. I am using a GridItemDataBound event in the code behind to put 2 fields together like this:

protected void GridItemDataBound(object sender, GridItemEventArgs e) {
  if (e.Item is GridDataItem) {
    GridDataItem item = (GridDataItem)e.Item;
    item["A"].Text = item["A"].Text + " /<br/>" + item["B"].Text;
    item["C"].Text = item["C"].Text + " /<br/>" + item["D"].Text;
   }
}

My UI shorten down for simplicity looks like this:

 <Columns>    
    <telerik:GridBoundColumn UniqueName="A" DataField="A" />
    <telerik:GridBoundColumn UniqueName="B" DataField="B" Visible="false" />
    <telerik:GridHyperLinkColumn DataNavigateUrlFields="ID"        DataNavigateUrlFormatString="~.aspx?ID={0}" DataTextField="C" Text="{0}" UniqueName="C" />     
    <telerik:GridBoundColumn UniqueName="D" DataField="D" Visible="false" />
  </Columns>

This works well for the first 2 columns that I combine into 1 (A & B).

However suppose item[“C”] is a GridHyperLinkColumn. When I try the same code, it only shows / <D value>. Nothing shows up in front of the slash where “C” should be showing.

Is there a different property (instead of .Text) I should use or do I need to do it a different way?

  • 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-31T13:25:05+00:00Added an answer on May 31, 2026 at 1:25 pm

    There are a number of ways you could do this. One approach would be to use a template column as show below:

    <Columns>
        <telerik:GridTemplateColumn HeaderText="A and B">
            <ItemTemplate><%# Eval("A") %>/<br /><%# Eval("B") %></ItemTemplate>
        </telerik:GridTemplateColumn>
        <telerik:GridTemplateColumn HeaderText="B and C">
            <ItemTemplate><a href="blah.aspx?ID=<%# Eval( "C" ) %>"><%# Eval( "C" ) %></a>/<br /><%# Eval("D") %></ItemTemplate>
        </telerik:GridTemplateColumn>
    </Columns>
    

    If you’re not interested in using a template column, you can get it to work the way you’re doing it. The issue is that the GridHyperlinkColumn renders the link as a control (e.g. item["C"].Controls[0]) instead of directly in the Text property. Here is one way to get it to do what you want:

    if (e.Item is GridDataItem) {
        GridDataItem item = (GridDataItem)e.Item;
        item["A"].Text = item["A"].Text + " /<br/>" + item["B"].Text;
        Literal lit = new Literal();
        lit.Text = " /<br/>" + item["D"].Text;
        item["C"].Controls.Add( lit );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Newbie question about JavaFX that I haven't been able to answer, despite knowing it
This may be a easy question to answer but I am a bit stumped
Edit: This is technically a 2 part question. I've chosen the best answer that
20120315021529.000[-8:PST] to get the first part I was able by using below C# code.
I am able to get the current date, but I don't know how to
I'm not able to get this persistence file correct... I do not find any
I am able to get the current page's url in jsf from back-end bean
@saverio was successful on answer this database query question on Tagging from Scratch: the
I've spent days researching the internet and I can't find the answer that I
not able to get this, can someone help for this LINQ query? select col1,

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.