?
Solved

rename sortable column header in griedview (c#)

Posted on 2006-05-11
2
Medium Priority
?
298 Views
Last Modified: 2012-06-27
Hello experts,

I have a Gridview with sorting enabled, so the column headers are links. I'd like to change the text of the links in the header at runtime, for example in the RowDataBound event, while keeping the sorting functionality.

Thanks in advance,
Kernelv12
0
Comment
Question by:kernelv12
2 Comments
 
LVL 6

Accepted Solution

by:
the_paab earned 2000 total points
ID: 16656711
Try this:

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        if (e.Row.RowType == DataControlRowType.Header)
        {
            ((LinkButton)(e.Row.Cells[0].Controls[0])).Text = "othertext";
        }
    }
0
 
LVL 3

Author Comment

by:kernelv12
ID: 16656750
Thank you the_paab, nice and simple...
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month16 days, 8 hours left to enroll

864 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question