zoukankan      html  css  js  c++  java
  • GridView.ScrollIntoView方法

    ScrollIntoView方法有两个重载形式:

            //
            // Summary:
            //     Scrolls the list to bring the specified data item into view.
            //
            // Parameters:
            //   item:
            //     The data item to bring into view.
            [Overload("ScrollIntoView")]
          1)  public void ScrollIntoView(object item);
            //
            // Summary:
            //     Scrolls the list to bring the specified data item into view with the specified
            //     alignment.
            //
            // Parameters:
            //   item:
            //     The data item to bring into view.
            //
            //   alignment:
            //     An enumeration value that specifies whether the item uses Default or Leading
            //     alignment.
            [Overload("ScrollIntoViewWithAlignment")]
           2) public void ScrollIntoView(object item, ScrollIntoViewAlignment alignment);

    第一种方法,只是让第一个选中的item显示在当前视图中。第二个方法中的第二个参数是设置选中的item如何在视图中显示。

    ScrollIntoViewAlignment.Leading : 是让第一个选中的item显示在视图的最前端或最上端。

    ScrollIntoViewAlignment.Default : 是默认值。只是让第一个选中的item显示在当前视图中,有可能是显示在view的最末端。

    当设置ScrollIntoViewAlignment.Leading时,ScrollIntoView的第一个参数必须不能为空,否则程序会崩溃。

  • 相关阅读:
    Python 学习 —— 进阶篇(装饰器、类的特殊方法)
    Python 基础学习的几个小例子
    MyBatis——特殊传参问题小结
    为什么要有分布式事务 分布式事务解决的什么问题 一次解答
    2pc事务和3pc事务区别详解
    SPEL语法
    分布式事务框架 TX-LCN 使用
    分布式事务解决方案
    excel 使用总结
    nginx 常用配置
  • 原文地址:https://www.cnblogs.com/my-sky/p/GridView-ScrollIntoView.html
Copyright © 2011-2022 走看看