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.

GridListControl Error: "Cannot clear this list"

Thread ID:

Created:

Updated:

Platform:

Replies:

47531 Aug 7,2006 06:44 PM Dec 14,2006 05:28 AM Windows Forms 2
loading
Tags: GridControl
Dave
Asked On August 7, 2006 06:44 PM

Hello,

I am simply trying to clear a GridListControl, but am getting an error on this line:

grdlstPR.Items.Clear();

The error is: "Cannot clear this list."

I am filling the GridListControl using a DataTable:

grdlstPR.DataSource = [Datatable].

Is this what is causing the error? That the "Clear()" method is not implemented for these?

Thanks.
Dave

Administrator [Syncfusion]
Replied On August 7, 2006 11:58 PM

Hi Dave,

You can not modify the Items collection when the DataSource property is set in a gridlist / combobox control. Please try this code to clear the list.

grdlstPR.DataSource = null

Thanks
Haneef

Jayant D. Kulkarni
Replied On December 14, 2006 05:28 AM

I tried this and it works fine...
if (userTable != null)
{
userTable.Clear();
}
userDataGridView.DataSource = null;
userDataGridView.Rows.Clear();
userDataGridView.Refresh();

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.

;