GibboK
GibboK

Reputation: 73918

GridView retrieve Data in every Row

When the Rows are bounding I need to take a specif value Ex FirstName and change with some logic the label which show the FirstName field.

I am using this script with no success..

How Can I access the field? Thanks

 protected void uxListAuthorsDisplayer_RowDataBound(object sender, GridViewRowEventArgs e)
 {
        switch (e.Row.RowType)
        {
            // In case type of row is DataRow (a data row of GridView) 
            case DataControlRowType.DataRow:
                e.Row.DataItem[1].Value.ToString();
                break;
        }
 }

Upvotes: 2

Views: 379

Answers (1)

Brissles
Brissles

Reputation: 3881

What about

e.Row.Cells[x].Text 

Where x is your column index?

Upvotes: 1

Related Questions