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.

Erasing cells

Thread ID:

Created:

Updated:

Platform:

Replies:

6675 Aug 22,2003 01:09 AM Aug 22,2003 02:21 AM Windows Forms 4
loading
Tags: GridControl
Jimmy
Asked On August 22, 2003 01:09 AM

Hi, I am using the virtual grid and I want to delete some rows. When I delete them from my model, they are also cleared from the table. That is all good. My issue is that the table is not resized. The number of rows stay the same even though it has clearly changed. Is there a call I can make to invalidate the row count. Right now I call something like this: gridControl1.BeginUpdate(); gridControl1.ResetGridBounds(); gridControl1.Selections.Clear(); gridControl1.Clear(false); gridControl1.Clear(true); gridControl1.Refresh(); gridControl1.EndUpdate(true); // hoping that some of it will do the trick :) I still use 1.5. I have tried 1.6 but that didn't help solving this problem.

Administrator [Syncfusion]
Replied On August 22, 2003 01:39 AM

A couple of comments. Your code appears to be clearing the contents of the selected rows. This does not actually remove the rows from the grid. If you want to actually remove the rows from the grid, you should use this.gridControl1.Rows.RemoveRange. But in a virtual grid, calling this.gridControl1.Rows.RemoveRange will not do anything to your data source as you have complete control there (the grid knows nothing about it when you are doing things virtually). What you would need to do, is to directly remove the rows from your external datasource somehow where you are now trying to use the grid to remove the rows. How you would do this depends upon the datasource.

Jimmy
Replied On August 22, 2003 01:49 AM

I am removing the data from my data model. They are also removed from the table. The problem is that it leaves empty rows in the bottom of the table. The code i pasted is called after removal of data from the data model. It doesn't work really. Was just posting it so you could see what I have been trying out.

Administrator [Syncfusion]
Replied On August 22, 2003 02:04 AM

By table, do you mean the grid or your exteranl datasource? If you mean the grid then how are you telling the grid how many rows are there in your datasource? Are you using the QueryRowCount event (and NEVER setting grid.,RowCount = xxxx)? If you are using QueryRowCount, then after removing the rows from your datasource, call grid.ResetVolatileData(). If you are explicitly setting grid.RowCount, then change this value to what it should be.

Jimmy
Replied On August 22, 2003 02:21 AM

I only mean to handle the GridQueryCount event. But if I remove my explicit setting to the RowCount property in the constructor, the grid has loads with a number of empty columns from the start. Setting the RowCount property again after erasing the cells solved my problem. Thanks for the *fast* replies!

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.

;