Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
DataBound GridView - accessing fields in RowBound method
Message
 
 
To
All
General information
Forum:
ASP.NET
Category:
Other
Title:
DataBound GridView - accessing fields in RowBound method
Environment versions
OS:
Windows XP
Database:
MS SQL Server
Miscellaneous
Thread ID:
01310810
Message ID:
01310810
Views:
53
Hi everybody,

How can I access fields my GridView is bound to in its RowBound method?

Here is what I'm trying to do:
 if (e.Row.RowType == DataControlRowType.DataRow)
        {

            ImageButton btnDelete = (ImageButton)e.Row.Cells[1].Controls[0];
            string PersonName = 
            e.Row.ToolTip = "Delete " + PersonName  ;

            btnDelete.Attributes.Add("onClick",
                "var ch=confirm('Do you want to delete " +
                PersonName + "?');if(ch==false) return false;");

            btnDelete.CommandName = "Delete";
        }
    }
but I could not figure out how to access LastName and FirstName from my GridView.

Thanks a lot in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform