i want to check the cell value and then set the background color of that row to a certain color.
this is what i got
which works fine on the firt time. But after i use a drop down to change the data, it has the Telerik.Web.UI.GridPagerItem so i can't do anything else with it.
my declaration for grid is this
and datasource is this. assume i got result in sqldatareader
dt is datatable
this is what i got
| If e.Item.ToString <> "Telerik.Web.UI.GridEditFormItem" And e.Item.ToString <> "Telerik.Web.UI.GridPagerItem" And e.Item.ToString <> "Telerik.Web.UI.GridHeaderItem" And e.Item.ToString <> "Telerik.Web.UI.GridFooterItem" And e.Item.ToString <> "Telerik.Web.UI.GridFilteringItem" Then |
| Dim item As GridDataItem = DirectCast(e.Item, GridDataItem) |
| Select Case tmp_comp_report_ID |
| Case 5 |
| If e.Item.Cells(3).Text = " " Then |
| e.Item.BackColor = System.Drawing.Color.Aqua |
| Else |
| e.Item.HorizontalAlign = HorizontalAlign.Right |
| End If |
| Case 6 |
| If e.Item.Cells(3).Text <> " " And e.Item.Cells(4).Text = " " Then |
| e.Item.BackColor = System.Drawing.Color.Aqua |
| Else |
| e.Item.HorizontalAlign = HorizontalAlign.Right |
| End If |
| End Select |
| End If |
my declaration for grid is this
| <telerik:RadGrid AutoGenerateColumns="true" ID="RadGrid1" Visible="false" MasterTableView-EnableNoRecordsTemplate="true" |
| AllowSorting="True" GridLines="both" Skin="Telerik" |
| PageSize="100" ShowStatusBar="true" AllowPaging="True" |
| runat="server" OnExcelMLExportStylesCreated="RadGrid1_ExcelMLExportStylesCreated" |
| OnExcelMLExportRowCreated="RadGrid1_ExcelMLExportRowCreated"> |
| <PagerStyle Mode="NextPrevAndNumeric" /> |
| <ClientSettings EnableRowHoverStyle="true"> |
| <Selecting AllowRowSelect="True" /> |
| </ClientSettings> |
| <MasterTableView Summary="testing" ></MasterTableView> |
| </telerik:RadGrid> |
dt is datatable
dt.Load(rs)
RadGrid1.DataSource = dt
please help if you have anything. thanks alot