Accordion Control Desp
Accordion Control:顾名思义,类似手风琴的控件,其实就是面板的各种样式和组装。
The Accordion control lets you define multiple panes and display them one at a time. It is like having several CollapsiblePanel controls where only one can be expanded at a time. The Accordion control contains one or more AccordionPane controls. Each AccordionPane control has a template for its header and its content. (这里的结构是:一个头部模板,类似标题;一个内容模板,类似body. 这个结构其实出现了很多地方,html的组成不就是这样吗,或者一篇文章不就是这样的结构吗?世界竟然是如此地相似!!!!!!)The selected pane is automatically persisted across postbacks. 这个控件呢,是让你定义 多个面板,但是每次只能显示一个。我见过的最早的就是 XP和QQ了。 它包含了很多 (AccordionPane controls)。
下面详细讲解Autosize属性
The Accordion control supports the following AutoSize modes to accommodate a variety of page layouts.
- None - The Accordion control grows and shrinks without restriction. This can cause other elements on the page to move up and down in order to accommodate the Accordion control.意味着面板能够无限得增大。
- Limit - The Accordion control never grows larger than the value specified by its Height property. This causes the content to scroll if the content is too long to be displayed in the allotted space.意味着内容太大的话呢,只要把滚动条请出来了,ScrollBar。
- Fill - The Accordion control is a fixed size as specified in its Height property. This causes the content to be expanded or shrunk if the content does not fit exactly into the allotted space.意味着类似DockStyle 方式的Fill枚举。
Like most of the extenders in the AJAX Control Toolkit, the Accordion control is written using an extender.(这里呢,说了大部分的Ajax控件,都是用扩展器来写的,具体意思是什么,那就在扩展二字,扩展扩展,那扩展谁呢,肯定有一个载体) The extender requires input in a specific hierarchy of container elements (like div elements). Therefore, the Accordion and AccordionPane controls are used to generate the expected input for the extender. The extender can also be used on its own if you provide appropriate input.
这个好啊,数据绑定,
The Accordion control can also be data-bound. To bind the control, specify a data source using the DataSource or DataSourceID properties, (两种方式进行提供,一种直接数据源,一种是数据源集合中选择一个ID)and then set the data items in the HeaderTemplate and ContentTemplate properties.(当然数据项的话,你要设置号Panel结构的头部head和 内容content) You must call the DataBind method to bind the control to the data.最后调用 databind()方法呢,就可以使数据绑定生效。

浙公网安备 33010602011771号