This is a migrated thread and some comments may be shown as answers.

[Solved] check cell value

1 Answer 128 Views
Grid
This is a migrated thread and some comments may be shown as answers.
appdev
Top achievements
Rank 1
appdev asked on 02 Oct 2009, 12:53 PM
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
 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 = "&nbsp;" Then  
                        e.Item.BackColor = System.Drawing.Color.Aqua  
                    Else  
                        e.Item.HorizontalAlign = HorizontalAlign.Right  
                    End If  
                Case 6  
                    If e.Item.Cells(3).Text <> "&nbsp;" And e.Item.Cells(4).Text = "&nbsp;" Then  
                        e.Item.BackColor = System.Drawing.Color.Aqua  
                    Else  
                        e.Item.HorizontalAlign = HorizontalAlign.Right  
                    End If  
            End Select  
        End If 
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
<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> 
and datasource is this. assume i got result in sqldatareader
dt is datatable

dt.Load(rs)

RadGrid1.DataSource = dt

please help if you have anything. thanks alot

1 Answer, 1 is accepted

Sort by
0
appdev
Top achievements
Rank 1
answered on 02 Oct 2009, 01:08 PM
never mind this
Tags
Grid
Asked by
appdev
Top achievements
Rank 1
Answers by
appdev
Top achievements
Rank 1
Share this question
or