HeadTemplate UserControl State

Discussion in 'ASP .Net Datagrid Control' started by Crosscourt, May 27, 2005.

  1. Crosscourt

    Crosscourt Guest

    If i have a template column with a template header whoch contains a Label
    Control,
    The datagrid seems to regenerate the labels on postback. How can i force it
    to remeber the text property if it was changed dynamically?

    Anthony
    Crosscourt, May 27, 2005
    #1
    1. Advertising

  2. Crosscourt

    Mona Guest

    Hi Anthony,

    To make the web pages remember or maintain the values on postback
    you need to set the Enable.ViewSate property to True.

    HTH

    Mona[Grapecity]


    "Crosscourt" <> wrote in message
    news:%...
    > If i have a template column with a template header whoch contains a Label
    > Control,
    > The datagrid seems to regenerate the labels on postback. How can i force
    > it to remeber the text property if it was changed dynamically?
    >
    > Anthony
    >
    Mona, May 30, 2005
    #2
    1. Advertising

  3. Crosscourt

    Crosscourt Guest

    Yeah, EnableViewState is default to true and i didn't change it.
    This is in the column header where i try to have an arrow for the sorting.
    I have a click event that toggles the text of the label that represents the
    arrow, looping thru the states of ("","ASC","DESC")
    However, when i rebind & postback, the label text is gone. I guess it got
    reset to "".

    Any ideas?

    thanks

    "Mona" <> wrote in message
    news:...
    > Hi Anthony,
    >
    > To make the web pages remember or maintain the values on postback
    > you need to set the Enable.ViewSate property to True.
    >
    > HTH
    >
    > Mona[Grapecity]
    >
    >
    > "Crosscourt" <> wrote in message
    > news:%...
    >> If i have a template column with a template header whoch contains a Label
    >> Control,
    >> The datagrid seems to regenerate the labels on postback. How can i force
    >> it to remeber the text property if it was changed dynamically?
    >>
    >> Anthony
    >>

    >
    >
    Crosscourt, May 31, 2005
    #3
  4. Crosscourt

    Mona Guest

    Hi Anthony,

    In that case, you can store the text itself in a string,let the click event modify the string,
    and when the postback occurs, set the header text of the sorting column to the value in the string.

    HTH

    Mona[Grapecity]


    "Crosscourt" <> wrote in message news:%...
    > Yeah, EnableViewState is default to true and i didn't change it.
    > This is in the column header where i try to have an arrow for the sorting.
    > I have a click event that toggles the text of the label that represents the
    > arrow, looping thru the states of ("","ASC","DESC")
    > However, when i rebind & postback, the label text is gone. I guess it got
    > reset to "".
    >
    > Any ideas?
    >
    > thanks
    >
    > "Mona" <> wrote in message
    > news:...
    >> Hi Anthony,
    >>
    >> To make the web pages remember or maintain the values on postback
    >> you need to set the Enable.ViewSate property to True.
    >>
    >> HTH
    >>
    >> Mona[Grapecity]
    >>
    >>
    >> "Crosscourt" <> wrote in message
    >> news:%...
    >>> If i have a template column with a template header whoch contains a Label
    >>> Control,
    >>> The datagrid seems to regenerate the labels on postback. How can i force
    >>> it to remeber the text property if it was changed dynamically?
    >>>
    >>> Anthony
    >>>

    >>
    >>

    >
    >
    Mona, May 31, 2005
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. huobazi
    Replies:
    1
    Views:
    683
    David Waz...
    Jul 3, 2003
  2. Rajesh Tiwari

    Can we use a usercontrol inside a usercontrol

    Rajesh Tiwari, Aug 12, 2003, in forum: ASP .Net
    Replies:
    0
    Views:
    411
    Rajesh Tiwari
    Aug 12, 2003
  3. nail
    Replies:
    0
    Views:
    1,540
  4. Phl
    Replies:
    2
    Views:
    523
    =?Utf-8?B?VGFtcGEgLk5FVCBLb2Rlcg==?=
    Nov 18, 2004
  5. Fabiano
    Replies:
    2
    Views:
    598
    =?Utf-8?B?c3Jpbmk=?=
    Jun 3, 2005
Loading...

Share This Page