I agree with almaz almaz - a blanket catch
is bad juju in just about every case. Need to know what exception(s) wind up being there. If the column doesn't exist, there should be a better, non-exceptional way of doing that:
private void HideExcludedColumns(UltraGridBase grid)
{
if (_scExclusions == null) return;
foreach (var strKey in _scExclusions)
{
//Set the appropriate column of the grid to hidden.
foreach (var band in grid.DisplayLayout.Bands)
{
var columnIndex = band.Columns.IndexOf(strKey);
if (columnIndex > -1)
{
band.Columns[columnIndex].Hidden = true;
break;
}
}
}
}
I agree with almaz - a blanket catch
is bad juju in just about every case. Need to know what exception(s) wind up being there. If the column doesn't exist, there should be a better, non-exceptional way of doing that:
private void HideExcludedColumns(UltraGridBase grid)
{
if (_scExclusions == null) return;
foreach (var strKey in _scExclusions)
{
//Set the appropriate column of the grid to hidden.
foreach (var band in grid.DisplayLayout.Bands)
{
var columnIndex = band.Columns.IndexOf(strKey);
if (columnIndex > -1)
{
band.Columns[columnIndex].Hidden = true;
break;
}
}
}
}
I agree with almaz - a blanket catch
is bad juju in just about every case. Need to know what exception(s) wind up being there. If the column doesn't exist, there should be a better, non-exceptional way of doing that:
private void HideExcludedColumns(UltraGridBase grid)
{
if (_scExclusions == null) return;
foreach (var strKey in _scExclusions)
{
//Set the appropriate column of the grid to hidden.
foreach (var band in grid.DisplayLayout.Bands)
{
var columnIndex = band.Columns.IndexOf(strKey);
if (columnIndex > -1)
{
band.Columns[columnIndex].Hidden = true;
break;
}
}
}
}
I agree with almaz - a blanket catch
is bad juju in just about every case. Need to know what exception(s) wind up being there. If the column doesn't exist, there should be a better, non-exceptional way of doing that:
private void HideExcludedColumns(UltraGridBase grid)
{
if (_scExclusions == null) return;
foreach (var strKey in _scExclusions)
{
//Set the appropriate column of the grid to hidden.
foreach (var band in grid.DisplayLayout.Bands)
{
var columnIndex = band.Columns.IndexOf(strKey);
if (columnIndex > -1)
{
band.Columns[columnIndex].Hidden = true;
break;
}
}
}
}