This is a migrated thread and some comments may be shown as answers.

Refreshing a label control

7 Answers 89 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Edward
Top achievements
Rank 2
Edward asked on 28 Jun 2012, 09:14 AM
Hi

I have a loop which updates the Content property of a Telerik label.  Its kind of a status label. The problem is that it does not get refreshed when the Content property is updated with a new value.

Q: How can I refresh this control?

Hope you can help. Thanks anyway.

Edward

7 Answers, 1 is accepted

Sort by
0
Dimitrina
Telerik team
answered on 28 Jun 2012, 09:31 AM
Hello,

 May I ask you to provide a little bit more information on the matter? For example how have you defined the label and how do you change its content?

Greetings,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Edward
Top achievements
Rank 2
answered on 28 Jun 2012, 10:17 AM
Hi

The Label is defined in Xaml:

<telerik:Label Name="tbStatusMessage" Margin="10,10,10,0"  Content="TextBlock" VerticalAlignment="Top" FontSize="14" />

And I have this code that updates the label:


private void AddMessage(string pMessage, int pCount)
       {
           //todo: this does not repaint !
 
           if (pCount < 0)
               tbStatusMessage.Content += Environment.NewLine + pMessage;
           else
               tbStatusMessage.Content += Environment.NewLine + String.Format(pMessage + " (Aantal: {0})", pCount);
       }
0
Dimitrina
Telerik team
answered on 28 Jun 2012, 10:53 AM
Hi,

 Thank you for the code snippets. I have created a test project but I were not able to get any problem refreshing the content of the Label.

Would you please check the sample attached and let me know how I could reproduce the issue?

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Edward
Top achievements
Rank 2
answered on 28 Jun 2012, 01:09 PM
I could have been more clear :)

The code is in a popin and it does something like this

AddMessage("Passes loaded",2)
..

..20 x AddMessage ..

..
AddMessage("Passes loaded",2) 


Thread.Sleep(2000);  // wait so user can see the last messages - removing this will not help
ClosePopInCode();


The problem is that the popin closes without showing the status messages.  I think adding the messages is too fast. It does not have the time to update the status text.  Is there a way to force an update on the TextBox ? like  tbStatusMessage.Update()

















0
Dimitrina
Telerik team
answered on 28 Jun 2012, 03:34 PM
Hi,

I am not sure that I understand this line: "Is there a way to force an update on the TextBox ?". May I ask you to send me a little sample project that demonstrates the problem? That way we could debug it locally and advise you better. 

Regards,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Edward
Top achievements
Rank 2
answered on 02 Jul 2012, 07:40 AM
Well, with  "Is there a way to force an update on the TextBox ?".  In Windows you have an application.processMessage which forces controls to be updated. Its not there is SL and thats the problem i'm having.

I think it has nothing to do with the Telerik controls but with the SL inner workings. If there is nothing that pops up in your mind I think I close this thread (dont want to waste your time) because its more of a SL thing. 
0
Accepted
Dimitrina
Telerik team
answered on 02 Jul 2012, 10:36 AM
Hello,

 Indeed, I would recommend you to check the general Silverlight forums where it is more likely to find a solution to this particular problem.

All the best,
Didie
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
General Discussions
Asked by
Edward
Top achievements
Rank 2
Answers by
Dimitrina
Telerik team
Edward
Top achievements
Rank 2
Share this question
or