Dear Friends,
I have a windows forms application. I hosted the the "RadTreeView" inside a windows form using an "ElementHost" control. if I click on the treeview item I got an "NullReferenceException" in the "RadTreeView_GotFocus" method. By checking the source code of the method we found the problem.
The "Application.Current" is always null for a WinForms Applicaiton. So an exception throws on the first line of the code. Since It is unhandled It crashed the application.
Is there any workaround or solution to the above problem? I have attched the exception call stack too.
RadTreeView_GotFocus Method Source
-----
private void RadTreeView_GotFocus(object sender, RoutedEventArgs e)
{
if (Application.Current.MainWindow != null)
{
Application.Current.MainWindow.MouseWheel += new MouseWheelEventHandler(this.OnRootVisualMouseWheel);
}
if (e.OriginalSource == this)
{
if (this.SelectedContainer != null)
{
this.SelectedContainer.Focus();
}
else
{
RadTreeViewItem item = base.ItemContainerGenerator.ContainerFromIndex(0) as RadTreeViewItem;
if (item != null)
{
item.Focus();
}
}
}
this.IsSelectionActive = true;
}
Steps To reproduce
1. Create a WinForms Application (Target Framework to .NET 3.5)
1a. Add a reference to these dlls (Telerik.Windows.Controls & Telerik.Windows.Controls.Navigation)
2. Add a WPF UserControl to the project. And add the following XAML.
<telerik:RadTreeView >
<telerik:RadTreeViewItem Header="Sony" >
<telerik:RadTreeViewItem Header="Vaio" />
<telerik:RadTreeViewItem Header="Bravia" />
</telerik:RadTreeViewItem>
</telerik:RadTreeView>
3. Add a "ElementHost" control to the exisiting "Form1 (Windows Form)".
4. Build the project
5. Set the child property of the ElementHost to an instance of the WPF UserControl we created.
6. Build and Run the application.
7. Click over a treeviewitem.
8. The application will crash.
Runtime Details
Windows Vista 32 bit Business Edition
VS.NET 2008 Professional With SP1
.NET Framework 3.5 SP1
Telereik Version : 2009.1.424.35 (both Telerik.Windows.Controls & Telerik.Windows.Controls.Navigation)
The exception call stack.
Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTreeView.RadTreeView_GotFocus(object sender = {Telerik.Windows.Controls.RadTreeView Items.Count:1}, System.Windows.RoutedEventArgs e = {System.Windows.RoutedEventArgs}) + 0x2a bytes
PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) + 0x78 bytes
PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source = {Sony}, System.Windows.RoutedEventArgs args = {System.Windows.RoutedEventArgs}, bool reRaised = false) + 0x1bf bytes
PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender = {Sony}, System.Windows.RoutedEventArgs args = {System.Windows.RoutedEventArgs}) + 0x79 bytes
PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs e) + 0x17 bytes
PresentationCore.dll!System.Windows.UIElement.OnGotFocus(System.Windows.RoutedEventArgs e) + 0x5 bytes
PresentationFramework.dll!System.Windows.FrameworkElement.OnGotFocus(System.Windows.RoutedEventArgs e) + 0x4c bytes
PresentationCore.dll!System.Windows.UIElement.IsFocused_Changed(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e) + 0xa2 bytes
WindowsBase.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) + 0x4a bytes
PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) + 0x50 bytes
WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args) + 0x2c bytes
WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex = {System.Windows.EntryIndex}, System.Windows.DependencyProperty dp = {IsFocused}, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry = {System.Windows.EffectiveValueEntry}, bool coerceWithDeferredReference, System.Windows.OperationType operationType) + 0x515 bytes
WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, System.Windows.OperationType operationType, bool isInternal) + 0x1eb bytes
WindowsBase.dll!System.Windows.DependencyObject.SetValue(System.Windows.DependencyPropertyKey key, object value) + 0x39 bytes
PresentationCore.dll!System.Windows.Input.FocusManager.OnFocusedElementChanged(System.Windows.DependencyObject d, System.Windows.DependencyPropertyChangedEventArgs e) + 0xf0 bytes
WindowsBase.dll!System.Windows.DependencyObject.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) + 0x4a bytes
PresentationFramework.dll!System.Windows.FrameworkElement.OnPropertyChanged(System.Windows.DependencyPropertyChangedEventArgs e) + 0x50 bytes
WindowsBase.dll!System.Windows.DependencyObject.NotifyPropertyChange(System.Windows.DependencyPropertyChangedEventArgs args) + 0x2c bytes
WindowsBase.dll!System.Windows.DependencyObject.UpdateEffectiveValue(System.Windows.EntryIndex entryIndex = {System.Windows.EntryIndex}, System.Windows.DependencyProperty dp = {FocusedElement}, System.Windows.PropertyMetadata metadata, System.Windows.EffectiveValueEntry oldEntry, ref System.Windows.EffectiveValueEntry newEntry = {System.Windows.EffectiveValueEntry}, bool coerceWithDeferredReference, System.Windows.OperationType operationType) + 0x515 bytes
WindowsBase.dll!System.Windows.DependencyObject.SetValueCommon(System.Windows.DependencyProperty dp, object value, System.Windows.PropertyMetadata metadata, bool coerceWithDeferredReference, System.Windows.OperationType operationType, bool isInternal) + 0x1eb bytes
WindowsBase.dll!System.Windows.DependencyObject.SetValue(System.Windows.DependencyProperty dp, object value) + 0x2e bytes
PresentationCore.dll!System.Windows.Input.FocusManager.SetFocusedElement(System.Windows.DependencyObject element, System.Windows.IInputElement value) + 0x2f bytes
PresentationFramework.dll!System.Windows.Input.KeyboardNavigation.UpdateFocusedElement(System.Windows.DependencyObject focusTarget = {Sony}) + 0x32 bytes
PresentationFramework.dll!System.Windows.FrameworkElement.OnGotKeyboardFocus(object sender, System.Windows.Input.KeyboardFocusChangedEventArgs e = {System.Windows.Input.KeyboardFocusChangedEventArgs}) + 0x47 bytes
PresentationCore.dll!System.Windows.Input.KeyboardFocusChangedEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) + 0x34 bytes
PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) + 0x27 bytes
PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) + 0x3e bytes
PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source = {Sony}, System.Windows.RoutedEventArgs args = {System.Windows.Input.KeyboardFocusChangedEventArgs}, bool reRaised = false) + 0x1bf bytes
PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender = {Sony}, System.Windows.RoutedEventArgs args = {System.Windows.Input.KeyboardFocusChangedEventArgs}) + 0x79 bytes
PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs args = {System.Windows.Input.KeyboardFocusChangedEventArgs}, bool trusted) + 0x35 bytes
PresentationCore.dll!System.Windows.Input.InputManager.ProcessStagingArea() + 0x311 bytes
PresentationCore.dll!System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs input) + 0x42 bytes
PresentationCore.dll!System.Windows.Input.KeyboardDevice.ChangeFocus(System.Windows.DependencyObject focus, int timestamp) + 0x63e bytes
PresentationCore.dll!System.Windows.Input.KeyboardDevice.TryChangeFocus(System.Windows.DependencyObject newFocus, System.Windows.Input.IKeyboardInputProvider keyboardInputProvider, bool askOld, bool askNew, bool forceToNullIfFailed) + 0x12b bytes
PresentationCore.dll!System.Windows.Input.KeyboardDevice.Focus(System.Windows.DependencyObject focus, bool askOld, bool askNew) + 0xc2 bytes
PresentationCore.dll!System.Windows.Input.KeyboardDevice.Focus(System.Windows.IInputElement element) + 0x1a bytes
PresentationCore.dll!System.Windows.UIElement.Focus() + 0x1a bytes
Telerik.Windows.Controls.Navigation.dll!Telerik.Windows.Controls.RadTreeViewItem.OnHeaderMouseLeftButtonDown(object sender = {System.Windows.Controls.Grid}, System.Windows.Input.MouseButtonEventArgs e = {System.Windows.Input.MouseButtonEventArgs}) + 0x7f bytes
PresentationCore.dll!System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) + 0x31 bytes
PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) + 0x27 bytes
PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) + 0x3e bytes
PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source = {System.Windows.Controls.Grid}, System.Windows.RoutedEventArgs args = {System.Windows.Input.MouseButtonEventArgs}, bool reRaised = true) + 0x1bf bytes
PresentationCore.dll!System.Windows.UIElement.ReRaiseEventAs(System.Windows.DependencyObject sender = {System.Windows.Controls.Grid}, System.Windows.RoutedEventArgs args = {System.Windows.Input.MouseButtonEventArgs}, System.Windows.RoutedEvent newEvent) + 0x10a bytes
PresentationCore.dll!System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(System.Windows.DependencyObject sender, System.Windows.Input.MouseButtonEventArgs e) + 0x2e bytes
PresentationCore.dll!System.Windows.UIElement.OnMouseDownThunk(object sender, System.Windows.Input.MouseButtonEventArgs e) + 0xde bytes
PresentationCore.dll!System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(System.Delegate genericHandler, object genericTarget) + 0x31 bytes
PresentationCore.dll!System.Windows.RoutedEventArgs.InvokeHandler(System.Delegate handler, object target) + 0x27 bytes
PresentationCore.dll!System.Windows.RoutedEventHandlerInfo.InvokeHandler(object target, System.Windows.RoutedEventArgs routedEventArgs) + 0x3e bytes
PresentationCore.dll!System.Windows.EventRoute.InvokeHandlersImpl(object source = {System.Windows.Controls.TextBlock}, System.Windows.RoutedEventArgs args = {System.Windows.Input.MouseButtonEventArgs}, bool reRaised = false) + 0x1bf bytes
PresentationCore.dll!System.Windows.UIElement.RaiseEventImpl(System.Windows.DependencyObject sender = {System.Windows.Controls.TextBlock}, System.Windows.RoutedEventArgs args = {System.Windows.Input.MouseButtonEventArgs}) + 0x79 bytes
PresentationCore.dll!System.Windows.UIElement.RaiseEvent(System.Windows.RoutedEventArgs args = {System.Windows.Input.MouseButtonEventArgs}, bool trusted) + 0x35 bytes
PresentationCore.dll!System.Windows.Input.InputManager.ProcessStagingArea() + 0x311 bytes
PresentationCore.dll!System.Windows.Input.InputManager.ProcessInput(System.Windows.Input.InputEventArgs input) + 0x42 bytes
PresentationCore.dll!System.Windows.Input.InputProviderSite.ReportInput(System.Windows.Input.InputReport inputReport) + 0x62 bytes
PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.ReportInput(System.IntPtr hwnd, System.Windows.Input.InputMode mode, int timestamp, System.Windows.Input.RawMouseActions actions, int x, int y, int wheel) + 0x2e2 bytes
PresentationCore.dll!System.Windows.Interop.HwndMouseInputProvider.FilterMessage(System.IntPtr hwnd = 591552, int msg = 513, System.IntPtr wParam = 1, System.IntPtr lParam = 589869, ref bool handled = false) + 0x4e1 bytes
PresentationCore.dll!System.Windows.Interop.HwndSource.InputFilterMessage(System.IntPtr hwnd = 591552, int msg = 513, System.IntPtr wParam = 1, System.IntPtr lParam = 589869, ref bool handled = false) + 0x75 bytes
WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd = 591552, int msg = 513, System.IntPtr wParam = 1, System.IntPtr lParam = 589869, ref bool handled = false) + 0xbe bytes
WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) + 0x7a bytes
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback = {Method = {System.Object DispatcherCallbackOperation(System.Object)}}, object args = {MS.Win32.HwndSubclass.DispatcherOperationCallbackParameter}, bool isSingleParameter = true) + 0x8a bytes
WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source = {System.Windows.Threading.Dispatcher}, System.Delegate callback, object args, bool isSingleParameter, System.Delegate catchHandler = null) + 0x4a bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.WrappedInvoke(System.Delegate callback, object args, bool isSingleParameter, System.Delegate catchHandler) + 0x44 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, bool isSingleParameter) + 0x91 bytes
WindowsBase.dll!System.Windows.Threading.Dispatcher.Invoke(System.Windows.Threading.DispatcherPriority priority, System.Delegate method, object arg) + 0x40 bytes
WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd = 591552, int msg = 513, System.IntPtr wParam = 1, System.IntPtr lParam = 589869) + 0xdc bytes
[Native to Managed Transition]
[Managed to Native Transition]
> System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(int dwComponentID, int reason = -1, int pvLoopData = 0) Line 2106 + 0x8 bytes C#
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason = -1, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.ApplicationContext}) Line 3377 + 0x1b bytes C#
System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) Line 3261 + 0xa bytes C#
System.Windows.Forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm) Line 1466 C#
WinAppCS.exe!WinAppCS.Program.Main() Line 18 + 0x1d bytes C#
[Native to Managed Transition]
[Managed to Native Transition]
mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[] args) Line 931 + 0x1f bytes C#
Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() + 0x2b bytes
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) Line 61 + 0xffffffe3 bytes C#
mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) Line 355 + 0xd bytes C#
mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() Line 88 + 0xffffffe4 bytes C#
GridViewComboBoxColumn
from a DataTable<telerik:RadGridView.Columns> |
<telerik:GridViewComboBoxColumn |
DataMemberBinding="{Binding Path=UnitName}" |
DisplayMemberPath="Name" |
SelectedValueMemberPath="ID" |
HeaderText="שם היחידה" |
UniqueName="UnitName" Width="120" /> |
</telerik:RadGridView.Columns> |
</telerik:RadGridView> |
DataTable dt = new DataTable(); |
dt.Columns.Add("UnitName",typeof(int)); |
dt.Rows.Add(1); |
dt.Rows.Add(2); |
((GridViewComboBoxColumn)this.gvLoadingCustomers.Columns["UnitName"]).ItemsSource = GetUnits(); |
gvLoadingCustomers.ItemsSource = dt.DefaultView; |
private DataView GetUnits() |
{ |
DataTable dt = new DataTable(); |
dt.Columns.Add("Id", typeof(int)); |
dt.Columns.Add("Name", typeof(string)); |
dt.Rows.Add(1,"חטיבה בנקאית"); |
dt.Rows.Add(2,"חטיבה מסחרית"); |
dt.Rows.Add(3,"חטיבה עסקית"); |
dt.Rows.Add(4,"GPB"); |
dt.Rows.Add(5,"מת''מ"); |
return dt.DefaultView; |
} |
System.Collections.
IEnumerable
it works, but when I use a dataTable it fail...
Dear Friends,
We are using the RadTreeView in one of our outlook addin application. The Radtreeview works fine in a WPF application. But in the addin it crashes the outlook when a treeview item is clicked.
If I debug I got the follwing error in VS.NET 2008 Debugger.
"An unhandled exception of type 'System.NullReferenceException' occurred in Unknown Module."
The call stack is,
> kernel32.dll!_RaiseException@16() + 0x58 bytes
mscorwks.dll!RaiseTheExceptionInternalOnly() + 0x159 bytes
mscorwks.dll!RaiseTheException() + 0x4e bytes
mscorwks.dll!RaiseTheException() + 0xc0 bytes
mscorwks.dll!RealCOMPlusThrow() + 0x30 bytes
mscorwks.dll!RealCOMPlusThrow() + 0xd bytes
mscorwks.dll!Thread::RaiseCrossContextException() + 0x1ff bytes
mscorwks.dll!Thread::DoADCallBack() + 0x13095b bytes
mscorwks.dll!_UM2MDoADCallBack@16() + 0x7c bytes
0a25847a()
user32.dll!_InternalCallWinProc@20() + 0x23 bytes
user32.dll!_UserCallWinProcCheckWow@32() + 0xb3 bytes
user32.dll!_DispatchMessageWorker@8() + 0xe6 bytes
user32.dll!_DispatchMessageW@4() + 0xf bytes
MSO.DLL!30d11bbe()
[Frames below may be incorrect and/or missing, no symbols loaded for MSO.DLL]
OUTLLIB.DLL!30053fb2()
OUTLOOK.EXE!300012d5()
kernel32.dll!@BaseThreadInitThunk@12() + 0x12 bytes
ntdll.dll!__RtlUserThreadStart@8() + 0x27 bytes
There is no managed stack here.
Is there anyway to solve the problem?
The sample project contain source code and a setup project. Just install the setup project. The addin comes in the bottom of the left naviagtion pane. Click any one of the trreview item. You can see the outlook crashed.
I have uploaded a sample project that reproduce the erorr in the following location.
http://www.4shared.com/file/112645778/c879187b/XInlook.html
Thanks & Regards
Prakash
<Window x:Class="Window2"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window2" Height="300" Width="300" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
<Grid>
<telerik:RadTabControl Name="RadTabControl1">
<telerik:RadTabItem Header="Tab1" Name="tb1">
</telerik:RadTabItem>
<telerik:RadTabItem Header="Tab2" Name="tb2">
</telerik:RadTabItem>
</telerik:RadTabControl>
</Grid>
</
Window>
Partial Public Class Window2
Private Sub Window2_Loaded(ByVal sender As Object, ByVal e As System.Windows.RoutedEventArgs) Handles Me.Loaded
Dim db As New TeachersDataContext
Dim Te = (From t In db.Teachers Select t).ToList
For Each itm As Telerik.Windows.Controls.RadTabItem In RadTabControl1.Items
Dim uc As New UserControl1
uc.ds = Te
uc.SetDG()
itm.Content = uc
Next
End Sub
End
Class
<
UserControl x:Class="UserControl1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
<Grid>
<telerik:RadGridView Name="gvTeachers" telerik:StyleManager.Theme="Summer" AutoGenerateColumns="False" RowIndicatorVisibility="Collapsed" IsReadOnly="True" ShowGroupPanel="False">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn Width="Auto">
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<CheckBox Name="chkIs_Selected" Margin="3" IsChecked="True" ></CheckBox>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewDataColumn>
<telerik:GridViewDataColumn HeaderText="Teacher Name" HeaderTextAlignment="Center" Width="*">
<telerik:GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Text="{Binding Teacher_Full_Name}"></TextBlock>
</DataTemplate>
</telerik:GridViewColumn.CellTemplate>
</telerik:GridViewDataColumn>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</Grid>
</
UserControl>
Partial
Public Class UserControl1
Private _ds As List(Of Teacher)
Public Property ds() As List(Of Teacher)
Get
Return _ds
End Get
Set(ByVal value As List(Of Teacher))
_ds = value
End Set
End Property
Public Sub SetDG()
gvTeachers.ItemsSource = _ds
End Sub
End
Class
UserControl
--------------
Hello, following the post:
http://www.telerik.com/community/forums/wpf/gridview/multi-line-header.aspx
I have a much more simple solution using escape chars, however
,as you can see by running the below example, when I add the
telerik:StyleManager.Theme="Simple"
the last text line of the header (ccc) is not displayed.
Is there a way to overcome it ?
Thanks,
Erez
<Window x:Class="ChangeTelerikGridHeaderSize.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="Window1" Height="333" Width="582" xmlns:telerik="http://schemas.telerik.com/2008/xaml/presentation">
<StackPanel Orientation="Horizontal">
<telerik:RadGridView Name="radGridView1"
ShowGroupPanel="False">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn UniqueName="ABC" HeaderText="aaa bbb ccc" Width="Auto"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
<telerik:RadGridView Name="radGridView2"
telerik:StyleManager.Theme="Simple"
ShowGroupPanel="False">
<telerik:RadGridView.Columns>
<telerik:GridViewDataColumn UniqueName="ABC" HeaderText="aaa bbb ccc" Width="Auto"/>
</telerik:RadGridView.Columns>
</telerik:RadGridView>
</StackPanel>
</Window>
<telerik:GridViewDataColumn Width="25"> |
<telerik:GridViewDataColumn.CellStyle> |
<Style TargetType="telerik:GridViewCell"> |
<Setter Property="Template"> |
<Setter.Value> |
<ControlTemplate TargetType="telerik:GridViewCell"> |
<Button |
Command="{Binding IngredientDeleteCommand}" |
HorizontalAlignment="Center" |
VerticalAlignment="Center"> |
<Image Height="20" Width="20" Source="/CakeBoss.WPF;component/Images/delete.png" /> |
</Button> |
</ControlTemplate> |
</Setter.Value> |
</Setter> |
</Style> |
</telerik:GridViewDataColumn.CellStyle> |
</telerik:GridViewDataColumn> |
Private Sub RadTreeView1_DragEnded(ByVal sender As Object, ByVal e As Telerik.Windows.Controls.RadTreeViewDragEndedEventArgs) Handles RadTreeView1.DragEnded |
Dim newSortOrder As Integer |
Dim parentId As Integer |
Dim draggedItem As RadTreeViewItem = e.DraggedItems(0) |
Dim eStore As eStoreDataDataContext = New eStoreDataDataContext |
If IsNothing(draggedItem.ParentItem) Then |
' no parent then item is root node |
parentId = 0 |
Else |
parentId = draggedItem.ParentItem.Tag.ToString |
End If |
newSortOrder = RadTreeView1.Items.IndexOf(draggedItem) |
MsgBox("parentId = " & parentId.ToString) |
MsgBox("newSortOrder = " & newSortOrder.ToString) |
End Sub |