Replacing the HeaderRow texts and SelectButton texts in a DataGrid

I have a DataGrid with allowSorting = True

The HeaderRow displays the column names from the database which you click on to sort by that column.

I want to replace the texts to something more user friendly than my database column names.

If I do DataGrid.HeaderRow.Cells(1).Text = "..." the hyperlink javascript:__doPostback disappears and you are no longer able to sort by this column.

Does anyone have an example on how to replace the texts in the header row without breaking the hyperlinks.

I also have AutogenerateSelectButton = True where I want to replace the text select with something else and I would like an example on how to do this

4/29/2007 11:07:55 PM 72751 articles. 1 followers. Follow

1 Replies

Similar Articles

[PageSpeed] 25


  Please refer to this sample:

 protected void  Button7_Click(object sender, EventArgs e)

        LinkButton l = (LinkButton)this.DataGrid1.Controls[0].Controls[0].Controls[0].Controls[0];//change the last index to see the effect.

        l.Text = "New Text";


If it doesn't work, plese inform us.


Allen Chen
Microsoft Online Community Support

Please remember to mark the replies as answers if they help and unmark them if they provide no help.
5/1/2007 8:40:01 AM

Similar Artilces:

replace the text after some text.
Hi friends, I had a word file. it contains some text. in the text i need to replace text after the tag name (<name>).  for eg  the document file contains the text like this <name>XXXX but i need to change the text "XXXX" to "YYYYY" <name>YYYYY The <name> is same in all word file which i have, but the names after the <name> are different. object nullobj = System.Reflection.Missing.Value;            Microsoft.Office.Interop.Word.ApplicationClass wordApp = new Micr...

Text as text
Name: JohnA Boice Email: jaboiceathughesdotnet Product: Firefox Summary: Text as text Comments: You need to do as Safari does and make ALL text, including buttons, links, bookmarks, and general page text actual text so screen readers can interpret and voice the text. Until this occurs, your products are a real pain to use. And I have limited sight. What about those with less or no sight? Browser Details: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv: Gecko/20070309 Firefox/ ...

chinese character in rich text control and text control
I have a chinese character in either rich text control or text control. The character is look fine if it is a small size (10, 12), however when the font size is changed bigger (36 or 72), the character is out of shape(many dot, not smooth). Is anyone has any idea to print a bigger chinese character from pb7.03. ...

Pasting text from Mac apps into rich text controls pastes plain text
Name: Bob Product: Firefox Summary: Pasting text from Mac apps into rich text controls pastes plain text Comments: Using: Mac OS X 10.6 and Firefox 3.5 and 3.6 beta 1 Steps to reproduce: * Write text in Text Edit, Yojimbo, etc using rich text (e.g. font sizes, bold, italics) * Open Gmail in Firefox and compose an email * Copy and paste the text you created from the other Mac app into Firefox Observed: text is pasted in as plain text Expected: converts the rich text to appropriate rich text in the control, like Safari does This is a huge pain when e.g. writing release n...

How to populate other text controls by losing focus of one text control
 Hi All,Iam new to Here is a small illustration about my prob. I have 3 text controls in a page i.e which represents zip,city,state. I want to populate city and state after entering zipcode into zip text control i.e something like focus lost event on zip text control. Any solution regarding this thanks and regards,vijaycanaan How about OnTextChange: | Twitter epascarello | LinkedIn Hi vijaycanaan We can capture the following event when TextBox  lost focus: On Server-Side:We...

changing text in static text control
Hello PB 11 build 8123 I have a window with a dwcontrol. When I am updating the dw control I want one of the column names (static text controls) to change based on a value I select in another column. So far I have the code in the itemchanged to capture the value of my selection in the field I first select. How do I take this value, (it can only be Y or N) and program one of the column headings (static text) to display a certain text? I can't seem to get it to work with setitem or settext. Those two funcs don't really work with column headings as far as I can see. A...

Changing the text of an input (text) control
Hi everyone, please answer the following: I have a html input control as follows  <input id="newSearch_keywords" type="text" class="text" value="<%=JobsSearchBusinessObject.CurrentKeywords %>" name="newSearch_keywords""/>    When the page loads I need to look at the text of this input field and remove any * chars that are in the text. Thanks for your help <input id="newSearch_keywords" type="text" class="text" value="<%=JobsSearchBusinessObject.CurrentKeywords.Re...

text cut off in static text control
I have a window that needs to display a path in an uneditable field. THe problem is that if the text is longer than the the field it makes the last word disapear so c:\Program is display instead of C:\Program Files\etc... Is there a way to stop the static text from doing this or to make a single line edit unselectable (so the text can't be highlighted)? You have several choices. If the UI element where this static text is displayed is fixed in size, then you are probably better off implementing a tooltip - see On the other h...

Whether a text fits in a text control
Hello, I have several text controls in windows and dw. Is there anyway to know if the text itself fits in the length of the text control (that is, if I will see the text completely) ? Thanks in advance Lena (PB 9.0) Take a look at this techdoc that I authored: it's an example of using the GetTextExtent API to determine whether text does or does not fit. I am not certain about using it in the datawindow though. On 15 Jan 2004 02:23:56 -0800, "lena" <> wrote: >Hello, > >I ha...

Fix broken text wrapping and control input text length in TextBox control
Hi! I'm developing a(nother; it's my second!) ASP.NET application that right now is giving me fits. On one of my screens, the user needs to be able to enter large amounts of text into three database fields. The database fields are all char(350). I'm having two problems with this. First of all, I found that when editing an existing record, text in the fields would wrap in a manner similar to this: Wow, what a sorryperformance! The text box is much wider than the text "Wow, what a sorry", so I couldn't figure out why the text was wrapping. I tried setting the Columns property to 90 (which...

MS Publisher / Word-like textframe web control... flowing text between text controls
Does anyone know of an ASP.Net web control capable of linking text boxes/frames together similarly to the Publisher & Word textframe objects (via the NextLinkedTextFrame property in Publisher or the TextFrame.Next property in Word)? The goal is to have text flow from one textbox into another. Thx.....

How to programmatically add user control to the middle of text inside Literal text control ? Pls help...
Greetings fellow programmers,I greatly appreciate all the help I can get. Here is the problem.I have a function that pulls content from the database and put the content into a literal control. Somewhere in that content, I need to insert a user control (bla.ascx). Ideally, I want to use string.replace to find the location where I want to insert the user control. But I can't... there is no such option on the literal control methods and properties.Do I have to overwrite render method? I'd normally use loadcontrol and add it to the placeholder control, but in this case, I can't dynamically ...

Bold Text For Selected text in Text Box
Hi EveryoneI have a small thing to do [at this time , very big for me]. I want to make some text string as bold which appears in a text box control for the web. It means some of the portion of the string will be bold and some will be in the normal font style. Can anyone suggest any idea to accomplish this task. [I know that we can set the font weight property for the whole text box and all the text appears in the selected font-weight]Any suggestions.BaberBaber SaeedSoftware EngineerPalmChip, Pakistan Toll Free: 0800-000-13 Ext:494Cell: 0300-6438634 Standard TextBox that comes with ASP.NET ...

Text not appearing when typing the text into text field
Name: Maadhavan Email: madhavan_t_patyahoodotcom Product: Firefox Summary: Text not appearing when typing the text into text field Comments: Text not appearing when typing the text into text field or any other field Browser Details: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv: Gecko/2009040821 Firefox/3.0.9 From URL: Note to readers: Hendrix gives no expectation of a response to this feedback but if you wish to provide one you must BCC (not CC) the sender for them to see it. ...

Web resources about - Replacing the HeaderRow texts and SelectButton texts in a DataGrid -

half rollicking argument about videogames, half self-absorbed inanity

Axiom Verge (@AxiomVerge) on Twitter
Log in Sign up You are on Twitter Mobile because you are using an old version of Internet Explorer. Learn more here Axiom Verge @ AxiomVerge ...

All URLs regardless of their length are now automatically wrapped with - Twitter Developers
Hey Developers, We've just completed our transition to automatically wrap all URLs regardless of their length with the URL wrapper. Note ...

auntie pixelante › silhouette bros.
we must make the games we wish to play in the world

Video-game designer Anna Anthropy describes the life of a radical, queer, transgender gamer
In 2002, Anna Anthropy, the prolific transgender video-game developer, decided to quit playing video games.

GameSetLinks: Nights Into Magic Words
Our Properties: Gamasutra GameCareerGuide IndieGames Indie Royale GDC IGF Game Developer Magazine GAO Thursday, Dec 1, 2011 Archives Contact ...

NARC - Walkthrough/FAQ
x us ESC New Trailer Teenage Mutant Ninja Turtles Poll: Who's Dying in Tonight's Walking Dead Finale? Harry Potter Spinoff Series Will Be A Trilogy ...

Lens of Truth: Street Fighter EX plus alpha Retro Review
All PS3 XB360 Wii U Wii PC Vita DS PS4 Xbox One E3 Find Go All Next-Gen PS4 PS3 Xbox 360 Xbox One Wii U Wii PC PSP PS Vita DS 3DS + More + My ...

株式会社SELECT BUTTON - セレクトボタン
株式会社SELECT BUTTON - セレクトボタンの公式ホームページです。サービス、企業情報などをご紹介しています。

Resources last updated: 12/11/2015 9:06:44 AM