I'm trying to use property VirtualItemCount for custom paging in ASP.NET web Forms GridView, it gives me this error
Severity Code Description Project File Line Suppression State
Error CS1061 'GridView' does not contain a definition for 'VirtualItemCount' and no extension method 'VirtualItemCount' accepting a first argument of type 'GridView' could be found (are you missing a using directive or an assembly reference?) dms D:\project\Screen\ToDoList.aspx.cs 100 Active
when I create new project its works fine but in my current project it appear like its not defined , I search a lot with no case similar to mine.
Do I need to add certain assembly reference or missing settings?
<asp:GridView ID="GridView1" runat="server" CssClass="Grid"
PageSize="10"
AllowPaging="true"
AutoGenerateColumns="false" OnPageIndexChanging="GridView1_PageIndexChanging">
<AlternatingRowStyle />
<Columns>
<asp:BoundField DataField="Name" HeaderText="Name" />
<asp:BoundField DataField="Date" HeaderText="Date" />
<asp:TemplateField>
<ItemTemplate>
<input type="button" value="Edit" class="button" />
<input type="button" value="delete" class="button" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
It appears like this
These are my settings
我只需转到“ Properties -> Application
然后将Target Framework
从.NET Framework 4
更改为.NET Framework 4.5
,即可使用
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.