Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > HeadTemplate UserControl State

Reply
Thread Tools

HeadTemplate UserControl State

 
 
Crosscourt
Guest
Posts: n/a
 
      05-27-2005
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


 
Reply With Quote
 
 
 
 
Mona
Guest
Posts: n/a
 
      05-30-2005
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
>



 
Reply With Quote
 
 
 
 
Crosscourt
Guest
Posts: n/a
 
      05-31-2005
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
>>

>
>



 
Reply With Quote
 
Mona
Guest
Posts: n/a
 
      05-31-2005
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
>>>

>>
>>

>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Getting a property of a control inside a usercontrol, from another usercontrol Fabiano ASP .Net 2 06-03-2005 09:56 AM
accessing usercontrol from another usercontrol Phl ASP .Net 2 11-18-2004 07:33 PM
Access a control inside an usercontrol from another control inside another usercontrol nail ASP .Net 0 09-15-2004 03:55 PM
Can we use a usercontrol inside a usercontrol Rajesh Tiwari ASP .Net 0 08-12-2003 03:56 PM
Use LoadControl to load a usercontrol but the webcontrol in the usercontrol can not AutoPostBack huobazi ASP .Net 1 07-03-2003 03:14 AM



Advertisments