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;
}
/// <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
));
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
;
}
}
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()
var cameraExtension = new CameraExtension();
radChart.DefaultView.ChartArea.Extensions.Add(cameraExtension);