or
| If (TypeOf (e.Item) Is GridDataItem) Then |
| 'Get the instance of the right type |
| Dim dataBoundItem As GridDataItem = e.Item |
| 'how do i get the value of the Boolean databound column??? |
| 'this does not work - it only produces a string of " " |
| if dataBoundItem("Ready").Text = x then |
| end if |
| End If |
| If (TypeOf (e.Item) Is GridDataItem) Then |
| 'Get the instance of the right type |
| Dim dataBoundItem As GridDataItem = DirectCast(e.Item, GridDataItem) |
| Dim cbPause As CheckBox = dataBoundItem("Pause").Controls.Item(0) |
| 'get val of check box |
| end if |
protected void Button1_Click(object sender, EventArgs e)
{
radDeferredIncome.ExportSettings.IgnorePaging = true;
radDeferredIncome.ExportSettings.OpenInNewWindow = true;
radDeferredIncome.ExportSettings.ExportOnlyData = true;
radDeferredIncome.ExportSettings.Excel.Format = GridExcelExportFormat.ExcelML;
radDeferredIncome.MasterTableView.ExportToExcel();
}
The problem is any column that is of type string does not show up in excel. All the bounnd and numeric columns that have a type of Int32 do. Has anyone else had this issue? Is there a fix?
Thanks
John
| Private Sub RadGrid1_ItemDataBound(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemDataBound |
| Try |
| If (TypeOf (e.Item) Is GridDataItem) Then |
| 'Get the instance of the right type |
| Dim dataBoundItem As GridDataItem = e.Item |
| Debug.WriteLine(dataBoundItem("pause").Text) |
| Dim rclr As Drawing.Color |
| Dim tclr As Drawing.Color |
| If dataBoundItem("pause").Text = True Then |
| rclr = Drawing.Color.DarkOrange |
| tclr = Drawing.Color.Black |
| GoTo RowSet |
| End If |
| If dataBoundItem("ready").Text = True And dataBoundItem("run").Text = True And dataBoundItem("done").Text = True Then |
| 'done |
| rclr = Drawing.Color.Black |
| tclr = Drawing.Color.Gray |
| ElseIf dataBoundItem("ready").Text = True And dataBoundItem("run").Text = True And dataBoundItem("done").Text = False Then |
| 'running |
| rclr = Drawing.Color.DarkSalmon |
| tclr = Drawing.Color.Black |
| ElseIf dataBoundItem("ready").Text = True And dataBoundItem("run").Text = False And dataBoundItem("done").Text = False Then |
| 'ready |
| rclr = Drawing.Color.DarkOliveGreen |
| tclr = Drawing.Color.Black |
| Else |
| 'not set, dont change a thing, well maybe do it incase |
| rclr = Drawing.Color.Black |
| tclr = Drawing.Color.White |
| End If |
| RowSet: |
| Dim Row As TableRow |
| Row = CType(e.Item, TableRow) |
| Row.BackColor = rclr |
| Row.ForeColor = tclr |
| End If |
| Catch ex As Exception |
| End Try |
| End Sub |