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.

what''s the difference between TableDescriptor.Columns.Remove and TableDescriptor.VisibleColumns.Remove

Thread ID:

Created:

Updated:

Platform:

Replies:

64336 Jul 18,2007 11:36 AM Jul 20,2007 11:33 AM Windows Forms 3
loading
Tags: Grouping
Feng Wen
Asked On July 18, 2007 11:36 AM

TableDescriptor.Columns.Remove
Vs.
TableDescriptor.VisibleColumns.Remove

I thought I may not able to sort by the column after I remove it but I still can, thus I can not find any difference between them.

Thanks

Rajagopal [Syncfusion]
Replied On July 18, 2007 04:16 PM

Hi Frank,

The TableDescriptor.Columns is a collection of columns to the columns of the underlying datasource. The TableDescriptor.VisibleColumns is a collection of GridVisibleColumnsDescriptor columns each referencing a column in the TableDescriptor.Columns collection. This columns defines the order of columns shown in the grid.

Calling the VisibleColumns.Remove() will just hide the column from being shown in grid. If you want to avoid sorting for certain columns then you could do this by handling the TableControlQueryAllowSortColumn.

void gridGroupingControl1_TableControlQueryAllowSortColumn(object sender, GridQueryAllowSortColumnEventArgs e)
{
if(e.Column.Name == "columnName")
e.AllowSort = false;
}

Let me know if this helps.

Regards,
Rajagopal

Feng Wen
Replied On July 18, 2007 04:40 PM

My problem is, if I call TableDescriptor.Columns.Remove() after groupingGrid.TableDescriptor.VisibleColumns.Remove("ColumnName");

The column will gone and leave a blank gap in the grid(see pic), but if I call Columns.Remove() without VisibleColumns.Remove(). The columns in the grid will arrange automatically so there is no such gap.



remove.zip

haneefm [Syncfusion]
Replied On July 20, 2007 11:33 AM

Hi Frank,

I am not sure of what be might be causing this strange behavior without a working sample. I have tested this issue in browser sample with Essentail studio V.4.x/5.x. But i was not able to reproduce the issue. Is it possible for you to upload us a minimal sample or modify the browser sample to reproduce the issue here? This will help us to analyse the issue further.

Best regards,
Haneef

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.

;