Link to home
Start Free TrialLog in
Avatar of IzzyTwinkly
IzzyTwinklyFlag for United States of America

asked on

why do I need to check 'e.Row.RowType == DataControlRowType.DataRow'?

Hi
I have a GridView control and I have following RowdataBound event.  I understand that this event is rased for each row, but I don't understand the
'if (e.Row.RowType == DataControlRowType.DataRow)' part.
I guess 'e.Row.RowType' means Current row's row type, correct?  
As I know, 'DataControlrowType.DataRow' means a data row of data control.
What does that mean if these two are equal???

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{
        if (e.Row.RowType == DataControlRowType.DataRow)
        {
                //Get the price for this row.
                // if price > $50, change the background color.
          }
 }
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Lol, what he said
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of IzzyTwinkly

ASKER

thank u all~~~