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.
Unfortunately, activation email could not send to your email. Please try again.

Error in CurrentCellCloseDropDown

Thread ID:

Created:

Updated:

Platform:

Replies:

39531 Jan 10,2006 12:15 PM Jan 12,2006 08:43 PM Windows Forms 2
loading
Tags: GridControl
Administrator [Syncfusion]
Asked On January 10, 2006 12:15 PM

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,

code0.zip

stanleyj [Syncfusion]
Replied On January 12, 2006 11:37 AM

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 12, 2006 08:43 PM

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,

CONFIRMATION

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.

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.

;