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. Image for the cookie policy date
close icon

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

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

3 Replies

RA Rajagopal Syncfusion Team July 18, 2007 08:16 PM UTC

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


FW Feng Wen July 18, 2007 08:40 PM UTC

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


HA haneefm Syncfusion Team July 20, 2007 03:33 PM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon