需求如標題。
原因是操作者希望在網頁看到的和匯出檔案的是兩回事。(但這兩回事必須存在某種規則)
好吧,基本上就是在匯出檔案之前做些手腳。
RadGrid提供OnExportCellFormatting事件,該事件會回呼到自定義方法讓我們可以在匯出檔案之前先對RadGrid的column內容作調整。如下

<telerik:RadGrid OnExportCellFormatting="UserDataGrid_ExportCellFormatting" ... >
接著在UserDataGrid_ExportCellFormatting方法中做手腳!!
protected void UserDataGrid_ExportCellFormatting(object sender, ExportCellFormattingEventArgs exportCellData)
{
	string uniqueNameInColumn = exportCellData.FormattedColumn.UniqueName;
	string textInColumn = exportCellData.Cell.Text;
	switch (uniqueNameInColumn)
	{
		case "Name":
			exportCellData.Cell.Text = textInColumn + 1;
			break;
		case "ID":
			exportCellData.Cell.Text = textInColumn + 2;
			break;
	}
}
值得注意的是可以從 ExportCellFormattingEventArgs 取得相對應的資訊。如上方的
1.FormattedColumn.UniqueName 會對應的 column 的 unique name。透過這個unique name來確認是哪個 column
2.Cell.Text 則是該 column 的 cell 內容,就是修改這個值來達到匯出檔案不同於網頁內容的要求。
如上就是對column名稱為Name的cell內容+1,對column名稱為 ID 的 cell 內容+2