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
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?
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
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);
}
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?
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
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()
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 >>
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.
Indeed, I would recommend you to check the general Silverlight forums where it is more likely to find a solution to this particular problem.
Didie
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>