Click here to Skip to main content
14,209,923 members
Rate this:
Please Sign up or sign in to vote.
See more:
In PagedGridView when I am trying to display the result .It is displaying correctly for 2-3 times , then it show the blank page with single column data and again when I click on it it start showing the data correctly.

What I have tried:

<PagedGridView ID="grdCases" runat="server" DefaultSortExpression="NameLast,NameFirst" onpageindexchanging="grdCases_PageIndexChanging" onsorting="grdCases_Sorting" OnRowDataBound="grdCases_OnRowDataBound" >
                <EmptyDataTemplate>No Cases found</EmptyDataTemplate>
                <Columns>
                    <asp:BoundField HeaderText="Number" DataField="Number" SortExpression="CaseNumber" ItemStyle-Wrap="false" />
                    <asp:BoundField HeaderText="Last" DataField="NameLast" SortExpression="NameLast,NameFirst" />
                    <asp:BoundField HeaderText="First" DataField="NameFirst" SortExpression="NameFirst,NameLast" />
                    <asp:BoundField HeaderText="DOB" DataField="DOB" SortExpression="DOB" DataFormatString="{0:MM/dd/yyyy}" ItemStyle-Width="100px" HeaderStyle-HorizontalAlign="Center" ItemStyle-HorizontalAlign="Center" />

<asp:TemplateField ItemStyle-CssClass="ControlColumn" ItemStyle-Width="60">
                        <ItemTemplate>
                            <asp:HyperLink ID="lnkView" NavigateUrl='<%# String.Format("~/Directory/View.aspx?id={0}", Eval("ID")) %>' ToolTip="View Case" runat="server">
                                <asp:Image ID="imgView" ImageUrl="~/Images/View.png" ToolTip="View Case" AlternateText="View Case" runat="server" />
                                View
                            </asp:HyperLink>
                        </ItemTemplate>
                    </asp:TemplateField>
</Columns>
            </PagedGridView>


private void BindGridView(bool ResetPageIndex)
        {
            pnlSearchResults.Visible = true;

            EntityList<Test.Directory> results = Test.Directory.FindAll(BuildSearchOptions(), grdtest.SortPageOptions);


            grdtest.DataSource = results;
            grdtest.DataBind();
            if (ResetPageIndex) grdtest.PageIndex = 0;
        }
Posted
Updated 12-Jun-19 5:05am
Comments
Maciej Los 3 days ago
   
What is PagedGridView? What framework?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



Advertise | Privacy | Cookies | Terms of Service
Web01 | 2.8.190617.3 | Last Updated 12 Jun 2019
Copyright © CodeProject, 1999-2019
All Rights Reserved.
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100