class DownloadLinkExtended : DownloadLink {
public DownloadLinkExtended(DownloadLink origDl){
PropertyInfo[] myObjectProperties = origDl.GetType().GetProperties(); //BindingFlags.Public | BindingFlags.NonPublic
foreach (PropertyInfo pi in myObjectProperties)
{
object value = pi.GetValue(origDl, null);
if (value != null)
{
try
{
pi.SetValue(this, value, null);
}
catch (Exception) {
//selze to na komplexnim typu jako napr. PostData
}
}
}
}
public string NewUrl { get; set; }
public string NewIdOnFilehost { get; set; }
}
But well that reflection does not work and i don't have it set up like DownloadLinkExtended.DownloadLink because then every grid bound column would need to be DownloadLink.field and i don't want it that way. Also setting it in constructor for each property individually is to much error prone manual work.IList<GridViewRow> rows = radGridView.ChildrenOfType<GridViewRow>();But since there is no .Rows this it seams to me that it is not your recommended way.
************** Exception Text
**************
System.InvalidOperationException: The calling thread cannot
access this object because a different thread owns it.
at
System.Windows.Threading.Dispatcher.VerifyAccess()
at
System.Windows.Threading.DispatcherObject.VerifyAccess()
at
System.Windows.DependencyObject.GetValue(DependencyProperty dp)
at
System.Windows.Controls.ContentControl.get_Content()
at
Telerik.Windows.Controls.DragDrop.UndetectableWindow.set_Child(FrameworkElement
value)
at
Telerik.Windows.Controls.DragDrop.DesktopDragDropProvider.Reset()
at
Telerik.Windows.Controls.DragDrop.DesktopDragDropProvider.OnLeftMouseButtonUp(Object
sender, MouseButtonEventArgs e)
at
System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate
genericHandler, Object genericTarget)
at
System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object
target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object
target, RoutedEventArgs routedEventArgs)
at
System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs
args, Boolean reRaised)
at
System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs
args, RoutedEvent newEvent)
at
System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject
sender, MouseButtonEventArgs e)
at
System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs
e)
at
System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate
genericHandler, Object genericTarget)
at
System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object
target)
at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object
target, RoutedEventArgs routedEventArgs)
at
System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs
args, Boolean reRaised)
at
System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs
args)
at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean
trusted)
at System.Windows.Input.InputManager.ProcessStagingArea()
at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
at
System.Windows.Input.InputProviderSite.ReportInput(InputReport
inputReport)
at
System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode
mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32
wheel)
at
System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32
msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at
System.Windows.Interop.HwndSource.InputFilterMessage(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, Boolean isSingleParameter)
at
System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate
callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object
args, Boolean isSingleParameter, Delegate catchHandler)
at
System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority,
TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority,
Delegate method, Object arg)
at
MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam,
IntPtr lParam)
at
System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at
System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32
dwComponentID, Int32 reason, Int32 pvLoopData)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason,
ApplicationContext context)
at
System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason,
ApplicationContext context)
at System.Windows.Forms.Application.Run(Form
mainForm)
at Xm8.App.X.Program.ShowControlCenter(ControlCenterParameters
ccParams)
at Xm8.App.X.Program.ShowCC(Object parameter)
at
System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at
System.Threading.ExecutionContext.Run(ExecutionContext executionContext,
ContextCallback callback, Object state)
at
System.Threading.ThreadHelper.ThreadStart(Object obj)
public static double Percent<TSource>(IEnumerable<TSource> source, Func<TSource, int?> selector){return (source.Select(selector).Aggregate(0, (t1, t2) => t1 + (int)t2) * .01);}

I have this scenario:
<telerik:RadRibbonWindow ... WindowStartupLocation="CenterScreen" Title="Xxxxx" Height="700" Width="980" MinHeight="700" MinWidth="980" Name="XxxxxWindow" AutomationProperties.Name="XxxxxWindow" Closing="XxxxxWindow_Closing" > <i:Interaction.Triggers> <i:EventTrigger EventName="Closed"> <c:CommandAction Command="{Binding Path=ShellClosedCommand}" SyncOwnerIsEnabled="True" /> </i:EventTrigger> </i:Interaction.Triggers> <DockPanel SizeChanged="mainRegion_SizeChanged" Name="mainRegionDockPanel" AutomationProperties.Name="mainRegionDockPanel" > <telerik:RadRibbonBar DockPanel.Dock="Top" prism:RegionManager.RegionName="{x:Static common:RegionNames.RibbonBarRegion}" ApplicationName="{Binding Title}" HorizontalContentAlignment="Stretch" HelpButtonVisibility="Visible" HelpRequested="RadRibbonBar_HelpRequested" Name="RibbonTitle" AutomationProperties.Name="RibbonTitle" ApplicationButtonImageSource="{Binding Source={x:Static CommonProps:Resources.Icon_Mario}, Converter={StaticResource bitmapConverter}}" > <telerik:RadRibbonBar.ApplicationMenu> <telerik:ApplicationMenu RightPaneVisibility="Collapsed"> <telerik:RadRibbonButton Text="Select/Change Xxxxx/Xxxxx" Click="Xxxxx_Click" /> <telerik:RadRibbonButton Text="Close" Click="CloseApplication"/> </telerik:ApplicationMenu> </telerik:RadRibbonBar.ApplicationMenu> <telerik:RadRibbonBar.QuickAccessToolBar > <telerik:QuickAccessToolBar > <telerik:RadRibbonButton Text="Export" Size="Small" Command="{Binding ExportToExcelCommand}" IsEnabled="{Binding ExportToExcelEnabled, UpdateSourceTrigger=PropertyChanged}" SmallImage="{Binding Source={x:Static CommonProps:Resources.Icon16_Excel}, Converter={StaticResource bitmapConverter}}"/> <telerik:RadRibbonButton Text="Print" Size="Small" Command="{Binding PrintCommand}" IsEnabled="{Binding PrintSearchEnabled, UpdateSourceTrigger=PropertyChanged}" SmallImage="{Binding Source={x:Static CommonProps:Resources.Icon16_Print}, Converter={StaticResource bitmapConverter}}" /> </telerik:QuickAccessToolBar> </telerik:RadRibbonBar.QuickAccessToolBar> </telerik:RadRibbonBar>
This is what i get after a couple hours, tha bad thing about this is that the quicklaunch and the minimize, close, etc buttons
dissapears, any idea why?
<Style TargetType="DockPanel" x:Name="mainRegionDockPanel">
<Setter Property="Background" Value="{DynamicResource titleBackground}"/>
</Style>
<LinearGradientBrush x:Key="titleBackground" EndPoint="0.5,1" StartPoint="0.5,0">
<GradientStop Color="#FFE1EBF5" Offset="0.396"/>
<GradientStop Color="#FFE1EBF5" Offset="1"/>
<GradientStop Color="#FFC6DFFC" Offset="0.463"/>
<GradientStop Color="#FFE1EBF5"/>
<GradientStop Color="#FFD8E7F7" Offset="0.856"/>
</LinearGradientBrush>
List<RequestData> produceList = new List<RequestData>();produceList.Add(new RequestData("2", 132, DateTime.Today, "Cash Grants"));produceList.Add(new RequestData("1", 145, DateTime.Today.AddYears(1), "Cash Grants"));produceList.Add(new RequestData("3", 149, DateTime.Today.AddYears(1).AddDays(1), "Cash Grants"));produceList.Add(new RequestData("4", 187, DateTime.Today, "Cash Grants"));produceList.Add(new RequestData("5", 186, DateTime.Today.AddYears(1), "Matching Gifts"));produceList.Add(new RequestData("6", 131, DateTime.Today, "Dinners & Events"));produceList.Add(new RequestData("7", 173, DateTime.Today.AddYears(1), "Dinners & Events"));produceList.Add(new RequestData("8", 172, DateTime.Today, "Matching Gifts"));produceList.Add(new RequestData("9", 140, DateTime.Today.AddYears(1), "Cash Grants"));produceList.Add(new RequestData("10", 129, DateTime.Today, "Dinners & Events"));produceList.Add(new RequestData("11", 158, DateTime.Today, "Matching Gifts"));produceList.Add(new RequestData("12", 164, DateTime.Today.AddYears(1).AddDays(1), "Dinners & Events"));SeriesMapping seriesMapping = new SeriesMapping();seriesMapping.SeriesDefinition = new HorizontalBarSeriesDefinition();seriesMapping.GroupingSettings.GroupDescriptors.Add(new ChartGroupDescriptor("Type"));seriesMapping.GroupingSettings.GroupDescriptors.Add(new ChartYearGroupDescriptor("RequestDate"));seriesMapping.ItemMappings.Add(new ItemMapping("RequestAmount", DataPointMember.YValue, ChartAggregateFunction.Sum));seriesMapping.ItemMappings.Add(new ItemMapping("RequestDate", DataPointMember.XCategory));radChart.SeriesMappings.Add(seriesMapping);radChart.ItemsSource = produceList;radChart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "yyyy";List<RequestData> produceList = new List<RequestData>();produceList.Add(new RequestData("2", 132, DateTime.Today, "Cash Grants"));produceList.Add(new RequestData("1", 145, DateTime.Today.AddYears(1), "Cash Grants"));produceList.Add(new RequestData("3", 149, DateTime.Today.AddYears(1).AddDays(1), "Cash Grants"));produceList.Add(new RequestData("12", 164, DateTime.Today.AddYears(1).AddDays(1), "Dinners & Events"));produceList.Add(new RequestData("4", 187, DateTime.Today, "Cash Grants"));produceList.Add(new RequestData("5", 186, DateTime.Today.AddYears(1), "Matching Gifts"));produceList.Add(new RequestData("6", 131, DateTime.Today, "Dinners & Events"));produceList.Add(new RequestData("7", 173, DateTime.Today.AddYears(1), "Dinners & Events"));produceList.Add(new RequestData("8", 172, DateTime.Today, "Matching Gifts"));produceList.Add(new RequestData("9", 140, DateTime.Today.AddYears(1), "Cash Grants"));produceList.Add(new RequestData("10", 129, DateTime.Today, "Dinners & Events"));produceList.Add(new RequestData("11", 158, DateTime.Today, "Matching Gifts"));SeriesMapping seriesMapping = new SeriesMapping();seriesMapping.SeriesDefinition = new HorizontalBarSeriesDefinition();seriesMapping.GroupingSettings.GroupDescriptors.Add(new ChartGroupDescriptor("Type"));seriesMapping.GroupingSettings.GroupDescriptors.Add(new ChartYearGroupDescriptor("RequestDate"));seriesMapping.ItemMappings.Add(new ItemMapping("RequestAmount", DataPointMember.YValue, ChartAggregateFunction.Sum));seriesMapping.ItemMappings.Add(new ItemMapping("RequestDate", DataPointMember.XCategory));radChart.SeriesMappings.Add(seriesMapping);radChart.ItemsSource = produceList;radChart.DefaultView.ChartArea.AxisX.DefaultLabelFormat = "yyyy";