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

GridViewComboBoxColumn commit issue

7 Answers 200 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Dharmavaram
Top achievements
Rank 1
Dharmavaram asked on 19 Jan 2017, 11:33 AM

Hi,

 I have one column in RadGridview With combobox once I click on add new row , select a item  in combobox and click somewhere in grid the value is not committing .Only when I select other row or click on the row header it is committing.I want to commit my cell data once I lose focus from that cell.How to achieve it??

Regards,

Nagasree.

 

7 Answers, 1 is accepted

Sort by
0
Stefan Nenchev
Telerik team
answered on 20 Jan 2017, 12:10 PM
Hello Nagasree,

With a proper setup, it would be expected to save the value on focus lost by default. I have attached a sample project for your reference. Can you please share more information on your scenario? Do you use a RadComboBox within a CellTemplate or you use the GridViewComboBoxColumn implementation? Do you set the NewRowPosition of the RadGridView to add a new row?

Regards,
Stefan Nenchev
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Dharmavaram
Top achievements
Rank 1
answered on 23 Jan 2017, 03:09 AM

Hi Stefan,

  In the sample application also the Datepicker will not commit even after I clicked in the empty space of the grid.It is committing only when I change selection to some other row or column.please fine the attached image files.

I want to commit and make cell to be in default once user goes out of the cell and click anywhere 

 

0
Dharmavaram
Top achievements
Rank 1
answered on 23 Jan 2017, 03:10 AM
Iam using RadGridview Combocolumn not the template.
0
Stefan Nenchev
Telerik team
answered on 25 Jan 2017, 02:45 PM
Hello Nagasree,

Actually, such behavior is expected as the RadGridView is in edit mode and the values will be committed when the RowEditEnded event is fired. If you would like to commit the values when clicking on a field that is within the same row but does not present a cell that has a value, you can apply the following:
public MainWindow()
       {
           InitializeComponent();
           this.AddHandler(GridViewRow.PreviewMouseDownEvent, new RoutedEventHandler(onMouseDown));
       }
 
       private void onMouseDown(object sender, RoutedEventArgs e)
       {
           if ((e.OriginalSource as UIElement).ParentOfType<GridViewCell>() == null)
           {
               clubsGrid.CommitEdit();
           }
       }
Please give it a try in your actual application and update me if there are some issues.

Regards,
Stefan Nenchev
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
0
Dharmavaram
Top achievements
Rank 1
answered on 02 Feb 2017, 11:51 AM

Hi Stefan,

   I have only one column in the grid so I can't use what u said but I tried to keep that in mouse leave and lostfocus but I am facing issue when we open combo and leave out of the grid.I am attaching the exception.

at Telerik.Windows.Controls.AutoClosePopupWrapper.set_IsOpen(Boolean value)
   at Telerik.Windows.Controls.AutoClosePopupWrapper.OnMouseLeftButtonDown(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent)
   at System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e)
   at System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
   at System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel)
   at System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
   at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
   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)
   at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
   at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
   at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
   at System.Windows.Window.ShowHelper(Object booleanBox)
   at System.Windows.Window.Show()
   at System.Windows.Window.ShowDialog()
   at Intergraph.UX.WPF.Toolkit.UxtWindow.ShowDialog()
   at SmartUITestExplorer.FrmMainForm.InvokeAliasActionForm()

 

I am sending the image of my grid.Actually I want a DataControl with Combobox.Here my workflow will be I have to select a value in a list from combobox Items. Once I select it should be committed because another grid will be updated with values based on the committed value in first grid.If the value in first grid is not committed when I try to edit in Second grid null reference exception is coming.

I should commit the value in the first list once we select value in combobox.Is there any alternate control which satisfy my purpose?

Any help is much appreciated as my completely blocked.

 

Regards,

Nagasree

0
Dharmavaram
Top achievements
Rank 1
answered on 02 Feb 2017, 11:54 AM

Hi stefan,

I have another doubt when ActionOnLostFocus property to be used.I tried to use it but it also not helped me.So just want to know about it.

Regards,

Nagasree

0
Stefan Nenchev
Telerik team
answered on 06 Feb 2017, 01:07 PM
Hello Nagasree,

Would it be possible to provide a sample that shows your setup so we can provide more concrete answers? Generally, utilizing the LostFocus event is not recommended as the RadGridView uses it internally for some operations. 

Regards,
Stefan Nenchev
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
GridView
Asked by
Dharmavaram
Top achievements
Rank 1
Answers by
Stefan Nenchev
Telerik team
Dharmavaram
Top achievements
Rank 1
Share this question
or