Telerik Forums
UI for WPF Forum
1 answer
237 views
I've searched for a while but cannot seem to find a clear answer that works for the issue. I have a datagrid that is entirely auto generated. To this I added a context menu for right clicks when the cell is not in editable mode (see below). I would like to use the same menu when the cell is in edit mode i.e. I want to override the default context menu. I've tried various options including adding a CellEditTemplate in the code behind but this does not work because I need to reference the instance of the context menu in a non static (not sealed) context and templates only appear to want to work in a static/sealed context. What should I be doing?

<telerik:RadGridView x:Name="dataGridView" Margin="5,10,5,5"
    AutoGenerateColumns="True"
    AutoGeneratingColumn="DataGridView_AutoGeneratingColumn"
    ...other options....>
    <telerik:RadGridView.ContextMenu>
        <ContextMenu x:Name="gridContextMenu">
            <MenuItem x:Name="clearCellMenuItem" Header="Clear Cell" />
            <MenuItem x:Name="clearRowMenuItem" Header="Clear Row" />
            <MenuItem x:Name="clearAllMenuItem" Header="Clear All" />
            <Separator x:Name="separatorMenuItem" />
            <MenuItem x:Name="copyMenuItem" Command="Copy" Header="_Copy" />
            <MenuItem x:Name="pasteMenuItem" Command="Paste" Header="_Paste" />
        </ContextMenu>
    </telerik:RadGridView.ContextMenu>
</telerik:RadGridView>

Thanks

Colin
Yoan
Telerik team
 answered on 29 Apr 2013
2 answers
368 views
Hello,

I was trying to build up the DataTemplate for the HierarchyChildTemplate in my code.

As example the one from the online documentation http://www.telerik.com/help/wpf/gridview-how-to-access-child-gridview.html
<telerik:RadGridView Name="gridView" ItemsSource="{Binding Person}">
<telerik:RadGridView.ChildTableDefinitions>
<telerik:GridViewTableDefinition />
</telerik:RadGridView.ChildTableDefinitions>
<telerik:RadGridView.HierarchyChildTemplate>
<DataTemplate>
<telerik:RadGridView ItemsSource="{Binding Children}" Name="childGrid" ShowGroupPanel="False" />
</DataTemplate>
</telerik:RadGridView.HierarchyChildTemplate>
</telerik:RadGridView>

I tried something like:
gridView.HierarchyChildTemplate =
                new DataTemplate(
                        new RadGridView
                        {
                            ShowGroupPanel = false,
                            IsReadOnly = true,
                            ItemsSource = new Binding("Children")
                        });

But i set the dataType in that constructor and not same property like in the xaml. What's the property i need to set?

Thanks.


Jerome
Top achievements
Rank 1
 answered on 29 Apr 2013
3 answers
161 views
Hi,

I use ScheduleView in a WPF Application and I've got a problem running it on a Tablet PC : When the application starts, an exception is thrown indefinitely :
System.ArgumentNullException: La valeur ne peut pas être null.
Nom du paramètre : collection
   à System.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   à System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   à Telerik.Windows.Automation.Peers.RadDateTimePickerAutomationPeer.GetChildrenCore()
   à System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()
   à System.Windows.Automation.Peers.AutomationPeer.UpdateChildren()
   à System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   à System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   à System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   à System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   à System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   à System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   à System.Windows.Automation.Peers.AutomationPeer.UpdateSubtree()
   à System.Windows.ContextLayoutManager.fireAutomationEvents()
   à System.Windows.ContextLayoutManager.UpdateLayout()
   à System.Windows.ContextLayoutManager.UpdateLayoutCallback(Object arg)
   à System.Windows.Media.MediaContext.InvokeOnRenderCallback.DoWork()
   à System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks()
   à System.Windows.Media.MediaContext.RenderMessageHandlerCore(Object resizedCompositionTarget)
   à System.Windows.Media.MediaContext.RenderMessageHandler(Object resizedCompositionTarget)
   à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)
   à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)

I use the 2012.2.0912.35 version of telerik components on Framework 3.5.

Can you help me with this ?

Thanks
Philippe
Ventzi
Telerik team
 answered on 29 Apr 2013
4 answers
85 views
is this telerik tilelist can be resize and the position is it can be preserved after the closed? any option..
Juzailie
Top achievements
Rank 2
 answered on 29 Apr 2013
2 answers
132 views
Hi,

Is there a property to control the size of the filter window?.  The buttons at the bottom (i.e. Clear Filter) as not visible.  It appears that there are to many item shown in the list with the check boxes.  I am using a split screen with the gridview getting about half the space.  If I give the grid more screen space it works ok.  Of course this is not acceptable.  For your information I am using a Dynamic Class Object for ItemsSource and creating the columns programatically.

Thanks
Rich
Richard Harrigan
Top achievements
Rank 1
 answered on 28 Apr 2013
10 answers
231 views
Was hoping the forum users could put a few different needle styles out here.
MarkInTexas
Top achievements
Rank 1
 answered on 27 Apr 2013
1 answer
253 views
Hi, I'm binding my ChartView to RadObservableCollection in a ViewModel, but I'm getting exceptions about trying to add to collection during CollectionChanged event handler working.
I'm suspending collection's notifications and resume them after adding element, but still getting this error (btw, only when chart becoming visible). Doing that from separate thread through Dispatcher.Invoke, also tried without that - not helping.
There are about 5-10 add operations per second. Can be more, can be less sometimes.
I was even trying to lock collection with locker object and then with (Collection as ICollection).SyncRoot. It doesn't help, only changing exception to InvalidArgumentException (index is out of range).
So, I'm frustrated
<telerik:RadCartesianChart x:Name="Chart"
                                   EmptyContent="Нет данных"
                                   Grid.Row="0"
                                   Grid.Column="0"
                                   Grid.ColumnSpan="2">
            <telerik:RadCartesianChart.Grid>
                <telerik:CartesianChartGrid MajorLinesVisibility="None"
                                            StripLinesVisibility="XY">
                    <telerik:CartesianChartGrid.YStripeBrushes>
                        <SolidColorBrush Color="SlateGray" />
                        <SolidColorBrush Color="SlateGray"
                                         Opacity="0.8" />
                    </telerik:CartesianChartGrid.YStripeBrushes>
                </telerik:CartesianChartGrid>
            </telerik:RadCartesianChart.Grid>
            <telerik:RadCartesianChart.VerticalAxis>
                <telerik:LinearAxis Minimum="0"
                                    MajorStep="5"
                                    Maximum="100"
                                    FontFamily="Segoe UI"
                                    FontSize="16"
                                    FontWeight="Bold"
                                    HorizontalLocation="Left"
                                    ElementBrush="Black" />
            </telerik:RadCartesianChart.VerticalAxis>
            <telerik:RadCartesianChart.HorizontalAxis>
                <telerik:DateTimeContinuousAxis MajorStepUnit="Minute"
                                                LabelInterval="10"
                                                FontFamily="Segoe UI"
                                                PlotMode="OnTicks"
                                                LabelFormat="HH:mm:ss.f"
                                                Minimum="{Binding HeatStartTime}"
                                                Maximum="{Binding HeatEndTime}" />
            </telerik:RadCartesianChart.HorizontalAxis>
            <telerik:LineSeries CategoryBinding="Time"
                                ValueBinding="CO"
                                ItemsSource="{Binding GasAnalysisChartData}"
                                Stroke="Red"
                                StrokeThickness="2">
            </telerik:LineSeries>
            <telerik:LineSeries CategoryBinding="Time"
                                ValueBinding="H2"
                                ItemsSource="{Binding GasAnalysisChartData}"
                                Stroke="Lime"
                                StrokeThickness="2">
            </telerik:LineSeries>
            <telerik:LineSeries CategoryBinding="Time"
                                ValueBinding="N2"
                                ItemsSource="{Binding GasAnalysisChartData}"
                                Stroke="Black"
                                StrokeThickness="2">
            </telerik:LineSeries>
            <telerik:LineSeries CategoryBinding="Time"
                                ValueBinding="O2"
                                ItemsSource="{Binding GasAnalysisChartData}"
                                Stroke="Blue"
                                StrokeThickness="2">
            </telerik:LineSeries>
            <telerik:LineSeries CategoryBinding="Time"
                                ValueBinding="Ar"
                                ItemsSource="{Binding GasAnalysisChartData}"
                                Stroke="Fuchsia"
                                StrokeThickness="2">
            </telerik:LineSeries>
            <telerik:LineSeries CategoryBinding="Time"
                                ValueBinding="CO2"
                                ItemsSource="{Binding GasAnalysisChartData}"
                                Stroke="Yellow"
                                StrokeThickness="2">
            </telerik:LineSeries>
        </telerik:RadCartesianChart>

private void ProcessGasAnalysisDataPiece(FlexEvent fex)
        {
            lock ((GasAnalysisChartData as ICollection).SyncRoot)
            {
                var gdata = new GasAnalysisChartDataModel
                {
                    Ar = (double)fex.Arguments["Ar"],
                    CO = (double)fex.Arguments["CO"],
                    CO2 = (double)fex.Arguments["CO2"],
                    H2 = (double)fex.Arguments["H2"],
                    N2 = (double)fex.Arguments["N2"],
                    O2 = (double)fex.Arguments["O2"],
                    Time = fex.Time
                };
                GasAnalysisChartData.SuspendNotifications();
                GasAnalysisChartData.Add( gdata );
                GasAnalysisChartData.ResumeNotifications();
            }
Sergey
Top achievements
Rank 1
 answered on 27 Apr 2013
0 answers
139 views
Hi telerik:
     View:
<Window.Resources>
        <HierarchicalDataTemplate x:Key="TreeItemTemplate" ItemsSource="{Binding Children}">
            <TextBlock Text="{Binding Header}" />
        </HierarchicalDataTemplate>
        <Style TargetType="telerik:RadTreeViewItem">
            <Setter Property="IsExpanded" Value="true" />
            <Setter Property="IsSelected" Value="{Binding Selected, Mode=TwoWay}" />
            <Setter Property="IsExpanded" Value="{Binding Expanded, Mode=TwoWay}" />
            <Setter Property="IsEditable" Value="{Binding IsEditable, Mode=TwoWay}"/>
            <Setter Property="IsInEditMode" Value="{Binding IsInEditMode, Mode=TwoWay}"/>
        </Style>
    </Window.Resources>
    <Grid>
        <StackPanel>
            <Button Content="Add" Margin="0,20" Width="40" HorizontalAlignment="Left" Click="Button_Click"></Button>
        <telerik:RadTreeView Grid.Row="1" IsEditable="True"
                telerik:AnimationManager.IsAnimationEnabled="False" ItemsSource="{Binding Items}"
                ItemTemplate="{StaticResource TreeItemTemplate}"
                             ScrollViewer.VerticalScrollBarVisibility="Auto"/>
        </StackPanel>
    </Grid>


When I Add a Item,set the IsInEditMode=true,click the Add button continuously,the last time added item,the Name will be null

why?

Bill
Top achievements
Rank 1
 asked on 27 Apr 2013
1 answer
70 views
So I've dragged a RadRichTextBox onto a window, and decided to see what properties are available to me for the control, but looking at them in the Properties window in VS 2012. When I get to the point of clicking on the Miscellaneous section I get an error (please see attached). I've tried this in more than 1 new project, and it does it consistently. Why? What's going on?

I'm working with Telerik.Windows.Controls runtime version 4.0.30319. And version number: 2012.3.1017.45
Vasil
Telerik team
 answered on 26 Apr 2013
1 answer
218 views
Hello,

Today, I added support for multiple selection in our tool. We are using the WPF RadPropertyGrid. 

So we modified the control to use :
SelectionMode="Multiple" and PropertySetMode="Intersection".

I am using the EditorTemplateSelector to select a custom editor for some class types such as "Point".

Before I did this when the PropertyGrid is in single selection mode:

if (item as PropertyDefinition != null && (item as PropertyDefinition).SourceProperty.PropertyType == typeof(System.Windows.Point))
{
return PointPropertyDataTemplate;
}

Now, with multiple selection, the SourceProperty.PropertyType is always of type System.Object. I understand it is now pointing to a dynamic model but it is still be important to keep the original type somewhere else in the parameter. It doesn't make sense to me to add a massive switch case with ALL (over 400) parameters hardcoded "names", and this create software very hard to maintain. I've read that you are working on the Editor Template Attribute that we could set in code but still I want to rely on the class type for single and multiple selection to avoid filling code with redundant attribute.

Do you have any suggestion for this? 

Also, having new converters for every class type when using multiple selection is also making my software filled with dozens of converter classes. Why is multiple selection absolutely require this as the property of every selected object is of the same type.

Thank you

Simon
Ivan Ivanov
Telerik team
 answered on 26 Apr 2013
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
Book
FileDialogs
ToolBar
ColorPicker
TimePicker
SyntaxEditor
MultiColumnComboBox
VirtualGrid
Wizard
ExpressionEditor
NavigationView (Hamburger Menu)
DesktopAlert
WatermarkTextBox
BarCode
SpellChecker
DataServiceDataSource
EntityFrameworkDataSource
RadialMenu
ChartView3D
Data Virtualization
BreadCrumb
ProgressBar
Sparkline
LayoutControl
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
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
VirtualKeyboard
HighlightTextBlock
Security
TouchManager
StepProgressBar
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?