HTMLPlaceHolder visibility on button click

4 posts, 0 answers
  1. Mohit Vijay
    Mohit Vijay avatar
    11 posts
    Member since:
    Aug 2009

    Posted 20 Aug 2009 Link to this post

    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

  2. Tihomir Petkov
    Admin
    Tihomir Petkov avatar
    576 posts

    Posted 21 Aug 2009 Link to this post

    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.
  3. DevCraft banner
  4. Mohit Vijay
    Mohit Vijay avatar
    11 posts
    Member since:
    Aug 2009

    Posted 21 Aug 2009 Link to this post

    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

  5. Kiril Stanoev
    Admin
    Kiril Stanoev avatar
    1512 posts

    Posted 24 Aug 2009 Link to this post

    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.
Back to Top