Reputation: 9555
Is it possible to debug a gridview object like you can with a datatable. By this I mean adding a watch to the object then see the data visually?
Thnaks for the help.
Upvotes: 0
Views: 1223
Reputation: 28970
Yes you can debug your GridView, you use RowDataBound
Event
<asp:gridview id="GridView1"
datasourceid="...."
autogeneratecolumns="true"
onrowdatabound="GridView1_RowDataBound"
runat="server">
</asp:gridview>
void GridView1_RowDataBound(Object sender, GridViewRowEventArgs e)
{
if(e.Row.RowType == DataControlRowType.DataRow)
{
Console.Write(e.Row.Cells[1].Text);
.....
}
}
Link : http://msdn.microsoft.com/en-us/library/system.web.ui.webcontrols.gridview.rowdatabound.aspx
Upvotes: 1