Telerik Forums
UI for WPF Forum
5 answers
131 views
I want to change the datatemplate of the DragCue (I mean i want to change the image source of the image tag applied in datatemplate in XAML). I used the following event but it didn't help me out. please help ASAP.

      private void OnDragQuery(object sender, DragDropQueryEventArgs e)
        {
            cue = new ContentControl();
            e.QueryResult = true;
            cue.MouseUp += new MouseButtonEventHandler(cue_MouseUp);
           
            e.Options.DragCue = cue;

            ImageSource IMGSOURCE = new BitmapImage(new Uri("/Images/header_idea.png",UriKind.Relative));

            DataTemplate dt = new DataTemplate();
          
            FrameworkElementFactory ef = new FrameworkElementFactory(typeof(Image));
            ef.SetValue(Image.SourceProperty, IMGSOURCE);

            dt.VisualTree = ef;
            cue.ContentTemplate = dt;
                        
            e.Options.ArrowCue = RadDragAndDropManager.GenerateArrowCue();
            e.Handled = true;
        }
Tsvyatko
Telerik team
 answered on 21 Jan 2011
1 answer
72 views

hello admin,
                i have pasted the OnDragQuery event of the drag and drop. the two lines of code in which i have given the datatemplate to the drag cue's content template is is fine enough. But the image source in the datatemplate in xaml is always static  and i' not able to bind the image source. So, instead of that i wanted to give the dragcue a new image in C#. It does work, but its not firing and triggering the mouse up event. please point out any mistake and please suggest anything new if this isn't the right way to do it. And please i don't want to use the binding, as it is not working properply. Suggest something in DEeail. In DETAIL please, or attach and perfect and suitable example..Thanks in advance. please its important

 

 

void OnDragQuery(object sender, DragDropQueryEventArgs e)
{
ContentControl dragCue = new ContentControl();
e.QueryResult =
true;
dragCue.MouseUp += new MouseButtonEventHandler(dragCue_MouseUp);

dragCue.ContentTemplate =
this.Resources["DragTemplate"] as DataTemplate;  //is fine,
e.Options.DragCue = dragCue;   // but has static image souce in xaml

 

 

 

//Image im = new Image();             //this commented code doesn't fire
//im.Width = 40;                     //the MouseUp event, when i        
//im.Height = 40;                     //don't give the     
//im.Source = new BitmapImage(new Uri(@"/Images/drive.png", UriKind.Relative));  //content template to it. want
//e.Options.DragCue = im;             // to use it to give dynamic image
                                     //source instead 
                                    // of above highlighted code.

e.Options.ArrowCue =
RadDragAndDropManager.GenerateArrowCue();
e.Handled =
true;

 

}

 

 

Tsvyatko
Telerik team
 answered on 21 Jan 2011
1 answer
214 views
I'm extending the RadDatePicker. I have implemented a new property that tells whether the text input in the DatePicker is valid (that is if can be parsed to a DateTime):

/// <summary>
/// Tells whether the input in the TextBox of this DatePicker is valid. This property is
/// updated continously as the user types in the TextBox.
/// </summary>
public bool IsInputValid
{
    get
    {
        return (bool)GetValue(RadDatePickerExtended.IsInputValidProperty);
    }
    set
    {
        SetValue(RadDatePickerExtended.IsInputValidProperty, value);
    }
}
 
public static readonly DependencyProperty IsInputValidProperty = DependencyProperty.Register("IsInputValid", typeof(bool), typeof(RadDatePickerExtended), new FrameworkPropertyMetadata(true));


I'm setting the value of this property in an event handler for the ParseDateTimeValue event:

private void RadDatePickerExtended_ParseDateTimeValue(object sender, ParseDateTimeEventArgs args)
{
    //If RadDatePicker could not parse the input...
    if (!args.IsParsingSuccessful)
    {  
        //HERE I DO SOME EXTRA PARSING FOR INPUT THAT I WANT TO SUPPORT
        //BUT THAT IS NOT SUPPORTED BY RadDatePicker. IN ALL CASES
        //WHERE THE PARSING IS SUCCESFUL AND A DATETIME IS SET, I
        //ALSO SET args.IsParsingSuccessful TO TRUE.
 
        IsInputValid = args.IsParsingSuccessful;
    }
    else
    {
        //The input was succesfully parsed by the default parsing in the RadDatePicker.
        IsInputValid = true;
    }
}


This seems to work fine. But the problem is that if the user deletes the text in the input the event is NOT dispatched and thus my method is not executed. If the user provides some invalid input so that my IsInputValid property is set to false and then clears the input, IsInputValid will still be false! I want to set it to true when the input is empty (this will mean that the value of the DatePicker is null which is allowed in my case).

So my question is: Is it possible to get notified in some way when the input is cleared by the user?
Kaloyan
Telerik team
 answered on 21 Jan 2011
1 answer
140 views
I am currently trying to handle the return key press for a RadButton control via the PreviewKeyDown event but am unable to. I can successfully handle other keystrokes, such as function keys, however the event is not raised when the return key is pressed. I can only assume that this is because the return key is seen as an access key and so handled elsewhere. Is there a way to turn this off or bypass it so that I can handle the return key for myself?
Brian Scott
Top achievements
Rank 1
 answered on 21 Jan 2011
1 answer
84 views
Hello,

I woud like to auto expand an unexpanded RadTreeListView row when the user's dragging an item and pass over the row. Is there any properties like the DropExpandDelay or a small workaround ? 

For the moment I can do this in the OnDropQuery method but I'd like to add a certain delay before the row expands.

Thanks.
Pavel Pavlov
Telerik team
 answered on 21 Jan 2011
1 answer
24 views
I'm using the chart of Area3DSeriesDefinition,in the example, the axis-X value is auto generated, now , I want to change the axis-x value,how can i do it ? 
I have tried to use DataSeries as bellow, but axis-x is not changed
            DataSeries dataSerie = new DataSeries();
            dataSerie.Definition = new Area3DSeriesDefinition() { ShowItemLabels = true };
            dataSerie.Add(new DataPoint() {XCategory ="A", YValue = 1});
            dataSerie.Add(new DataPoint() { XCategory = "b", YValue = 10 });
            RadChart1.DefaultView.ChartArea.DataSeries.Add(dataSerie);
Yavor
Telerik team
 answered on 21 Jan 2011
1 answer
84 views
Hi,

is there a way how to prevent tileview to set height of restored items automatically to be proportional according to whole tileview? I need to set height for each restored item. I guess that this can be done using custom style, but I am not able to access the restored items from style xaml.

Thanks in advance,
Petr
Zarko
Telerik team
 answered on 21 Jan 2011
3 answers
303 views
Hi

I'm trying to figure out how to chance the appearance of the tabs in a RadPaneGroup.

I open my project in Blend, and select the RadPaneGroup I want to change in the Objects and Timeline pane. Selecting 'Edit Additional Templates', I then choose Edit Bottom Template -> Edit A Copy, and choose a name, and put the new Template into a new xml file.

Now, I can figure out how to do some things, such as change the tabs to appear at the top, rather than the bottom, but cannot see how to change the look of the tabs. Where do I need to look to do this?

Thanks
Tom Davies
Dani
Telerik team
 answered on 21 Jan 2011
7 answers
104 views
Hello,

Looking for a list of words/numbers/symbols the RadDatePicker control accepts out-of-the-box. We're currently using version 2010.1.603.35. Looked in the documentation and didn't see anything.

Thanks much,
~Boots
Kaloyan
Telerik team
 answered on 21 Jan 2011
1 answer
61 views
Hi I'm using the latest 2010 release.
On my window I have a radchart with Pyramid3DSeriesDefinition.
In my code I'm adding the the camera extension but it gives me a null reference exception on runtime.

at Telerik.Windows.Controls.Charting.CameraExtension.CalculatePointProjection(Point point)
at Telerik.Windows.Controls.Charting.CameraExtension.InitialTransformUpdate()
at Telerik.Windows.Controls.Charting.CameraExtension.ChartAreaUpdatedTimerElapsed(Object sender, EventArgs e)
at System.Windows.Threading.DispatcherTimer.FireTick(Object unused)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Threading.ExecutionContext.runTryCode(Object userData)
at System.Runtime.CompilerServices.RuntimeHelpers.ExecuteCodeWithGuaranteedCleanup(TryCode code, CleanupCode backoutCode, Object userData)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run()


Above mentioned is the stack trace.
Below mentioned is the code that I'm using in the radChart_Loaded event.
var cameraExtension = new CameraExtension();
radChart.DefaultView.ChartArea.Extensions.Add(cameraExtension);







Yavor
Telerik team
 answered on 21 Jan 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?