HeadTemplate UserControl State

C

Crosscourt

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
 
M

Mona

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]
 
C

Crosscourt

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 said:
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 said:
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
 
M

Mona

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 said:
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 said:
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 said:
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
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,572
Members
45,045
Latest member
DRCM

Latest Threads

Top