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

Strange problem in GridDataBoundGrid

Thread ID:





32502 Aug 2,2005 03:31 PM UTC Aug 9,2005 06:40 PM UTC WinForms 17
Tags: GridControl
Santha Kumar
Asked On August 2, 2005 03:31 PM UTC

In my project we are using syncfusion control (GridDataBoundGrid). Our requirement was to select a company in the combo box and add additional details in the next grid cell. at the same time user should be able to add multiple rows and in each row company name will be selected from the combo box and additional details are entered in the other cells. Here we are facing a problem when the user is trying to delete a row by using the delete key in keyboard. For e.g.. There are 3 rows are there in the grid. User is trying to delete first row. User is able to delete the first row successfully. Additionally in the next row, combobox value is getting vanished from the grid without user intervention. Kindly help us in resolving this problem.

Administrator [Syncfusion]
Replied On August 2, 2005 05:05 PM UTC

What version of our libraries are you using? There are two properties that you can try various combinations of setting to see if they will avoid the problem you are seeing. They are: this.gridDataBoundGrid1.OptimizeInsertRemoveCells = false; this.gridDataBoundGrid1.UseListChangedEvent = false; Try these settings first. And then try them both true. And then mix their values.

Santha Kumar
Replied On August 3, 2005 09:42 AM UTC

Library version are Version Runtime Version v1.1.4322 As you had mentioned, I tried for two properties (OptimizeInsertRemoveCells & UseListChangedEvent) with various combination. But I could not get the desired result. For e.g.. In the grid, there are 3 columns. 1st column is combo box, 2nd and 3rd are textbox. There are 4 rows in the grid. When user try to delete (using delete key) the first row, he is able to delete the first row successfully. At the same time, combobox value in the 2nd row is getting cleard. We tried the following as a workaroud. In the ROWSDELETED event handler, we set the focus to another control in the form. Then we found that it was not clearing the combobox value in the 2nd row. So observation is when the grid loses its focus, existing value is retained in the combobox. Note: When we try to use the delete row provided by the grid (right click the row header of grid), it is deleting the only the selected record. Let me know any workaround for this Regards, Santha Kumar N.

Administrator [Syncfusion]
Replied On August 3, 2005 11:15 AM UTC

How are you deleting the row if you are not clicking the row header and pressing the delete key? Can you tell me how to see the problem in this sample? http://www.syncfusion.com/Support/user/uploads/GDBG_DeleteRows_35ef932d.zip

Santha Kumar
Replied On August 3, 2005 11:48 AM UTC

We are selecting the row header and pressing the delete key in the keyboard.

Administrator [Syncfusion]
Replied On August 3, 2005 12:11 PM UTC

Can you tell me how to see the problem in the sample I uploaded? In that sample, for me if I click the row header and press delete, nothing happens to any of the comboboxes that are left.

Santha Kumar
Replied On August 3, 2005 02:40 PM UTC

we are unable to simulate the same problem with the sample you have sent and it is working fine. We are unable to trace the problem in our application. therefore we would like to know the properties of the grid which has to be set to ensure that only selected row is getting deleted.

Administrator [Syncfusion]
Replied On August 3, 2005 03:23 PM UTC

My best guess is that this in not a property problem, but is more likely an event problem. What grid events are you handling? If you comment out these events, does the problem go away. As far as properties to check, do you have anything set readonly? Does your datasource support editing and deleting the records? Are there any exceptions being thrown as you delete the record? (Set your debugger to break on exception.)

Santha Kumar
Replied On August 3, 2005 03:47 PM UTC

These are the events used in the grid 1.CurrentCellControlDoubleClick 2.CurrentCellEditingComplete 3.CurrentCellValidateString 4.DoubleClick Yes, my datasource support editing and deleting records. No exceptions is thrown when we press delete key.

Administrator [Syncfusion]
Replied On August 3, 2005 04:18 PM UTC

What happens when you comment out these events? Does clicking a header and pressing delete work as expected? If so, add the events back one at the time until you find the one that is causing the problem.

Santha Kumar
Replied On August 4, 2005 08:36 AM UTC

As you told, we commented the events related to grid and tested. We are getting the same problem (After deletion combobox in the next row getting cleared.)

Administrator [Syncfusion]
Replied On August 4, 2005 09:25 AM UTC

If you can provide us with a sample project that we can debug, we can try to spot what is causing this behavior here. There will be a new release 3.3 release out shortly. If you want to try this release, you can wait a few days, and get the posted download when it becomes available. If you would like to try it before then, submit a Direct Trac support incident, and we can provide you with a link to download one of our nightly builds for that release.

Administrator [Syncfusion]
Replied On August 9, 2005 04:25 PM UTC

I am seeing a similar problem. When you press delete then the first column of the next row becomes selected instead of the zero column so if you press delete again and it is a combobox the value is removed. I added a rowsdelete event handler and tried setting the currentcell to move to the zero column of the current row and the code excutes however the first column is still the current cell instead of column zero.

Administrator [Syncfusion]
Replied On August 9, 2005 04:41 PM UTC

Can you modify the sample I posted above to show this problem? Or can you upload a sample showing this problem? If so, I am sure we can get it resolved.

Administrator [Syncfusion]
Replied On August 9, 2005 04:56 PM UTC

The problem is simple to reproduce in the sample. Select a row header (column zero). Press delete. Now press delete again. The first columns is deleted not the row. Add in the rowsdeleted handler and the following code: private void gridDataBoundGrid1_RowsDeleted(object sender, Syncfusion.Windows.Forms.Grid.GridRowRangeEventArgs e) { GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell; cc.MoveTo(cc.RowIndex, 0); } and it will still ocurr.

Administrator [Syncfusion]
Replied On August 9, 2005 05:19 PM UTC

Try selecting the row instead of moving the currentcell. private void gridDataBoundGrid1_RowsDeleted(object sender, GridRowRangeEventArgs e) { this.gridDataBoundGrid1.Selections.SelectRange(GridRangeInfo.Row(e.From), true); }

Administrator [Syncfusion]
Replied On August 9, 2005 06:05 PM UTC

Works great, only shouldn''t that be the default behavior?

Administrator [Syncfusion]
Replied On August 9, 2005 06:40 PM UTC

If you have this.gridDataBoundGrid1.ListBoxSelectionMode set to something other than None, the row will be selected by default. But without this setting, the row is not selected.


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