I have managed to get all the rows to change to a LightCyan color and now only want to select the column BusType which is either CUS or SUP that displays the color.

I have looked at many references and found this one to work:

ASPxGridView.HtmlRowPrepared Event

however, when you use it like:

if (e.GetValue("BusType") == "CUS")
        e.Cell.BackColor = System.Drawing.Color.LightCyan;

Nothing happens.

My front end code looks like this (not fully copied and pasted):

<dx:ASPxGridView ID="ASPxGridView1" runat="server" AutoGenerateColumns="False" 
        DataSourceID="EntityDataSource1" KeyFieldName="CompanyID;BusinessID" OnHtmlDataCellPrepared="ASPxGridView1_HtmlDataCellPrepared"
        EnableTheming="True" Theme="Office2010Black">
        <Settings ShowFilterRow="True" />
        <SettingsBehavior AutoFilterRowInputDelay="500" />
            <dx:GridViewCommandColumn ShowDeleteButton="True" ShowEditButton="True" 
                ShowNewButtonInHeader="True" VisibleIndex="0" ShowClearFilterButton="True">
<dx:GridViewDataTextColumn FieldName="BusType" VisibleIndex="3">

Does anyone know how I can identify the value of the BusType column for each of the rows I have (532 rows).

EDIT: I receive no errors in the above code but adding the if statement removed all the Cyan highlighted rows and did not replace only the CUS with it - it all went back to no formatting.

EDIT: I have this code in my Namespace area: public bool ProcessSelectionChangedOnServer { get; set; }

Related posts

Recent Viewed