This is a migrated thread and some comments may be shown as answers.

[Solved] Wpf userContorl Multiple Select

4 Answers 131 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
wenyue
Top achievements
Rank 1
wenyue asked on 23 Oct 2010, 09:20 AM
while i Multiple Select userContorl   or RadGridView Multiple Select rows  is   error  System.NullReferenceException

"   在 System.Windows.Automation.Peers.AutomationPeer.EnsureChildren()\r\n
在 System.Windows.Automation.Peers.AutomationPeer.GetChildren()\r\n 
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n 
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n 
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n 
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n 
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n 
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.isDescendantOf(AutomationPeer parent)\r\n 
在 System.Windows.Automation.Peers.AutomationPeer.ValidateConnected(AutomationPeer connectedPeer)\r\n
在 System.Windows.Automation.Peers.AutomationPeer.AutomationPeerFromInputElement(IInputElement focusedElement)\r\n 
在 System.Windows.Automation.Peers.AutomationPeer.RaiseFocusChangedEventHelper(IInputElement newFocus)\r\n
在 System.Windows.Input.KeyboardDevice.ChangeFocus(DependencyObject focus, Int32 timestamp)\r\n
在 System.Windows.Input.KeyboardDevice.TryChangeFocus(DependencyObject newFocus, IKeyboardInputProvider keyboardInputProvider, Boolean askOld, Boolean askNew, Boolean forceToNullIfFailed)\r\n
在 System.Windows.Input.KeyboardDevice.Focus(DependencyObject focus, Boolean askOld, Boolean askNew)\r\n
在 System.Windows.Input.KeyboardDevice.Focus(IInputElement element)\r\n 
在 System.Windows.UIElement.Focus()\r\n 
在 Telerik.Windows.Controls.GridView.EditContext.OnCellMouseDown(GridViewCell cell)
位置 c:\\Builds\\WPF_Scrum\\Release_WPF\\Sources\\Development\\Controls\\GridView\\GridView\\GridView\\Editing\\EditContext.cs
:行号 292\r\n
在 Telerik.Windows.Controls.GridView.GridViewCell.OnMouseLeftButtonDown(MouseButtonEventArgs e)
位置 c:\\Builds\\WPF_Scrum\\Release_WPF\\Sources\\Development\\Controls\\GridView\\GridView\\GridView\\Cells\\GridViewCell.cs:行号 370\r\n
在 System.Windows.UIElement.OnMouseLeftButtonDownThunk(Object sender, MouseButtonEventArgs e)\r\n
在 System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)\r\n
在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)\r\n
在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)\r\n
在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)\r\n
在 System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)\r\n 
在 System.Windows.UIElement.CrackMouseButtonEventAndReRaiseEvent(DependencyObject sender, MouseButtonEventArgs e)\r\n 
在 System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)\r\n
在 System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)\r\n
在 System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)\r\n 
在 System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)\r\n
在 System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)\r\n
在 System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)\r\n
在 System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)\r\n
在 System.Windows.Input.InputManager.ProcessStagingArea()\r\n 
在 System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)\r\n
在 System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)\r\n
在 System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)\r\n 
在 System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)\r\n  
在 System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)\r\n
在 MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)\r\n
在 MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)\r\n
在 System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Boolean isSingleParameter)\r\n
在 System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)\r\n 
在 System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)\r\n 
在 System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)\r\n  
在 System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)\r\n 
在 MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)\r\n  
在 MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)\r\n 
在 System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)\r\n
在 System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)\r\n
在 System.Windows.Threading.Dispatcher.Run()\r\n 
在 System.Windows.Application.RunDispatcher(Object ignore)\r\n 
在 System.Windows.Application.StartDispatcherInBrowser(Object unused)"

4 Answers, 1 is accepted

Sort by
0
wenyue
Top achievements
Rank 1
answered on 23 Oct 2010, 09:21 AM
Please Help me
0
Milan
Telerik team
answered on 25 Oct 2010, 07:14 AM

Hi wenyue,

Is it possible to obtain the source code of the application that produces this error? Also, it would be great if you could give us the exact steps to reproduce the exception 



Sincerely yours,
Milan
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
wenyue
Top achievements
Rank 1
answered on 25 Oct 2010, 07:34 AM
Thank you for answer me.

compiler  can't  fixed position the error site ,

xaml:
<UserControl x:Class="ZhuLuManage.CtlTable"
    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"
     Width="800">
    <Grid Name="myGrid">
    <GroupBox Header="" Width="800" VerticalAlignment="Top" HorizontalAlignment="Left">
        <Grid HorizontalAlignment="Left"  Width="800">
            <WrapPanel Name="wrMore"  Width="800">
                <TextBlock Height="10" Width="200" HorizontalAlignment="Left"></TextBlock>
                <telerik:RadMenu Height="25" VerticalAlignment="Top" HorizontalAlignment="Left" Name="toolMenu"  Width="700" Margin="0,5,100,0" >
                    <telerik:RadMenuItem ToolTip="新建" Name="btnNew" Click="btnNew_Click">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="/Images/newSmall.png"/>
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem ToolTip="删除" Name="btnDel"  Click="btnDel_Click">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="/Images/delete.png"/>
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem ToolTip="上移" Name="btnUp"  Click="btnUp_Click">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="/Images/move_up.png"/>
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                    <telerik:RadMenuItem ToolTip="下移" Name="btnDown"  Click="btnDown_Click">
                        <telerik:RadMenuItem.Icon>
                            <Image Source="/Images/move_down.png"/>
                        </telerik:RadMenuItem.Icon>
                    </telerik:RadMenuItem>
                </telerik:RadMenu>
                <telerik:RadGridView Name="TabGrid" Margin="0,0,100,10" ShowGroupPanel="False" SelectionMode="Extended" IsFilteringAllowed="False"  IsReadOnly="False"
                   CanUserSortColumns="False" AutoGenerateColumns="False"  CellEditEnded="TabGrid_CellEditEnded" ColumnWidth="50" Height="200" VerticalAlignment="Top" HorizontalAlignment="Left" Width="700">
                    </telerik:RadGridView>
            </WrapPanel>
        </Grid>
    </GroupBox>
        </Grid>
</UserControl>

Data Bind from behind 

this  userControl  be used in other WrapPanel   ,when I  Multiple-Select  , Error display .(the gridview  has Three Datas )

I fine when I select Tow UseControl or more  is error  same . The error   isn't  at every turn
  

0
Yordanka
Telerik team
answered on 25 Oct 2010, 11:54 AM
Hi wenyue,

You can find my answer in the other forum thread.

Best wishes,
Yordanka
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
GridView
Asked by
wenyue
Top achievements
Rank 1
Answers by
wenyue
Top achievements
Rank 1
Milan
Telerik team
Yordanka
Telerik team
Share this question
or