At wit's end...

  • Thread starter Thread starter Roy
  • Start date Start date
R

Roy

Hey all,

Have a nested datagrid with paging enabled. The nested portion is a
user control in the last column of the datagrid. The user control
column passes two variables, which is how the user control knows which
data to display. Simple really.

What happens is the first page of the datagrid displays fine. However,
if I click "next page","previous page", "last page", or "first page" to
display the next page of data, the nested datagrid no longer displays.
Using response.write's I've determined that after the initial page it
seems that the two variables *never get passed* to the user control,
hence it never displays anything, not even the column headers in the
nested datagrid.

Clearly it has something to do with me using the paging functions, but
I'll be darned if I can piece together what's going on.
 
Is the code passing the variables wrapped in an if statement checking for
postback? Make sure your code is passing the data to the user control on
every postback.
 
Nope, this is parent datagrid, you can see below how the variables are
passed in the last column:
.......
<asp:BoundColumn DataField="container" ReadOnly="true"
HeaderText="Container"></asp:BoundColumn>
<asp:BoundColumn DataField="pod" ReadOnly="true"
HeaderText="PoD"></asp:BoundColumn>
<asp:BoundColumn DataField="name" ReadOnly="true"
HeaderText="Name"></asp:BoundColumn>
<asp:BoundColumn DataField="doc" ReadOnly="true"
HeaderText="Doc"></asp:BoundColumn>
<asp:BoundColumn DataField="event_loc_ed" ReadOnly="true"
HeaderText="Location"></asp:BoundColumn>
<asp:BoundColumn DataField="pcfn" ReadOnly="true"
HeaderText="PCFN"></asp:BoundColumn>
<asp:TemplateColumn>
<ItemTemplate>
<asp:PlaceHolder ID="ExpandedContent" Visible="True"
Runat="server"> <tr><td colspan="11">
<UC_Grid:Nested id="FVDGrid" x=<%# container.dataitem("doc")%> y=<%#
container.dataitem("container")%> runat="server"/>
</td></tr></asp:PlaceHolder></ItemTemplate>
</asp:TemplateColumn>
</columns>
</ASP:DataGrid>
 
Actually, your postback comment has spurred a new line of thought in
me. Thanks!

I'd bet my bottom dollar that after the first postback on the main page
occurs, the last column (the user control) is not accessed. I have no
clue why, but still, that'd explain what's going on. The interesting
thing is I include a call to the "bindgrid" function when someone
clicks "next page" etc.... so I don't see why there would be any
difference between the first postback and each preceeding one.
 
Are you paging the outer grid or the inner one? Your post is very confusing.

Does the outer grid have the correct information after going to the next
page but the inner does not?

Can you put a simple reproduceable case of this and then post all the code,
so we could see exactly what you are trying to do.
 
Are you paging the outer grid or the inner one? Your post is very
confusing.

The outer grid is the one being paged.
Does the outer grid have the correct information after going to the next
page but the inner does not?

Correct. The outer grid displays fine for every page. The nested grid
does not display at all after the first page.
Can you put a simple reproduceable case of this and then post all the
code, so we could see exactly what you are trying to do.

That's alot of code and I suspect this google group page will truncate
all the info making it hard to read. :) Besides, I don't necessary
want anyone to do my job for me, I was just curious if anyone had any
ideas/tips or directions in which to push me.
 
Back
Top