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 : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridListControl Error: "Cannot clear this list"

Thread ID:

Created:

Updated:

Platform:

Replies:

47531 Aug 7,2006 10:44 PM UTC Dec 14,2006 10:28 AM UTC WinForms 2
loading
Tags: GridControl
Dave
Asked On August 7, 2006 10:44 PM UTC

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 8, 2006 03:58 AM UTC

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 10:28 AM UTC

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.

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

;