Telerik Forums
UI for WPF Forum
5 answers
1.9K+ views

I have the following GridView with the questionable checkbox column. Is there any way to add a command to the checkbox IsChecked property, like an event?

The TestCommand is implemented in the viewmodel and it is working well with a button.

 

<telerik:RadGridView x:Name="SelectedStrategyGroup1_Adjustments_GV"
                     Width="233" Height="214" Canvas.Left="2" Canvas.Top="0" RowHeight="22"
                     AutoGenerateColumns="False"
                     ShowGroupPanel="False" RowIndicatorVisibility="Collapsed"
                     ItemsSource="{Binding VMAdjustmentCollection1, Mode=TwoWay}"
                     ignore:SourceUpdated="SelectedStrategyGroup1_Adjustments_GV_SourceUpdated"
                     >
 
    <telerik:RadGridView.Columns>
        <telerik:GridViewCheckBoxColumn DataMemberBinding="{Binding IsContained, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" Header="S" Width="22" HeaderTextAlignment="Center" TextAlignment="Center" EditTriggers="CellClick" AutoSelectOnEdit="True">
            <telerik:GridViewCheckBoxColumn.CellTemplate>
                <DataTemplate>
                    <CheckBox IsChecked="{Binding IsContained,Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
                              Command="{Binding Path=TestCommand}"
                              ignore:CommandParameter="{Binding Path=IsChecked, RelativeSource={RelativeSource Self}}"/>
                </DataTemplate>
            </telerik:GridViewCheckBoxColumn.CellTemplate>
        </telerik:GridViewCheckBoxColumn>
...         
    </telerik:RadGridView.Columns>
 
</telerik:RadGridView>

 

Jonathan
Top achievements
Rank 1
 answered on 25 Mar 2019
2 answers
318 views
Hi. I have a RadGridView with column groups. I use a method - ToExcelML for export, but he doesn't support column groups and exports only grid columns. Can there be a way to enable grouping support? Or maybe there is another export method in which there is support for grouping?
Martin Ivanov
Telerik team
 answered on 25 Mar 2019
3 answers
923 views

My end goal is to trigger fading colour animation on a row when any of its data is updated to signal update to the user. To do that, a style was created:

01.<UserControl.Resources>
02.        <stl:EventsTreeRowStyle x:Key="ETRStyle">
03.            ...
04.            <stl:EventsTreeRowStyle.UpdatedStyle>
05.                <Style TargetType="telerik:GridViewRow">
06.                    <Style.Triggers>
07.                        <EventTrigger RoutedEvent="Binding.TargetUpdated">
08.                            <BeginStoryboard>
09.                                <Storyboard>
10.                                    <ColorAnimation Storyboard.TargetProperty="(DataGridRow.Background).(SolidColorBrush.Color)"
11.                                                        Duration="00:00:10"
12.                                                        From="Gold" To="White"/>
13.                                </Storyboard>
14.                            </BeginStoryboard>
15.                        </EventTrigger>
16.                    </Style.Triggers>
17.                </Style>
18.            </stl:EventsTreeRowStyle.UpdatedStyle>
19.        </stl:EventsTreeRowStyle>
20.    </UserControl.Resources>
21.    <Grid>
22.        <telerik:RadTreeListView ItemsSource="{Binding EventsTree}" Style="{StaticResource TelerikTreeListViewStyle}"
23.                                 RowStyleSelector="{StaticResource ETRStyle}">
24.            <telerik:RadTreeListView.ChildTableDefinitions>
25.                <telerik:TreeListViewTableDefinition ItemsSource="{Binding Children}"/>
26.            </telerik:RadTreeListView.ChildTableDefinitions>
27.            <telerik:RadTreeListView.Columns>
28.                <telerik:GridViewDataColumn Width="4*" DataMemberBinding="{Binding Details}" Header="Details"/>
29.                ...
30.            </telerik:RadTreeListView.Columns>
31.        </telerik:RadTreeListView>
32.    </Grid>

 

However it looks like like Binding.TargetUpdated is never triggered. Is there any other way to do this?

Martin Ivanov
Telerik team
 answered on 25 Mar 2019
2 answers
184 views

WHAT I HAVE:

Currently I have a ganttview where the user can control the time span (Controlled using ###.PixelLength) that is visible in the ganttview window (not the total visibleRange).

WHAT I AM LOOKING TO DO:

I am trying to get a the timespan the user can "see", not scroll through. For instance, if the ganttview covers from 1/3/2015 12:45AM to 4/11/2025 however the graph is zoomed (using PixelLength) such that only a window from, say, 2/2/2017 7:45PM to 2/2/2017 9:56PM is visible. I want to be able to get the timespan associated with 2/2/2017 7:45PM to 2/2/2017 9:56PM not the entire visible range.

MY LAST ATTEMPT

From what I have seen I am only able to generate a IDateRange associated with the ###.VisibleRange.

 

Thanks

Chris
Top achievements
Rank 1
 answered on 25 Mar 2019
3 answers
170 views

We are using the validation IDataErrorInfo in my Gridviews and with the version 2019.1 when the cell that generates the error is hiding with the property isVisible in the xaml, or making the window smaller and hiding the column in which the cell that generates the error is , the error mark  and row color disappears in the rows that generate it.

With the previous versions this did not happen.

I have verified that this courre with the example of the sdk ValidationIDataErrorInfo.

Waiting for a response

Vladimir Stoyanov
Telerik team
 answered on 25 Mar 2019
3 answers
202 views

Dear all,

 

I'm using an expression editor bound against an object which is constructed via emit IL at runtime due to localizing the fields, we're using version 2014.3.1305.40.
A user now reports that he gets a null ref exception when changing an expression involving datetimes, the following stacktrace is available:
Top-level Exception
Type:        System.NullReferenceException
Message:     Object reference not set to an instance of an object
Source:      Telerik.Windows.Documents
Stack Trace:
   at Telerik.Windows.Documents.HierarchicalIndex.GetBoxByHierarchicalIndex(DocumentLayoutBox documentBox, HierarchicalIndex hierarchicalIndex) in c:\TB\534\Sources\Documents\Flow\Core\DocumentPosition\HierarchicalIndex.cs:line 131
   at Telerik.Windows.Documents.DocumentPosition.RestorePositionFromBoxIndex(Nullable`1 raiseEvent) in c:\TB\534\Sources\Documents\Flow\Core\DocumentPosition\DocumentPosition.cs:line 447
   at Telerik.Windows.Documents.Model.RadDocumentEditor.InsertTextInternal(String text, Span currentSpanStyle, Boolean explicitAcceptsReturn) in c:\TB\534\Sources\Documents\Flow\Core\Model\RadDocumentEditor_Editing.cs:line 2104
   at Telerik.Windows.Documents.Model.RadDocumentEditor.InsertFromUI(String text, Span currentSpanStyle, Boolean acceptsReturn) in c:\TB\534\Sources\Documents\Flow\Core\Model\RadDocumentEditor_Editing.cs:line 2072
   at Telerik.Windows.Controls.RadRichTextBox.Telerik.Windows.Documents.UI.ITextInputCommandsHandler.InsertText(String text) in c:\TB\534\Sources\Documents\Flow\Core\UI\RadRichTextBox.cs:line 7599
   at Telerik.Windows.Documents.UI.CaretTextInputHandler.InsertText(String text) in c:\TB\534\Sources\Documents\Flow\Core\UI\Caret\CaretTextInputHandler.cs:line 344
   at Telerik.Windows.Documents.UI.CaretTextInputHandler.HandleTextInsertedWithoutIme(RadDocument document, String text) in c:\TB\534\Sources\Documents\Flow\Core\UI\Caret\CaretTextInputHandler.cs:line 171
   at Telerik.Windows.Documents.UI.CaretTextInputHandler.CaretUI_TextInserted(Object sender, TextInsertedEventArgs e) in c:\TB\534\Sources\Documents\Flow\Core\UI\Caret\CaretTextInputHandler.cs:line 90
   at Telerik.Windows.Documents.UI.Caret.OnTextInserted(Object sender, TextInsertedEventArgs e) in c:\TB\534\Sources\Documents\Flow\Core\UI\Caret\Caret_Common.cs:line 278
   at Telerik.Windows.Documents.UI.Caret.Timer_Tick(Object sender, EventArgs e) in c:\TB\534\Sources\Documents\Flow\Core\UI\Caret\Caret_Common.cs:line 259
   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)

Could you please provide some insights? I'm not able to reproduce the problem on my machine (only once) and fear that it might be a "race condition" involving events in the UI. What I can tell is that it happens when adjusting the date and time part of the expression according to the user, I've seen it multiple times live on screen and was able to invoke it once on my machine. The steps he did were these, he always positions the cursor by using the mouse after the value to change and uses backspace to remove the number and then types the new number, eg position after first 1 in 11, remove the first 1 by using backspace and then typing 0:

Expression at start, via binding:
(Fromdate >= #11/05/2016 06:00:00# And Todate <= #12/05/2016 06:00:00#)

Intermediate:
(Fromdate >= #1/05/2016 06:00:00# And Todate <= #12/05/2016 06:00:00#)

Intermediate:
(Fromdate >= #01/05/2016 06:00:00# And Todate <= #12/05/2016 06:00:00#)

Intermediate:
(Fromdate >= #01/0/2016 06:00:00# And Todate <= #12/05/2016 06:00:00#)

Intermediate:
(Fromdate >= #01/04/2016 06:00:00# And Todate <= #12/05/2016 06:00:00#)

Intermediate:
(Fromdate >= #01/04/2016 6:00:00# And Todate <= #12/05/2016 06:00:00#)

Intermediate:
(Fromdate >= #01/05/2016 16:00:00# And Todate <= #12/05/2016 06:00:00#)

Intermediate:
(Fromdate >= #01/05/2016 06:00:00# And Todate <= #2/05/2016 06:00:00#)

Intermediate:
(Fromdate >= #01/05/2016 06:00:00# And Todate <= #02/05/2016 06:00:00#)

Intermediate:
(Fromdate >= #01/05/2016 06:00:00# And Todate <= #02/0/2016 06:00:00#)

Changing May to April invokes the exception when typing the 4:
(Fromdate >= #01/05/2016 06:00:00# And Todate <= #12/04/2016 06:00:00#)

 

Hope you can help me out with this one since it's bugging the user for quite some time now.

 

Kind regards,
Dwight

Dilyan Traykov
Telerik team
 answered on 25 Mar 2019
1 answer
290 views

While using the RadNumericUpDown control in our product we want a global way to disable the scroll wheel functionality that increases/decreases the value by a given step.

RadMaskedNumericInput is easy...

 

<Setter Property="SpinMode" Value="None" />

 

But I cant find anything for a global style to disable this functionality.

Is there something I might be missing or is there no way in a style to achieve this like there is with the masked numeric input

Dilyan Traykov
Telerik team
 answered on 25 Mar 2019
1 answer
570 views

Hello I posted a question here: https://www.telerik.com/forums/gridviewcheckboxcolumn-checkbox-command#zvPzrS8xrECwPcG1wGYRTA and realized afterwards that the thread might be closed. Anyroad, I have a problem similar to the original poster. My ApprovalStatusEditCommand is not being fired. Also, as a side note, the DataMemberBinding is not necessary. Even without it the "IsChecked" bindings seem to be updating the object - even though the "IsApproved" is underlined (in Visual Studio) as "cannot resolve."

Any help resolving this would be much appreciated. Basically, I'm trying to execute a command if a checkbox (in a radgridview) is checked.

Kind regards,

Jonathan

P.S. I'm sorry if I created a duplicate post, but all my research has not really helped me work around this.

<telerik:GridViewDataColumn Header="Approved"                                                     DataMemberBinding="{Binding IsApproved, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"                                                     Width="Auto"                                                     MinWidth="75"                                                     EditTriggers="CellClick"                                                     IsFilterable="False">                        <telerik:GridViewDataColumn.CellTemplate>                            <DataTemplate>                                <telerik:GridViewCheckBox IsChecked="{Binding IsApproved, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />                            </DataTemplate>                        </telerik:GridViewDataColumn.CellTemplate>                        <telerik:GridViewDataColumn.CellEditTemplate>                            <DataTemplate>                                <CheckBox IsChecked="{Binding IsApproved, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"                                     Command="{Binding ApprovalStatusEditCommand, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" />                            </DataTemplate>                        </telerik:GridViewDataColumn.CellEditTemplate>                    </telerik:GridViewDataColumn>
Jonathan
Top achievements
Rank 1
 answered on 22 Mar 2019
4 answers
156 views

Hi!

When creating a diagram with too many items with AutoLayout, it seems there is a maximum width the diagram will grow to.

Which causes a weird behavior of the items being places vertically.

 

Is it possible to set the width of the available space for the auto layout?

 

I've added a screenshot demonstrating the behavior.

 

Thanks!

Tulio
Top achievements
Rank 1
 answered on 22 Mar 2019
3 answers
235 views

Method to reproduce 
(telerik version 2018.1.220)

  1. Create a structure that has enum with [Flags] attribute as members
  2. Set the array of the above structure to SourceItems of RadPropertyGrid
  3. Set "Intersection" or "Union" for "PropertySetMode" of "RadProeprtyGrid"
  4. Run the application
  5. Changing enum member flags from PropertyGrid with FlagEnumEditor will not be applied.
    In addition, the following exception occurs when changing the flag

---
Exception thrown: 'System.InvalidCastException' in mscorlib.dll
Exception thrown: 'System.InvalidCastException' in mscorlib.dll
Exception thrown: 'System.Reflection.TargetInvocationException' in mscorlib.dll
System.Windows.Data Error: 8 : Cannot save value from target back to source. BindingExpression:Path=CurrentPropertySet[Types]; DataItem='PropertySetViewModel' (HashCode=30131813); target element is 'FlagEnumEditor' (Name=''); target property is 'Value' (type 'Object') InvalidCastException:'System.InvalidCastException: 'System.String' から 'enum_flags_test.MainWindow+EnumTest+Type' への無効なキャストです。
   System.Convert.DefaultToType(IConvertible value, Type targetType, IFormatProvider provider)
   System.String.System.IConvertible.ToType(Type type, IFormatProvider provider)
   System.Convert.ChangeType(Object value, Type conversionType, IFormatProvider provider)
   Telerik.Windows.Controls.RadPropertyGrid.<>c__DisplayClass2b.<OnPropertySetViewModelChanged>b__28(Object s, PropertyChangedEventArgs e)
   System.ComponentModel.PropertyChangedEventHandler.Invoke(Object sender, PropertyChangedEventArgs e)
   Telerik.Windows.Controls.Data.PropertyGrid.PropertySet.OnPropertyChanged(String fileName)
   Telerik.Windows.Controls.Data.PropertyGrid.PropertySet.set_Item(String property, Object value)'

---

Is there any workaround? 
Your help would be welcomed.

 

---

MainWindow.xaml.cs

public partial class MainWindow : Window
{
    public class EnumTest
    {
        [Flags]
        public enum Type
        {
            None = 0,
            First = 1 << 0,
            Second = 1 << 1,
        }
 
        public Type Types { get; set; } = Type.None;
    }
 
 
    public MainWindow()
    {
        InitializeComponent();
 
        PropertyGrid1.Item = new EnumTest[] { new EnumTest() };
    }
}

 

MainWindow.xaml

<Window x:Class="enum_flags_test.MainWindow"
        xmlns:local="clr-namespace:enum_flags_test"
        mc:Ignorable="d"
        Title="MainWindow" Height="450" Width="800">
        <telerik:RadPropertyGrid
            x:Name="PropertyGrid1"
            PropertySetMode="Intersection"/>
    </Grid>
</Window>

 


Dilyan Traykov
Telerik team
 answered on 22 Mar 2019
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?