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

HTMLPlaceHolder visibility on button click

3 Answers 78 Views
HTMLPlaceHolder
This is a migrated thread and some comments may be shown as answers.
Mohit Vijay
Top achievements
Rank 1
Mohit Vijay asked on 21 Aug 2009, 04:16 AM

Hi All,

I am having a problem:

I clicked a button, in the start of code, I wrote a line to visible the HTMLPlaceHolder content, that is some html stuff.  when code ends, I am setting is visibility to off. As execution of code will take approx 45 seconds, it should show the HTML content of controls. but its not showing the HTMLPlaceHolder in whole process.how can I implement it?

The hTML Content from HTMLPlaceHolder is howing properly if I set its visibility on in the start of code, and not set visible on -off as I menation earlier.

Mohit

3 Answers, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 21 Aug 2009, 11:25 AM
Hello Mohit,

We are not aware of any problems of the functionality you mention. I tested your scenario and I could not reproduce the issue you reported. If you can provide a sample project that demonstrates the issue I will be able to investigate it.

All the best,
Tihomir Petkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Mohit Vijay
Top achievements
Rank 1
answered on 21 Aug 2009, 06:20 PM
On .xaml page, I have

 

 

 

 

<

 

navigation:Page xmlns:telerik="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls" x:Class="TestSL.Home"

 

 

xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

 

xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"

 

 

xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

 

 

 

 

 

 

xmlns:navigation="clr-namespace:System.Windows.Controls;assembly=System.Windows.Controls.Navigation"

 

 

 

 

 

 

mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480"

 

 

 

 

 

 

Title="Home"

 

 

 

 

 

 

Style="{StaticResource PageStyle}">

 

 

 

 

 

 

 

<Grid x:Name="LayoutRoot">

 

 

 

 

 

 

 

<ScrollViewer x:Name="PageScrollViewer" Style="{StaticResource PageScrollViewerStyle}">

 

 

 

 

 

 

 

<Canvas x:Name="cnvGE">

 

 

 

 

 

 

 

<telerik:RadHtmlPlaceholder x:Name="PWGrading" Visibility="Collapsed" Canvas.Top="10" Canvas.Left="10"></telerik:RadHtmlPlaceholder>

 

 

 

 

 

 

 

<Button x:Name="Start" Click="Start_Click" Content="Start" Canvas.Left="10" Canvas.Top="50" Height="30" Width="200"></Button>

 

 

 

 

 

 

 

<telerik:RadHtmlPlaceholder x:Name="myoutput" Canvas.Left="10" Canvas.Top="100" Height="200" Width="300" ></telerik:RadHtmlPlaceholder>

 

 

 

 

 

 

 

 

</Canvas>

 

 

 

 

 

 

 

</ScrollViewer>

 

 

 

 

 

 

 

</Grid>

 

</

 

navigation:Page>

 

 

 


on .xaml.vb page, I have

 

Private

 

Sub Start_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs)

 

 

Dim i As Integer

 

 

 

 

 

 

Dim j As Integer

 

 

 

 

 

PWGrading.HtmlSource =

"Starting..."

 

 

 

 

 

PWGrading.Visibility = Windows.Visibility.Visible

 

For i = 1 To 35000

 

 

For j = 1 To 30000

 

myoutput.HtmlSource =

"<b>" & i & "</b> ||" & " " & j & " <br/>"

 

 

 

 

 

 

Next

 

 

 

 

 

 

Next

 

 

 

 

 

PWGrading.HtmlSource =

"Ending..."

 

 

 

 

 

PWGrading.Visibility = Windows.Visibility.Collapsed

MessageBox.Show(

"Done")

 

 

End Sub

 



----------------------------------------------------
I tried to upload the code in .zip file, but dont find the option to attach the file. Please look the above pasted code and I request you to please solve my problem as soon as possible.

Mohit

0
Kiril Stanoev
Telerik team
answered on 24 Aug 2009, 10:15 AM
Hello Mohit,

If you want to send us an attachment you need to open a support ticket. Attachments are disabled for forum posts.
I tested the code you have pasted and the reason why you do not see anything is because of the for loops.
Silverlight's UI is single-threaded and the nested for loops of your application block the thread. That is why you cannot see the PWGrading (RadHtmlPlaceholder) changing its HtmlSource property.
You can overcome this by creating a new thread, but this will significantly complicate your solution.
If you can provide more information on what you are trying to achieve maybe I'd be able to help, but for the moment I'd suggest you do not use the nested for loops.

Greetings,
Kiril Stanoev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
HTMLPlaceHolder
Asked by
Mohit Vijay
Top achievements
Rank 1
Answers by
Tihomir Petkov
Telerik team
Mohit Vijay
Top achievements
Rank 1
Kiril Stanoev
Telerik team
Share this question
or