[Mono-list] Helo in switch-case:
Gaurav Vaish
gvaish@iitk.ac.in
Sat, 16 Mar 2002 11:35:16 +0530
Error:
d:\Temp\mcs\class\System.Web\System.Web.UI.WebControls\TemplateColumn.cs(87,4):
error CS0163: Control cannot fall through from one case label ('default:') to
another
Line of error:
switch(itemType)
Code:
--------------------------
public override void InitializeCell(TableCell cell, int columnIndex,
ListItemType itemType)
{
base.InitializeCell(cell, columnIndex, itemType);
ITemplate toRender = null;
switch(itemType) // **** This is where the error is pointed *****
{
case ListItemType.Header: toRender = headerTemplate;
break;
case ListItemType.Footer: toRender = footerTemplate;
break;
case ListItemType.Item: toRender = itemTemplate;
break;
case ListItemType.AlternatingItem: toRender = itemTemplate;
break;
case ListItemType.SelectedItem: toRender = editItemTemplate;
break;
default: toRender = editItemTemplate;
}
if(toRender != null)
{
cell.Text = String.Empty;
toRender.InstantiateIn(cell);
}
}
--------------------------
Cheers,
Gaurav Vaish
http://home.iitk.ac.in/student/gvaish
http://calendar.yahoo.com/mastergaurav
---------------------------------