Telerik Forums
UI for WPF Forum
0 answers
60 views
i am displaying two columns in the grid view and their visibilities (i.e. IsVisible Property) are controlled by corresponding check boxes. Also i have applied a count function in first column. so first time when i run the application it showing all the columns successfully but if i do Isvisible property of first column to false and then load the gridview with new data it shows an error in the handler of the INotifyPropertyCanhged Interface.

And the error is: "Object reference not set to an instance of an object."


please help me out.,....
public partial class PlaybackView : UserControl, INotifyPropertyChanged
    {
 
        int _count = 0;
 
        public PlaybackView()
        {
            InitializeComponent();
        }
 
 
        #region Properties
 
        public DataTable PlaybackTable
        {
            get { return (DataTable)GetValue(PlaybackTableProperty); }
            set
            {
                SetValue(PlaybackTableProperty, value);
            }
 
        }
 
        // Using a DependencyProperty as the backing store for DataTable.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty PlaybackTableProperty = DependencyProperty.Register("PlaybackTable", typeof(DataTable), typeof(PlaybackView));
 
        //private static void OnPresentableTableChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        //{
        //    PlaybackView playbackView = d as PlaybackView;
 
        //    if (playbackView != null)
        //    {
 
        //        playbackView.PlaybackLogView = new ListCollectionView(playbackView.PlaybackTable.DefaultView);
        //    }
        //}
 
 
        public List<string> GroupBy
        {
            get { return (List<string>)GetValue(GroupByTextProperty); }
            set
            {
                SetValue(GroupByTextProperty, value);
 
            }
        }
 
        public static readonly DependencyProperty GroupByTextProperty = DependencyProperty.Register("GroupBy", typeof(List<string>), typeof(PlaybackView), new UIPropertyMetadata(null, OnGroupByPropertyChanged));
 
        private static void OnGroupByPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            //PlaybackView playbackView = d as PlaybackView;
 
            //if (playbackView != null)
            //{
            //    playbackView.PlaybackLogView.GroupDescriptions.Add(new PropertyGroupDescription(playbackView.GroupBy));
                
            //}
        }
 
        #endregion
 
 
 
        #region INotifyPropertyChanged Members
 
        public event PropertyChangedEventHandler PropertyChanged;
 
        protected void OnPropertyChanged(string name)
        {
            PropertyChangedEventHandler handler = PropertyChanged;
            if (handler != null)
            {
                handler(this, new PropertyChangedEventArgs(name));
            }
        }
 
        #endregion
 
        private void telrikDataGrid_DataLoading(object sender, Telerik.Windows.Controls.GridView.GridViewDataLoadingEventArgs e)
        {
            if (GroupBy.Count > 0)
            {
                if (_count > 0)
                {
                    this.telrikDataGrid.GroupDescriptors.Clear();
                }
 
                ColumnGroupDescriptor descriptor = new ColumnGroupDescriptor();
                descriptor.Column = this.telrikDataGrid.Columns[GroupBy[0]];
                this.telrikDataGrid.GroupDescriptors.Add(descriptor);
                ++_count;
 
            }
 
        }
 
    }
 
 
-------------------------------------------XAMl Code----------------------------------------------
 
 <Grid>
 
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
 
        <Button  Content="Load Data" HorizontalAlignment="Right" Click="Button_Click" />
        <CheckBox x:Name="_check" Grid.Row="1" Content="Visibility" IsChecked="True"/>
 
        <telerik:RadGridView  Grid.Row="2" x:Name="_telerikGrid" ShowColumnFooters="True"  AutoGenerateColumns="False" ItemsSource="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=Table}">
 
            <telerik:RadGridView.Columns>
 
 
                <telerik:GridViewDataColumn Header="PresentationName" DataMemberBinding="{Binding PresentationName}">
                </telerik:GridViewDataColumn>
 
                <telerik:GridViewDataColumn Header="LogLevel" DataMemberBinding="{Binding LogLevel}" IsVisible="{Binding ElementName=_check, Path=IsChecked}">
                    <telerik:GridViewDataColumn.AggregateFunctions>
                        <telerik:CountFunction Caption="Total Rows"/>
                    </telerik:GridViewDataColumn.AggregateFunctions>
                </telerik:GridViewDataColumn>
 
            </telerik:RadGridView.Columns>
        </telerik:RadGridView>
 
 
    </Grid>
Vinod
Top achievements
Rank 1
 asked on 26 Nov 2011
1 answer
176 views
I'm new to the RadDateTimePicker and I'm wondering if the control can allow me to
round the SelectedValue to the minute (to effectively zero-out the seconds and milliseconds portion).

<telerik:RadDateTimePicker SelectedValue="{Binding TheVisitDateTime, Mode=TwoWay}"/>

I need it for calling a stored procedure with a SMALLDATETIME Parameter (which I'm not allowed to change).
So before I consider writing a ValueConverter for this, I need to know if the RadDateTimePicker control exposes a property for rounding to the minute ?

Right now the milliseconds is being passed to the stored procedure which is causing a conversion error.
(because the @dVisitDateTime is SMALLDATETIME data type).

exec schma.CompleteClientVisit @iVisitID = 1, @dVisitDateTime = '2011-11-22 15:47:10.25039', ...other params...
Msg 8114, Level 16, State 1, Procedure CompleteClientVisit, Line 0
Error converting data type varchar to smalldatetime.

My goal is to call the stored procedure such as below to avoid the conversion error.
exec schma.CompleteClientVisit @iVisitID = 1, @dVisitDateTime = '2011-11-22 15:47:00', ...other params...
Konstantina
Telerik team
 answered on 25 Nov 2011
4 answers
139 views
Hi,

I would like to customize the DayViewDefinition in behind code (VB). When my app start, the information will be get from the database. Now the only way I found to do it...is in XAML...
<Horaire:DayViewDefinition DayStartTime="06:00"
                          DayEndTime="23:00"    
                           MajorTickLength
="1h"    
                           MinorTickLength
="5min"    
                           TimerulerMinorTickStringFormat
=":{0:mm} "                                                                
                           TimerulerMajorTickStringFormat
="{}{0:HH}:{0:mm} "    
                           MinTimeRulerExtent
="4000"/>

Thanks for you help.

Patrick
Top achievements
Rank 2
 answered on 25 Nov 2011
0 answers
93 views
i have a grid view that contain rad combo box as column.
how can i bind rad combo box into wpf grid view from code behind using VB
vikas gupta
Top achievements
Rank 1
 asked on 25 Nov 2011
2 answers
111 views
We have a problem with the RadGridView, when we have at our top level a collection full of "GroupDto"'s..
Below this we have "GroupMemberDto" Items...

so in our list we potentially have for example...

- GroupDto 1
          - GroupMemberDto 1
          - GroupMemberDto 2
+ GroupDto 2
- GroupDto 2
          - GroupMemberDto 3
          - GroupMemberDto 4
          - GroupMemberDto 5
          - GroupMemberDto 6
- GroupDto 4


So the problem occurs, when we have a top level item selected say "GroupDto1" and "GroupMemberDto1" selected....

then the problem occurs if we try to sort by one of the fields on GroupMemberDto... we get the following error
"Unable to cast object of type 'BusinessPort.Agility.Core.Shared.DataTransferObjects.GroupMemberDto' to type 'BusinessPort.Agility.Core.Shared.DataTransferObjects.GroupDto'."

a copy of the call stack we get is...

Telerik.Windows.Data.dll!Telerik.Windows.Data.FuncExtensions.ToUntypedFunc<BusinessPort.Agility.Core.Shared.DataTransferObjects.GroupDto,string>.AnonymousMethod__0(object item) Line 24 + 0x34 bytes   C#
Telerik.Windows.Data.dll!Telerik.Windows.Data.FunctionComparer.Compare(object x, object y) Line 34 + 0x1c bytes C#
[External Code]
Telerik.Windows.Data.dll!Telerik.Windows.Data.KeyedCollection.IndexOf(object value) Line 224 + 0x1e bytes   C#
Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.InternalIndexOf(object item) Line 1745 + 0x1a bytes   C#
Telerik.Windows.Data.dll!Telerik.Windows.Data.QueryableCollectionView.IndexOf(object item) Line 1735 + 0xc bytes    C#
Telerik.Windows.Data.dll!Telerik.Windows.Data.DataItemCollection.IndexOf(object value) Line 386 + 0x19 bytes    C#
Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollIntoViewRecursive(System.Windows.FrameworkElement element, System.Collections.Generic.Stack<object> itemStack, System.Action<System.Windows.FrameworkElement> scrollFinishedCallback, System.Action scrollFailedCallback) Line 309 + 0x19 bytes   C#
Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollRowIntoViewInternal(object dataItem, System.Action<System.Windows.FrameworkElement> scrollFinishedCallback, System.Action scrollFailedCallback) Line 254  C#
Telerik.Windows.Controls.GridView.dll!Telerik.Windows.Controls.GridView.GridViewDataControl.ScrollIntoViewAsync.AnonymousMethod__57() Line 95 + 0x2a bytes  C#
[External Code]

And some further details...

 
Locating source for 'c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Scrolling.cs'. Checksum: MD5 {b7 2f 2f f ce 2e 64 af 4c 3d 12 d7 27 d7 88 35}
The file 'c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Scrolling.cs' does not exist.
Looking in script documents for 'c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Scrolling.cs'...
Looking in the projects for 'c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Scrolling.cs'.
The file was not found in a project.
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\crt\src\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\mfc\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\src\atl\'...
Looking in directory 'C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\atlmfc\include\'...
The debug source files settings for the active solution indicate that the debugger will not ask the user to find the file: c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Scrolling.cs.
The debugger could not locate the source file 'c:\TB\102\WPF_Scrum\Release_WPF_40\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.Scrolling.cs'.

Hope this all makes sense, Let me know if you have any suggestions on how we can solve this, or if you require further information?

Vlad
Telerik team
 answered on 25 Nov 2011
2 answers
82 views
Hi,
  When I group a GridViewCheckBoxColumn. the gridview show groupdescriptor as "true" or "false", i want show "Yes" and "No". How can i change that title?

Thanks
Gerardo
Top achievements
Rank 1
 answered on 25 Nov 2011
1 answer
144 views
Hello,

I have some controls which contains each a raddocking.
I navigate to each other, then i save docking states on unload controls and reload layout on load controls.

When i save, floatting panel, after the relaoding, the window (toolwindow that contains pane) is no more topmost.

(the only pane that works as excpected is the one this is in a RadSplitContainer  where InitialPosition is "FloatingOnly".

Aurore
George
Telerik team
 answered on 25 Nov 2011
3 answers
342 views

Hi,

I have a experienced a lot af problems when using SelectionUnit FullRow. The CurrentCell property does not seem to be in sync all the time with the SelectedCells / SelectedRow properties. I have frequent cases where this happens but these are difficult to reproduce.
I have one case though were I could always reproduce this: when cancelling the selection in the SelectionChanging event. When doing so the CurrentCell is still set to another row and when clicking this same cell a second time there are no Selection events any more.

I use version 2011.2.920.40 of the Telerik WPF library.

A sample solution can be downloaded here.

Sébastien

Dimitrina
Telerik team
 answered on 25 Nov 2011
1 answer
140 views
Hi there,

Is there a way to replace the AppointmentsSource warning text?
Can I do that without the need to implement a custom ScheduleView theme?

Here is my situation - I have a RadScheduleView that is bound to the VM for Appointments.
When I load my form, the VM takes about 5 seconds to fetch the Appointment data.
Everything looks good and works fine after the 5 seconds load.
But, in the first 5 seconds there is a big "Please provide AppointmentsSource" and I don't know how to customize that message.

I hope to show a "Loading..." message instead of the default AppointmentsSource warning text.

Any ideas on a good approach for this situation?

Thanks in advance.
Dani
Telerik team
 answered on 25 Nov 2011
1 answer
165 views
Hi 

I'm using trial version of WPF controls (Q3 2011) and trying to implement custom appointment style as it described here
It works well until I want to resize an appointment (please see attached screenshot). The problem is that if I use custom AppointmentStyleSelector I can't resize Appointment rectangle by dragging top or bottom edge anymore, right and left edges are highlighted for resizing instead. Usage of OrientedAppointmentItemStyleSelector as AppointmentStyleSelector leads to the same results.
So could you please help me to figure out how to fix that issue?

Here is a link to the demo project http://dl.dropbox.com/u/3950376/TelerikAppointmentStyle.zip

Thanks,
Alexander
Dani
Telerik team
 answered on 25 Nov 2011
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
Slider
Expander
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
WebCam
CardView
DataBar
Licensing
FilePathPicker
PasswordBox
Rating
SplashScreen
Accessibility
Callout
CollectionNavigator
Localization
AutoSuggestBox
HighlightTextBlock
Security
TouchManager
StepProgressBar
VirtualKeyboard
Badge
OfficeNavigationBar
ExpressionParser
CircularProgressBar
SvgImage
PipsPager
SlideView
AI Coding Assistant
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?