Change HeaderText of datagrid after binding

Ask a Question related to ASP.NET Data Grid Control, Design and Development.

  1. #1

    Default Change HeaderText of datagrid after binding

    (Type your message here)

    --------------------------------
    From: Sangra
    Hi,
    I got a datagrid which I want to change the headertext after binding.
    Because I have a multi-lingual app and I allow the user to change the
    language on-the-fly. However, the headertext changes only after the
    2ND TIME I pressed the Change language button. I'm doing the change
    during the Page_Load event and I suppose the ASP.NET takes the
    values of the headertexts BEFORE it, so it will be showed only on the
    next time!
    My question is what is the correct event I should catch and change the
    text?
    Many thanks in advance!

    -----------------------
    Posted by a user from .NET 247 ([url]http://www.dotnet247.com/[/url])

    <Id>GgIRLqizMEW0GTv0rPM03A==</Id>
    Sangra M via .NET 247 Guest

  2. Similar Questions and Discussions

    1. setting headertext for a datagrid column
      Hey, can someone help me with this? I'm trying to change the headerText for a datagrid column programmatically. I'm not trying to create the...
    2. How do I change the headertext of a datagrid column programmatically
      Hi, I have a datagrid to view the results from a database. I am using autogenerate because the number of columns returned from the database...
    3. change HeaderText of DataGrid in PreRender().
      I need change HeaderText of DataGrid in PreRender(). But it seems doesn't work. The code example like this: Protected Overrides Sub...
    4. DataGrid Dynamic HeaderText
      Hell How can I change the headerText of an AutoGenerateColumns DataGrid myDataGrid.DataSource=ds.Tables.DefaultView myDataGrid.DataBind()...
    5. How to change datagrid column HeaderText from C#
      You can do thisn DataGrid_ItemCreated Event HTH Prasad "MarkMurphy" <murphy@murphysw.com> wrote in message...
  3. #2

    Default Re: Change HeaderText of datagrid after binding

    Using the datagrid's ItemCreated event is probably the best choice. The
    ItemDataBound won't work in this case because the header is not an item (not
    associated with a data). See for example:

    [url]http://msdn.microsoft.com/msdnmag/issues/01/10/cutting/default.aspx[/url]
    [url]http://www.codeproject.com/aspnet/MergeDatagridHeader.asp[/url]
    [url]http://www.datagridgirl.com/articles.aspx[/url]

    S. L.

    "Sangra M via .NET 247" <anonymous@dotnet247.com> wrote in message
    news:uzz2goHKFHA.3336@TK2MSFTNGP10.phx.gbl...
    > (Type your message here)
    >
    > --------------------------------
    > From: Sangra
    > Hi,
    > I got a datagrid which I want to change the headertext after binding.
    > Because I have a multi-lingual app and I allow the user to change the
    > language on-the-fly. However, the headertext changes only after the
    > 2ND TIME I pressed the Change language button. I'm doing the change
    > during the Page_Load event and I suppose the ASP.NET takes the
    > values of the headertexts BEFORE it, so it will be showed only on the
    > next time!
    > My question is what is the correct event I should catch and change the
    > text?
    > Many thanks in advance!
    >
    > -----------------------
    > Posted by a user from .NET 247 ([url]http://www.dotnet247.com/[/url])
    >
    > <Id>GgIRLqizMEW0GTv0rPM03A==</Id>

    Sylvain Lafontaine Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139