or
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>
<
telerik:RadDateTimePicker
SelectedValue
=
"{Binding TheVisitDateTime, Mode=TwoWay}"
/>
@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.
exec
schma.CompleteClientVisit @iVisitID = 1, @dVisitDateTime =
'2011-11-22 15:47:00'
, ...other params...
<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.
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]
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'.
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