Ajax和GridView-Fu - 如何使AccordionPanes与GridViews一起使用?

时间:2022-08-25 17:27:02

Ok, I know someone here has tried this ninja-elite level of coding before. Essentially what I want to do is this:

好的,我知道有人在此尝试过这种忍者精英级别的编码。基本上我想要做的是这样的:

I want a GridView where each row returned becomes the header portion of an asp.net-ajax AccordionPane. Each row also has some unique key, and when you click on each of those AcccordionPane headers, that will in turn reveal the content pane which will then open up another GridView which is populated with the information from that is pulled from a database with that unique key.

我想要一个GridView,返回的每一行都成为asp.net-ajax AccordionPane的标题部分。每行还有一些唯一的键,当你点击每个这些AcccordionPane标题时,它将依次显示内容窗格,然后打开另一个GridView,其中填充了来自该数据库的信息。键。

Now I KNOW someone out there has tried something this insane --- and it doesn't seem to be that insanely hard, look in the cooments section from the poster named awni:

现在我知道那里的某个人已经尝试过这种疯狂的事情 - 而且看起来似乎并不那么疯狂,请看一下名为awni的海报的编辑部分:

http://www.asp.net/learn/ajax-videos/video-87.aspx

<ajaxToolkit:AccordionPane ID="AccordionPane2>
    <Header>
       **********EACH HEADER IS A ROW FROM A DATABASE 
    </Header>
    <Content>
        <asp:GridView  DataSourceID="SqlDataSource1">
        <Columns>
           **********THIS GRIDVIEW IS POPULATED WITH A DATABASE QUERY
        </Columns>
        </asp:GridView>
    </Content>
</ajaxToolkit:AccordionPane>

Is it possible?

可能吗?

1 个解决方案

#1


1  

Have you tried a ListView instead? I would think you could define the AccordianPanes in the ItemTemplate, then bind an inner GridView or ListView inside each row. The only downside would be that it would populate all Grid/ListViews on load.

你尝试过ListView吗?我认为您可以在ItemTemplate中定义AccordianPanes,然后在每行内部绑定一个内部GridView或ListView。唯一的缺点是它会在加载时填充所有Grid / ListView。

#1


1  

Have you tried a ListView instead? I would think you could define the AccordianPanes in the ItemTemplate, then bind an inner GridView or ListView inside each row. The only downside would be that it would populate all Grid/ListViews on load.

你尝试过ListView吗?我认为您可以在ItemTemplate中定义AccordianPanes,然后在每行内部绑定一个内部GridView或ListView。唯一的缺点是它会在加载时填充所有Grid / ListView。