GridView 移除模板列

 protected void gvMain_ItemDataBound(object sender, DataGridItemEventArgs e)
    { 

if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
        {  
            e.Item.Cells.RemoveAt(0);         
        }

}

你可能感兴趣的:(GridView)