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

RadHtmlPlaceholder not firing Events

1 Answer 68 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
jorex
Top achievements
Rank 1
jorex asked on 30 Mar 2009, 12:19 PM
Hi,

First of all, i don't know where to post this thread becuase there is no category for RadHtmlPlaceholder  for Silverlight.

Issue is that i have declared an event for RadHtmlPlaceholder and it is not firing it's event... The thing is i want to get the coordinates when mouse is pressed. Also, how would i insert an image overlapping the HtmlPlaceholder sort of a second layer?

by the way the image is populated from the Database so i had it on the HtmlPlaceHolder compared to using the native Image and ImageBrush controls for Silverlight.

Thank you and waiting for your response... :)

i have the following code below: 

 

 

<Grid>

 

    <ScrollViewer Margin="10" BorderThickness="0" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">

 

    <StackPanel Orientation="Horizontal">

 

 

 

        <StackPanel x:Name="rootElement" >

 

 

 

            <TextBlock HorizontalAlignment="Stretch" VerticalAlignment="Top" Text="Question" TextWrapping="Wrap" Margin="7.5,8,8.5,0" TextAlignment="Left" x:Name="Question" FontWeight="Bold" FontFamily="Portable User Interface" Height="54"/>

 

 

 

            <telerik:RadHtmlPlaceholder HorizontalAlignment="Left" x:Name="RadHtmlPlaceholder2"

 

 

MouseLeftButtonDown="RadHtmlPlaceholder2_MouseLeftButtonDown" MouseLeftButtonUp="RadHtmlPlaceholder2_MouseLeftButtonUp">

 

            <Line x:Name="lineStroke" Stroke="Red" StrokeThickness="5"></Line>

 

 

 

            </telerik:RadHtmlPlaceholder>

 

 

 

       </StackPanel>

 

 

 

    </StackPanel>

 

 

 

    </ScrollViewer>

 

 

 

</Grid>

 

 

 

 

Codebehind:

 

 

private

 

void RadHtmlPlaceholder2_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)

{

startPointx = e.GetPosition(

this.RadHtmlPlaceholder2).X.ToString();

 

 

startPointy = e.GetPosition(

this.RadHtmlPlaceholder2).Y.ToString();

 

 

}

 

 

private void RadHtmlPlaceholder2_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)

{

endPointx = e.GetPosition(

this.RadHtmlPlaceholder2).X.ToString();

 

 

endPointy = e.GetPosition(

this.RadHtmlPlaceholder2).Y.ToString();

 

 

 

if (startPointx != null)

{

lineStroke.X1 =

Convert.ToDouble(startPointx);  

 

 

lineStroke.X2 =

Convert.ToDouble(endPointx);  

 

 

lineStroke.Y1 =

Convert.ToDouble(startPointy);

 

lineStroke.Y2 =

Convert.ToDouble(endPointy);

 

 

startPointx =

string.Empty;

 

startPointy =

string.Empty;

 

 

}

}

 

 

1 Answer, 1 is accepted

Sort by
0
Tihomir Petkov
Telerik team
answered on 30 Mar 2009, 02:37 PM
Hi jorex,

Currently the scenario you describe is not supported by RadHtmlPlaceholder. You cannot have elements overlapping the control.

All the best,
Tihomir Petkov
the Telerik team

Check out Telerik Trainer , the state of the art learning tool for Telerik products.
Tags
General Discussions
Asked by
jorex
Top achievements
Rank 1
Answers by
Tihomir Petkov
Telerik team
Share this question
or