涛's profile秋叶无痕PhotosBlogLists Tools Help

Blog


    26 March

    e.Item.ItemType==ListItemType.AlternatingItem||e.Item.ItemType==ListItemType.Item

                  e.Item.ItemType==ListItemType.AlternatingItem||e.Item.ItemType==ListItemType.Item的意思
    2007-08-27 17:05

    1.(e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem)
    ----指触发对象的类型是DadaList里的基本行或是替换行(简单的说是DataList里的所有数据项内容)

    2.e.Item.ItemType == ListItemType.Header -----指触发对象的类型是DadaList里的标题行的内容
    进行判断以后,可以 对相应的数据对象进行操作

    ListItemType 枚举    [C#]请参见
    System.Web.UI.WebControls 命名空间 | DataGridItem.ItemType | DataListItem.ItemType | RepeaterItem.ItemType
    要求
    命名空间: System.Web.UI.WebControls

    全部显示

    指定列表控件中项的类型。
    备注
    ListItemType    枚举表示可以包含在列表控件中的不同项,例如 DataGrid、DataList 和 Repeater。典型的列表控件由包含此枚举所表示的元素的单元格组成。

    成员
    成员名称            说明
    AlternatingItem    交替(从零开始的偶数索引)单元格中的项。它是数据绑定的。
    EditItem     列表控件中当前处于编辑模式的项。它是数据绑定的。
    Footer     列表控件的页脚。它不是数据绑定的。
    Header     列表控件的页眉。它不是数据绑定的。
    Item    列表控件中的项。它是数据绑定的。
    Pager     页导航,显示定位到与 DataGrid 控件关联的不同页的控件。它不是数据绑定的。
    SelectedItem     列表控件中的选定项。它是数据绑定的。
    Separator    列表控件中项之间的分隔符。它不是数据绑定的。

    (e.Item.ItemType==ListItemType.Item||e.Item.ItemType==ListItemType.AlternatingItem)
    是判断项是控件内容中的项或交插项
    “e.Item.ItemType == ListItemType.Header”
    是判断项是不是控件的表头

    Comments

    Please wait...
    Sorry, the comment you entered is too long. Please shorten it.
    You didn't enter anything. Please try again.
    Sorry, we can't add your comment right now. Please try again later.
    To add a comment, you need permission from your parent. Ask for permission
    Your parent has turned off comments.
    Sorry, we can't delete your comment right now. Please try again later.
    You've exceeded the maximum number of comments that can be left in one day. Please try again in 24 hours.
    Your account has had the ability to leave comments disabled because our systems indicate that you may be spamming other users. If you believe that your account has been disabled in error please contact Windows Live support.
    Complete the security check below to finish leaving your comment.
    The characters you type in the security check must match the characters in the picture or audio.

    To add a comment, sign in with your Windows Live ID (if you use Hotmail, Messenger, or Xbox LIVE, you have a Windows Live ID). Sign in


    Don't have a Windows Live ID? Sign up

    Trackbacks

    The trackback URL for this entry is:
    http://runningwater0.spaces.live.com/blog/cns!A537D9A77A6D9171!205.trak
    Weblogs that reference this entry
    • None