Re: wierd gridview behavior
the other thing is, eventually when the "sorting" images are placed/added into the headerrow of the gridview, when clicked on for some reason the entire gridview just hides itself! it doesnt even fire any event (even though ive told it/created the eventhandler for the image button).
Re: wierd gridview behavior
The first thing I'd advise is to avoid trying to get the header info straight from the GridView. I've had nothing but issues with that. My solution was to create a data set equal to GridView.DataSource, then pick that apart for the needed info. It's really not too difficult.
As for the odd behavior. What exactly is the default page doing, and what is the other page not doing that it's supposed to?
Re: wierd gridview behavior
im afraid i need to add items into the headerrow for each column (sort buttons). I dont understand why it works PERFECTLY for the original page but not the new page when its a copy and paste job pretty much.
the default page is doing nothing really. has a button to execute a report, which calls SQL, fills a datatable and binds it to the gridview. Same as what this new page is doing.
just makes no sense to me.
Ive noticed that when say we click on a button either in a datarow or a header on this new page in the gridview, that nothing happens but makes the gridview disappear!
Re: wierd gridview behavior
Or... in the GridView statement, pull this little trick:
<asp:GridView ID="myGV" runat="server" AllowSorting="True" ..... >
And that will automatically take care of the sorting issue.
Make sure the data is going through the right channels. If you copied the gridview without copying it's corresponding data source, then I can understand why it's disappearing.. it has no data to show. If it's programatic, make sure the object names are correct.
Re: wierd gridview behavior
found out eventually the problem
shouldve set the whole binding process after the if (!Page.IsPostBack) - that was the problem!
i was doing it in that if statement in this new page, but shouldve been after that..... jeez.
thanks anyway