Telerik Forums
UI for WPF Forum
4 answers
111 views
Hi,
with latest control I get this Error:
Function: InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) 

Class: System.Reflection.RuntimeMethodInfo

Stacktrace: 
 bei System.Reflection.RuntimeMethodInfo.InvokeArgumentsCheck(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   bei System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   bei System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)
   bei Telerik.Windows.Data.ItemPropertyInfoExtensions.GetValue(ItemPropertyInfo itemProperty, Object item)
   bei Telerik.Windows.Controls.RadDataForm.PopulatePropertiesInitialValues(Object currentItem)
   bei Telerik.Windows.Controls.RadDataForm.OnCurrentItemChanged(DependencyObject sender, DependencyPropertyChangedEventArgs args)
   bei System.Windows.DependencyObject.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   bei System.Windows.FrameworkElement.OnPropertyChanged(DependencyPropertyChangedEventArgs e)
   bei System.Windows.DependencyObject.NotifyPropertyChange(DependencyPropertyChangedEventArgs args)
   bei System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, Boolean coerceWithCurrentValue, OperationType operationType)
   bei System.Windows.DependencyObject.InvalidateProperty(DependencyProperty dp, Boolean preserveCurrentValue)
   bei System.Windows.Data.BindingExpressionBase.Invalidate(Boolean isASubPropertyChange)
   bei System.Windows.Data.BindingExpression.TransferValue(Object newValue, Boolean isASubPropertyChange)
   bei System.Windows.Data.BindingExpression.Activate(Object item)
   bei System.Windows.Data.BindingExpression.AttachToContext(AttachAttempt attempt)
   bei System.Windows.Data.BindingExpression.MS.Internal.Data.IDataBindEngineClient.AttachToContext(Boolean lastChance)
   bei MS.Internal.Data.DataBindEngine.Task.Run(Boolean lastChance)
   bei MS.Internal.Data.DataBindEngine.Run(Object arg)
   bei MS.Internal.Data.DataBindEngine.OnLayoutUpdated(Object sender, EventArgs e)
   bei System.Windows.ContextLayoutManager.fireLayoutUpdateEvent()
   bei System.Windows.ContextLayoutManager.UpdateLayout()
   bei System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   bei System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   bei System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   bei System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   bei System.Windows.Interop.HwndTarget.OnResize()
   bei System.Windows.Interop.HwndTarget.HandleMessage(WindowMessage msg, IntPtr wparam, IntPtr lparam)
   bei System.Windows.Interop.HwndSource.HwndTargetFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   bei MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   bei System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   bei MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
Ivan Ivanov
Telerik team
 answered on 12 Dec 2012
2 answers
311 views
Hello,

I would like my chart to consists of a LineSeries that does not have labels shown on every node. For this, I have bound the ItemsSource of the LineSeries to an ObservableCollection<MyCrazyLineNode>. MyCrazyLineNode has Properties for the Value, the Category and an additional Property "IsValueVisible".

I tried to accomblish this by setting "ShowLabels" to "False" and define my own labels in the PointTemplate.
My code looks similar to this:
<telerik:LineSeries ItemsSource="{Binding MyCrazyLineNodes}" ValueBinding="Value" CategoryBinding="Category" ShowLabels="False">
  <telerik:LineSeries.PointTemplate>
    <DataTemplate>
      <Grid>
        <Canvas Margin="0,10,0,0" Visibility="{Binding IsValueVisible, [Converter stuff...}">
          <TextBlock Text="{Binding Value}" />
        </Canvas>
        <Path Data="M4,0 L8,4 L4,8 L0,4 Z" Fill="Red" Width="8" Height="8" Stretch="Fill" />
      </Grid>
    </DataTemplate>
  </telerik:LineSeries.PointTemplate>
  <AxisStuffAndSoOn />
</telerik:LineSeries>

However, this does not work, because I cannot bind to the Property IsValueVisible.
How can I do what I want? I hope my problem is understandable. ;-)

Best Regards
Michael
Michael
Top achievements
Rank 2
 answered on 12 Dec 2012
1 answer
138 views
Hi,

I define in my App.xaml this Style to remove the Context Menu from all Panes.

<Style TargetType="{x:Type telerik:RadPane}">
        <Setter Property="ContextMenuTemplate"
                Value="{x:Null}" />
    </Style>

My Panes, which are define in other csprojects and will be loaded by unity still have a context menu.

Can anybody help me with this situation.
Georgi
Telerik team
 answered on 12 Dec 2012
1 answer
313 views
I am evaluating the Telerik controls to see if they will work better for my team than the current Infragistics controls we are using.  So I start writing a sample application that will demonstrate a resource monitor we planned on writing.  My problem is that the chart works for a couple seconds, then stops working, but if I resize the application, it starts working again for a few seconds, then stops.  Here is my Xaml:

<chart:RadCartesianChart Grid.Column="0" Grid.Row="0">
    <chart:RadCartesianChart.HorizontalAxis>
        <telerik:CategoricalAxis FontFamily="Segoe UI" FontSize="12"/>
    </chart:RadCartesianChart.HorizontalAxis>
    <chart:RadCartesianChart.VerticalAxis>
        <chartView:LinearAxis Minimum="0" Maximum="100"/>
    </chart:RadCartesianChart.VerticalAxis>
    <chartView:BarSeries ItemsSource="{Binding LogicalProcessors}" CategoryBinding="DisplayName" ValueBinding="Value">
        <chartView:BarSeries.PointTemplate>
            <DataTemplate>
                <Rectangle Fill="Green"/>
            </DataTemplate>
        </chartView:BarSeries.PointTemplate>
    </chartView:BarSeries>
</chart:RadCartesianChart>

I am binding to an ObservableCollection that contains objects that implement INotifyPropertyChanged.  For my sanity I did this:

<ItemsControl Grid.Column="0" Grid.Row="1" ItemsSource="{Binding LogicalProcessors}">
    <ItemsControl.ItemsPanel>
        <ItemsPanelTemplate>
            <StackPanel/>
        </ItemsPanelTemplate>
    </ItemsControl.ItemsPanel>
    <ItemsControl.ItemTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding Value}"/>
        </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>

I can see the values updating, so I know my events are firing, the Chart just isn't updating.  If needed I can attach the entire project.  Any ideas?
Nikolay
Telerik team
 answered on 12 Dec 2012
2 answers
755 views
Hello,
I'm working on an app where users may switch a theme from within the supported telerik themes (metro, vista, office_black, etc...).
The theme is kept as a preference at user level and restored at login.

Now in order to remain consistent with the current theme in use, I want to avoid using any predifines fixed brushes and use the theme palette instead. So I'm facing 2 problems:

1) Retreiving the current application theme in use.
As I load themes using the documented method:

Application.Current.Resources.MergedDictionaries.Clear()
Dim res1 As ResourceDictionary = New ResourceDictionary()
 res1.Source = New Uri("/Telerik.Windows.Themes.Expression_Dark;component/Themes/System.Windows.xaml", UriKind.RelativeOrAbsolute)
Dim res2 As ResourceDictionary = New ResourceDictionary()
res2.Source = New Uri("/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.xaml", UriKind.RelativeOrAbsolute)
Dim res3 As ResourceDictionary = New ResourceDictionary()
  res3.Source = New Uri("/Telerik.Windows.Themes.Expression_Dark;component/Themes/Telerik.Windows.Controls.Input.xaml", UriKind.RelativeOrAbsolute)
...

       
Application.Current.Resources.MergedDictionaries.Add(res1)
Application.Current.Resources.MergedDictionaries.Add(res2)
Application.Current.Resources.MergedDictionaries.Add(res3)

In order to retreive the current theme I haven't found anything prettier than checking the current merged dictionnaries and extracting the theme name from there:

Dim str As String = My.Application.Current.Resources.MergedDictionaries(1).Source.OriginalString
str = Strings.Mid(str, 25, str.Length)
str = Left(str, str.IndexOf(";"))
'Returns the Theme's name in use


I can do that or just keep track of the current them when it's loaded.
But isn't there any more obvious way of accessing the current theme in use?

2) Using the current Theme pallete
Once I get the theme name, I could decide of an approriate color for the theme in use...
But, for a metro style i have found the following is possible:
Dim colorPalette = MetroColors.PaletteInstance
Dim converter As New System.Windows.Media.BrushConverter
Me.gridStatus.Background = DirectCast(converter.ConvertFromString(colorPalette.AccentColor.ToString), Brush)

I can alter my interface using the colorpalette maincolor, accentcolor, strongColor, etc... and remain consistent with the theme.
How do I get a color pallete's ref of the other themes (Expression_Dark, Vista, Summer, etc...) and achieve the same result.

Many thanks.

Kristoffer
Top achievements
Rank 1
 answered on 12 Dec 2012
3 answers
384 views
I can add a context menu to my tab items as shown below. However, I want all RadTabItems to have this menu - keeping their current theme (user is allowed to switch between themes). How can this be done without repeating this code for each tab item?

<telerik:RadTabControl x:Name="tabControl" Grid.Row="1" VerticalAlignment="Top"
                               DisplayMemberPath="Content" DropDownDisplayMode="Visible" ScrollMode="Viewport">
            <telerik:RadContextMenu.ContextMenu>
                <telerik:RadContextMenu>
                    <telerik:RadMenuItem Header="Do Stuff" />
                </telerik:RadContextMenu>
            </telerik:RadContextMenu.ContextMenu>

Thanks!
Rosen Vladimirov
Telerik team
 answered on 12 Dec 2012
7 answers
721 views
The problem I am having is that I am creating a ContextMenu on the GridViewHeaderRow where I list the column header text with checkboxes so the user can select which ones to display.  When I assign the column.Header with text directly, obviously all I have to do is loop through and get column.Header; however when I don't assign the Header, and let the GridView figure the text by using the DisplayAttribute.ShortName of the bound data members, the column.Header is null.  I know the text must be somewhere, but I can't find it.

Is there some way to determine the ShortName from the GridViewColumn in this scenario?

Thanks in advance,
Steve
Steve
Top achievements
Rank 1
 answered on 11 Dec 2012
10 answers
600 views
Hi,

I use Telerik V2012.1.326.35 and on our customer site, they have a huge cpu problem :( In a RadGridView, we have 1000 items. Simply doing a mouseover (when the data is completely loaded)  the grid cause the cpu going up to 90% (IT'S A CRITICAL SITUATION).

The problem on our customer site is, because they have a slower computer, when they perform a mouveover, when the cpu going up to 90%, the mouse pointer start to hang, move, hang, move and so on...

On my computer, a faster compiter, the cpu is going up to 36%.

In our application we use Telerik Office Blue Theme and the Column/Row virtualization is on. If you suggest me to do somthing with Blen, we don't have it :(

Thank's
Robert
Top achievements
Rank 1
 answered on 11 Dec 2012
2 answers
170 views
Edit:  I posted in the wrong forum, sorry.  I am using ChartView.

1.) I have a barchart with vertical bars.  Data is added to my chart in the elapsed event of a timer.  When I add a new bar to the chart I want it placed on the right side.  As new bars are added, I want existing bars to be pushed to the left. How do I do this please? I tried setting HorizontalAlignment and HorizontalContentAlignment on both the BarSeries and the Horizontal axis but neither works.

2.) I want to set the width of each bar.  I am using GapLength at the moment to make the bars narrower but it does not work as the number of bars added to the chart increases.  More specifically, I want to set the width of each bar and the space between them i.e. margin to some fixed amount and fill the chart from the right as described above.

Thanks,
Sam

Sam
Top achievements
Rank 1
 answered on 11 Dec 2012
2 answers
522 views
I am trying to change the value of a cell in my grid

The xaml is as follows:

<telerik:RadGridView AutoGenerateColumns="False" Margin="12,0,12,12" Name="radGridViewNeedsShipping" SelectionMode="Extended" ShowGroupPanel="False" Height="190" VerticalAlignment="Bottom" MouseDoubleClick="rgvOpenTicket">
            <telerik:RadGridView.Columns>
                <telerik:GridViewDataColumn Header="PO Number" IsReadOnly="True" UniqueName="SerialNumber" />
                <telerik:GridViewDataColumn Header="Customer" IsReadOnly="True" UniqueName="Customer.EntityName" />
                <telerik:GridViewDataColumn Header="Ship By Date" IsReadOnly="True" UniqueName="TransactionDate" DataFormatString="{}{0:MM/dd/yyyy}"/>
                <telerik:GridViewDataColumn Header="Type" IsReadOnly="True" UniqueName="TransactionTypeId"  />
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>


The code to populate the grid is:

private void Window_Loaded(object sender, RoutedEventArgs e)
        {
            
            radGridViewNeedsShipping.ItemsSource = InControlDataAccess.getTransactions(0).Where(i => (i.TransactionTypeId == 11 || i.TransactionTypeId == 12) && (i.HasBeenShipped == null || i.HasBeenShipped == false) && i.InProgress != null && i.InProgress != false).OrderBy(i => i.Id);
           
        }



The TransactionTypeId will be either 11 or 12,

      If TransactionTypeId == 11, then I want to display "Rental" in the Type field

      if TransactionTypeId == 12 then  I want to display "Sales" in the Type field

Also, I want the row to be background color red if TransactionTypeId = 11, and I want the row to be yellow if TransactionTypeId = 12

What would be the best way that I could accomplish this?
Craig
Top achievements
Rank 1
 answered on 11 Dec 2012
Narrow your results
Selected tags
Tags
GridView
General Discussions
Chart
RichTextBox
Docking
ScheduleView
ChartView
TreeView
Diagram
Map
ComboBox
TreeListView
Window
RibbonView and RibbonWindow
PropertyGrid
DragAndDrop
TabControl
TileView
Carousel
DataForm
PDFViewer
MaskedInput (Numeric, DateTime, Text, Currency)
AutoCompleteBox
DatePicker
Buttons
ListBox
GanttView
PivotGrid
Spreadsheet
Gauges
NumericUpDown
PanelBar
DateTimePicker
DataFilter
Menu
ContextMenu
TimeLine
Calendar
Installer and Visual Studio Extensions
ImageEditor
BusyIndicator
Expander
Slider
TileList
PersistenceFramework
DataPager
Styling
TimeBar
OutlookBar
TransitionControl
FileDialogs
Book
ToolBar
ColorPicker
TimePicker
MultiColumnComboBox
SyntaxEditor
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
WatermarkTextBox
DesktopAlert
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
LayoutControl
ProgressBar
Sparkline
TabbedWindow
ToolTip
CloudUpload
ColorEditor
TreeMap and PivotMap
EntityFrameworkCoreDataSource (.Net Core)
HeatMap
Chat (Conversational UI)
VirtualizingWrapPanel
Calculator
NotifyIcon
TaskBoard
TimeSpanPicker
BulletGraph
Licensing
WebCam
CardView
DataBar
FilePathPicker
PasswordBox
SplashScreen
Callout
Rating
Accessibility
CollectionNavigator
Localization
AutoSuggestBox
Security
VirtualKeyboard
HighlightTextBlock
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?