We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Error in CurrentCellCloseDropDown

Thread ID:





39531 Jan 10,2006 05:15 PM UTC Jan 13,2006 01:43 AM UTC WinForms 2
Tags: GridControl
Administrator [Syncfusion]
Asked On January 10, 2006 05:15 PM UTC

Hi, I am using GDBG. For one of the column I have ‘ComboBox’ as cell type. I have attached the code related to the ‘CurrentCellCloseDropDown’ event. Problem: When I am at the very last row of the grid (basically new row which doesn’t have any data) and click the dropdown button for that cell but I don’t select anything from the list. I see the list but don’t select any value from list. After clicking on the dropdown button of the cell I click somewhere else which Triggers the ‘CurrentCellCloseDropDown’ event and I get the following error. Type: System.ArgumentOutOfRangeException Message: Specified argument was out of the range of valid values. Parameter name: Index was out of range. Must be non-negative and less than the size of the collection. Stack Trace: at System.Collections.CollectionBase.System.Collections.IList.get_Item(Int32 index) at FOX.FBC.Planning.PL.PlanningClient.DepartmentBudget.SalaryAdjustmentsUserControl.ValidatePayTypeCode(String& validationMessage) in c:\development\application\fox\fbc\planning\1.0\source\pl\planningclient\departmentbudget\salaryadjustmentsusercontrol.cs:line 880 at FOX.FBC.Planning.PL.PlanningClient.DepartmentBudget.SalaryAdjustmentsUserControl.dgEmployees_CurrentCellCloseDropDown(Object sender, PopupClosedEventArgs e) in c:\development\application\fox\fbc\planning\1.0\source\pl\planningclient\departmentbudget\salaryadjustmentsusercontrol.cs:line 851 at Syncfusion.Windows.Forms.Grid.GridControlBase.OnCurrentCellCloseDropDown(PopupClosedEventArgs e) at Syncfusion.Windows.Forms.Grid.GridControlBase.RaiseCurrentCellCloseDropDown(PopupClosedEventArgs e) at Syncfusion.Windows.Forms.Grid.GridDropDownCellImp.DropDownContainerCloseDropDown(Object sender, PopupClosedEventArgs e) at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.DropDownContainerCloseDropDown(Object sender, PopupClosedEventArgs e) at Syncfusion.Windows.Forms.Grid.GridComboBoxCellRenderer.ChildClosing(IPopupChild childUI, PopupCloseType popupCloseType) at Syncfusion.Windows.Forms.PopupControlContainer.OnCloseUp(PopupClosedEventArgs args) at Syncfusion.Windows.Forms.PopupControlContainer.HidePopup(PopupCloseType popupCloseType) at Syncfusion.Windows.Forms.PopupControlContainer.VeryifyMouseBasedDeactivation(Control destinationControl, Int32 msg) at Syncfusion.Windows.Forms.PopupControlContainer.ProcessMouseMessage(Control destination, Int32 msg) at Syncfusion.Windows.Forms.PopupControlContainer.Syncfusion.Windows.Forms.INeedMouseMoveMessages.MouseMessage(Message& m) at Syncfusion.Windows.Forms.PopupManager.PreFilterMessage(Message& m) Source: mscorlib Please suggest what can I do to prevent this error. Probably I am getting this error due the fact the row is new and I didn’t select from list and trying to validate value in ‘CurrentCellCloseDropDown’ event. Thanks,


stanleyj [Syncfusion]
Replied On January 12, 2006 04:37 PM UTC

Hi Vs, I do not see this error. Just an analyze may help you. If the CurrentCellCloseDropDown be raised as you said in the AddNew row, ValidatePayTypeCode will return true, because cc.Renderer.ControlValue and this.dgEmployees[cc.RowIndex, cc.ColIndex].CellValue are nothing and the are the same, so the statement of execution leaves this block. if(cc.Renderer.ControlValue != this.dgEmployees[cc.RowIndex, cc.ColIndex].CellValue) { } Best regards, Stanley

Administrator [Syncfusion]
Replied On January 13, 2006 01:43 AM UTC

If I commented out the following lines of code from the event then everything is working fine, so it is proven that error is caused by the ValidatePayTypeCode method call. string validationMessage; if (!this.ValidatePayTypeCode(out validationMessage)) { this.dgEmployees.CurrentCell.CancelEdit(); this.dgEmployees.Binder.CancelEdit(); MessageBox.Show(validationMessage); } Please help. Thanks,


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon