DATAGRID導出時要加上EXCEL標識符.不然導出EXCEL會有問題.

Protected Sub DataGridList_ItemDataBound(ByVal sender As System.Object, ByVal e As DataGridItemEventArgs)

If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then

e.Item.Cells(0).Attributes.Add("style", "vnd.ms-excel.numberformat:@")

End If

End Sub

posted @ 2007-02-07 14:57  Benny Ng  阅读(282)  评论(0编辑  收藏  举报