ballpenxp

博客园 首页 新随笔 联系 订阅 管理

grid中header置顶不动
        设置displaylayout中的stationarymargins

grid中设置数据筛选
        // The Browser, LoadOnDemand, and ViewType settings to enable XmlHttp support were done at design time.                   // Many of these setting can be done at design time but are done here to show them being set explictly.

        // Turn on Filtering
        Layout.FilterOptionsDefault.AllowRowFiltering = Infragistics.WebUI.UltraWebGrid.RowFiltering.OnServer;

        // Limit the size of the dropdown
        Layout.FilterOptionsDefault.DropDownRowCount = 10;
        Layout.FilterOptionsDefault.FilterDropDownStyle.Width = Unit.Pixel(190)

            // Turn on RowIsland Filtering
            // RowIsland filtering only filters the siblings rows of a group.  For Band Zero, all Band Zero rows are                         siblings so there
            // is little difference in the modes, however in child bands, this behavior is more evident.
        Layout.FilterOptionsDefault.RowFilterMode = Infragistics.WebUI.UltraWebGrid.RowFilterMode.SiblingRowsOnly;

 

        在grid的FilterPopulating中
        // Get the unique country names
        e.WorkingList.AddRange( ArrayList );
            // Tell the WebGrid not to go looking for the data.  By setting this
            // flag to true, the WebGrid uses the provided list for it's data.
            e.Handled = true;

            grid的数据源需要在InitializeDataSource中设置
            grid需要绑定在一个固定的datatable中,不可动态new的
            每一个row需要设定为isbound = true

 

        grid使用ajax自动读取数据
                设置browser 未xml , LoadOnDemand为 xml ,并设置ViewType为Hierarchical即可,但是需要在InitializeDataSource中绑定数据


        grid中获得置顶的column
                Layout.Bands[0].Columns.FromKey("Key")


        grid中分页
                设置Pager中允许分页,分页大小
                在InitializeDataSource绑定数据

                自定义分页需要设置
                Layout.Pager.StyleMode = Infragistics.WebUI.UltraWebGrid.PagerStyleMode.CustomLabels;
                pattern设置为:<table width=100%><tr><td align=left>页码:[currentpageindex]/[pagecount] 每页:[pagesize]</td><td align=right>[default]<td></tr></table>

                Layout.Pager.CustomLabels = letters;               
                Page中AllowCustomPaging并在PageIndexChanged设定要显示的数据
                比如        设定数据源为customerTable2在PageIndexChanged中设定:
                customerTable2.DefaultView.RowFilter = "CustomerID LIKE '" + letters[e.NewPageIndex-1] + "%'";

                letters为:
                        letters = new string[letterCount];
                        for (int i = 0 ; i < letterCount ; i++)
                                letters[i] = ((char)((int)'A'+i)).ToString();
               
               
       

posted on 2007-07-19 09:30  ballpenxp  阅读(2617)  评论(0编辑  收藏  举报