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.

RowLeave and RowEnter events.

Thread ID:

Created:

Updated:

Platform:

Replies:

15631 Jun 23,2004 01:58 PM Jun 29,2004 01:44 PM Windows Forms 7
loading
Tags: GridControl
kstoj
Asked On June 23, 2004 01:58 PM

I''m using the GridDataBoundGrid and I am subscribing to the RowLeave and RowEnter events to do some data manipulation. I noticed that when I move from or to "read only" cell these events aren''t triggered. Why??? How can I detect the row selection change without these eevnts??

Administrator [Syncfusion]
Replied On June 23, 2004 04:36 PM

I tried to see this problem in this sample. The blue column is readonly, and the RowEnter and RowLeave events fire as you move form one row to another in that column. What are you doing differently? ColNameSample_5868.zip

kstoj
Replied On June 24, 2004 10:58 AM

Hi! Thanks for the replay. Well in our grid we are doing many involved things. GridBoundColumns are created and then added as a range to the Grid. The data for the columns comes from different places, the columns have styles applied to them so some of them are drop down lists. Some columns have a ReadOnly property set to true, some represent the data Properties with the "getter" only. Any way when you example works find, I can''t make the RowLeave and RowEnter events to triggere reliably in our grid. The events don''t occure when moving to or from the "read only" columns ( as stated before ).

Administrator [Syncfusion]
Replied On June 24, 2004 11:42 AM

Can you post a sample showing things not working? Are you setting e.Cancel = ture in any event that may cancel the moving of a cell, like CurrentCellMoving, CurrentCellDeactivating, CurrentCellActivaating, CurrentCellvalidating, etc? Do you have our source code? If so, you can use the Assembly Manager to build a debug version of our libraries, and try to debug into our code to spot what the event is not firing in your application.

kstoj
Replied On June 29, 2004 12:40 PM

I can''t post the code sample. But I have more informations about this problem. I run a simple test and I have noticed that when I apply custom defined style to the columns I have described problem without the styles defined all mentioned events trigger properly. Unfortunate thing is that we need to have specific custom styles applied to columns. Any ideas??

kstoj
Replied On June 29, 2004 12:48 PM

Here is the code in which we set the column styles: for( int i = 0; i < this.gridColumns.Length; i++ ) { string map; map = gridColumns[i].MappingName; switch( map ) { case "FieldWorkerID": CollectorUserDataCollection userData = new CollectorUserDataCollection(false); ArrayList dataSource = userData.SetupCollectorList(); gridColumns[i].StyleInfo.CellType = "ComboBox"; gridColumns[i].StyleInfo.CellValueType = typeof(string); gridColumns[i].StyleInfo.DisplayMember = "UserName"; gridColumns[i].StyleInfo.ValueMember = "UserID"; gridColumns[i].StyleInfo.DataSource = dataSource; gridColumns[i].StyleInfo.DropDownStyle = Syncfusion.Windows.Forms.Grid.GridDropDownStyle.Editable; gridColumns[i].StyleInfo.ShowButtons = Syncfusion.Windows.Forms.Grid.GridShowButtons.ShowCurrentRow; break; case "FieldDeviceID": manageDailyAssignments = new ManageDailyAssignments(); FieldDeviceCollection fieldDevices = manageDailyAssignments.FieldDeviceCollection; gridColumns[i].StyleInfo.CellType = "ComboBox"; gridColumns[i].StyleInfo.CellValueType = typeof(string); gridColumns[i].StyleInfo.DisplayMember = "SerialNumber"; gridColumns[i].StyleInfo.ValueMember = "SerialNumber"; gridColumns[i].StyleInfo.DataSource = fieldDevices; gridColumns[i].StyleInfo.DropDownStyle = Syncfusion.Windows.Forms.Grid.GridDropDownStyle.Editable; gridColumns[i].StyleInfo.ShowButtons = Syncfusion.Windows.Forms.Grid.GridShowButtons.ShowCurrentRow; break; case "LoadGroup": manageDailyAssignments = new ManageDailyAssignments(); WorkAssignmentLoadGroupCollection loadGroups = manageDailyAssignments.LoadGroupCollection; gridColumns[i].StyleInfo.CellType = "ComboBox"; gridColumns[i].StyleInfo.CellValueType = typeof(string); gridColumns[i].StyleInfo.DisplayMember = "LoadGroup"; gridColumns[i].StyleInfo.ValueMember = "LoadGroup"; gridColumns[i].StyleInfo.DataSource = loadGroups; gridColumns[i].StyleInfo.DropDownStyle = Syncfusion.Windows.Forms.Grid.GridDropDownStyle.Editable; gridColumns[i].StyleInfo.ShowButtons = Syncfusion.Windows.Forms.Grid.GridShowButtons.ShowCurrentRow; break; case "WorkFilterName": manageDailyAssignments = new ManageDailyAssignments(); WorkFilterCollection workFilters = manageDailyAssignments.WorkFilterCollection; gridColumns[i].StyleInfo.CellType = "ComboBox"; gridColumns[i].StyleInfo.CellValueType = typeof(string); gridColumns[i].StyleInfo.DisplayMember = "WorkFilterName"; gridColumns[i].StyleInfo.ValueMember = "WorkFilterName"; gridColumns[i].StyleInfo.DataSource = workFilters; gridColumns[i].StyleInfo.DropDownStyle = Syncfusion.Windows.Forms.Grid.GridDropDownStyle.Editable; gridColumns[i].StyleInfo.ShowButtons = Syncfusion.Windows.Forms.Grid.GridShowButtons.ShowCurrentRow; break; case "SplitType": manageDailyAssignments = new ManageDailyAssignments(); splitTypes = new ArrayList(); for( int k = 0; k < this.manageDailyAssignments.SplitTypes.Count; k++ ) { //TODO: the ComboBoxItem is in ManageCodes, this may be a useful class to put in a common area splitTypes.Add(new ComboBoxItem(k, manageDailyAssignments.SplitTypes[k].Translation)); } gridColumns[i].StyleInfo.CellType = "ComboBox"; gridColumns[i].StyleInfo.CellValueType = typeof(int); gridColumns[i].StyleInfo.DisplayMember = "DisplayMember"; gridColumns[i].StyleInfo.ValueMember = "ValueMember"; gridColumns[i].StyleInfo.DataSource = splitTypes; gridColumns[i].StyleInfo.DropDownStyle = Syncfusion.Windows.Forms.Grid.GridDropDownStyle.Editable; gridColumns[i].StyleInfo.ShowButtons = Syncfusion.Windows.Forms.Grid.GridShowButtons.ShowCurrentRow; break; case "WorkSetID": manageDailyAssignments = new ManageDailyAssignments(); WorkSetCollection routes = manageDailyAssignments.GetWorkSetCollections(); gridColumns[i].StyleInfo.CellType = "ComboBox"; gridColumns[i].StyleInfo.CellValueType = typeof(string); gridColumns[i].StyleInfo.DisplayMember = "WorkSetID"; gridColumns[i].StyleInfo.ValueMember = "WorkSetID"; gridColumns[i].StyleInfo.DataSource = routes; gridColumns[i].StyleInfo.DropDownStyle = Syncfusion.Windows.Forms.Grid.GridDropDownStyle.Editable; gridColumns[i].StyleInfo.ShowButtons = Syncfusion.Windows.Forms.Grid.GridShowButtons.ShowCurrentRow; break; case "Cycle": gridColumns[i].StyleInfo.ReadOnly = true; gridColumns[i].StyleInfo.Enabled = false; break; } }

Administrator [Syncfusion]
Replied On June 29, 2004 01:35 PM

A couple of comments on your code. You are setting one style to be ReadOnly, and then immediately trying to set same style to be Enabled = false. Unless you have grid.IgnoreReadOnly set to true while you do this, setting a style readonly will normally prevent it form being modified after that. (ReadOnly also applies to trying to set style properties from code.) So, that Enabled = false may not be being set in your code. One other comment. If you have a column set Enabled = false, then you clicking on that column will not cause the currentcell to move as a disabled cell cannot become the current cell. Is clicking one of these disabled cells when you see the RowLeave and RowEnter events not fire? If so, then that is by design. If this is the case, then you might consider making the cells Static CellType as this would allow them to become the current cell( no Enabled = false setting required), and still not be editable.

Administrator [Syncfusion]
Replied On June 29, 2004 01:44 PM

Thanks. That was it.

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.

;