Re: gridview paging oddity

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



A couple of thoughts....

Where is the code you're showing below added into the page class's event
handling?

Typically, when you encounter something not working on the first click, but
it does work on the second, it has to do with DataBind being called at the
wrong time. So, try moving the GridView1.DataBind(); to be the last line of
code in the code (outside of the if block).

-Scott

"JohnE" <JohnE@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:D067A10B-73BA-414D-ACCF-5C7B389893AB@xxxxxxxxxxxxxxxx
Here is an oddity that is now occurring with a gridview. There is a
gridview
on a page. As part of the page there is a search button. Now, as of late
yesterday all was working fine just like it should. Then what began
occuring
is the Search button had to be double clicked for the gridview.allowpaging
=
false to work. In debugging, it runs thru the code just like it should
without error the first time thru and loads the page as planned. I type
something in the Search box (there should be 20 records found) and click
the
Search button. The code runs thru the Search just it should and hits all
lines of code without error. One line is the allowpaging = false and it
shows false when hovering over it. But, this line does not work until the
second click of the Search button. And debugging goes over the entire
process again like it did on the first click of the Search button. Here
is
the code that is used.

if (!String.IsNullOrEmpty(txtSearch.Text))
{
SearchExpression = string.Format("{0}'%{1}%'",
GridView1.SortExpression, txtSearch.Text);
dv.RowFilter = "ChangeRequest like " + SearchExpression;
GridView1.DataSource = dv;
GridView1.DataBind();
GridView1.AllowSorting = false;
GridView1.AllowPaging = false;
ddlNumberPerPage.Enabled = false;
}

From when it was working correctly to when it started the double click
nothing was added or done to the webapp. This is all on a pc with no
server
involved other then what the machine creates during runtime.

Any thoughts on this?

Thanks... john


.



Relevant Pages

  • Re: ptrace single-stepping change breaks Wine
    ... >> I don't think that the Wine problem resolution is due to the POPF ... Basically Linus patch does a nice cleanup plus POPF ... >> handling, so maybe the patch can be split. ... > anything else would never have worked in a real-life debugging situation. ...
    (Linux-Kernel)
  • RE: gridview paging oddity
    ... "JohnE" wrote: ... In debugging, it runs thru the code just like it should ... without error the first time thru and loads the page as planned. ... shows false when hovering over it. ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Reverse comma operator?
    ... If you write it properly the first time (so ... it makes logic errors that much easier to spot. ... Debugging is twice as hard as writing the code in the first place. ... Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it. ...
    (comp.lang.c)
  • Re: Writn a slash in Evolution
    ... Is there a list of all those dirty tricks that I should be aware of? ... the trick. ... It's the first time that I encounter the possibility of ...
    (Fedora)
  • MechCommander 2 1.0 Issue
    ... I encounter the much dreaded XP window ... The first time I sent the error report and restarted the ... game, figuring it was a one time thing. ... Every time it happens, and after I send the error report, ...
    (microsoft.public.games)