[thelist] asp datagrid frustration

Mark Aldrich MAldrich at cex.co.uk
Wed Sep 22 12:45:27 CDT 2004


Hi, 
just wondering if anyone had encountered this little problem im havin with
the asp.net datagrid. Ive got a feelin that im missin something here. I have
a search that is fired by an if 'IsPostBack' test in the apps 'page load'
sub. All well and good a reader object is bound to the grid with my data.

The problem occurs when i sort a column. i have a sortcolumn handler which
functions perfectly - i.e a requery of the database with a different sort
expression. this is called when a hyperlink in the datagrid header is
clicked. Unfortunately it goes through the page load sub again and of course
it is a postback so before it calls the sort column sub, it automatically
performs the same query again!! then it goes to sortcolumn and requeries the
database again to get the the table datain its new order. 2 queries when
there should be 1.

idealy clicking on the header would result in the ispostback test returning
false or somesuch logic. I know i could rewrite it in javascript  hehe but
that wont be hapenin.

any ideas? im all out.

mark


More information about the thelist mailing list