This shouldn't be this difficult to solve but I cannot do it (I think I've been staring at it too long).
Here's my gridview
Code:
<asp:GridView ID="gvProviders"
runat="server"
GridLines="None"
AllowPaging="true"
AutoGenerateColumns="False"
AllowSorting="True"
OnSorting="gvProviders_Sorting"
CssClass="grid-style"
HeaderStyle-CssClass="header-style"
RowStyle-CssClass="row-style"
AlternatingRowStyle-CssClass="alternating-row-style"
PageSize="25"
OnPageIndexChanging="gvProviders_PageIndexChanging"
OnRowDataBound="gvProviders_RowDataBound"
Here's my code
Code:
protected void gvProviders_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
// Display the company name in italics.
Label lblQAndA = (Label)e.Row.FindControl("lblSecurityQAndA");
DataRowView drv = (DataRowView)e.Row.DataItem;
lblQAndA.Text = drv["Question"].ToString() + " " + drv["Answer"].ToString()
}
}
Error is Compiler Error Message: CS1061: 'ASP.searchprovider_aspx' does not contain a definition for 'gvProviders_RowDataBound' and no extension method 'gvProviders_RowDataBound' accepting a first argument of type 'ASP.searchprovider_aspx' could be found (are you missing a using directive or an assembly reference?)
Why can't it find 'gvProviders_RowDataBound'?