`
xylffxyfpp
  • 浏览: 113560 次
  • 性别: Icon_minigender_1
  • 来自: 上海
文章分类
社区版块
存档分类
最新评论

datagrid as

阅读更多
import fl.controls.DataGrid;
import fl.controls.ScrollPolicy;
import fl.data.DataProvider;

var totalRows:uint = 42;
var dp:DataProvider = new DataProvider();
var obj:Object = {};
for (var i:int = 0; i < totalRows; i++) {
        obj = {col1:getRandomNumber(), col2:getRandomNumber(), col3:getRandomNumber(), col4:getRandomNumber(), col5:getRandomNumber(), col6:getRandomNumber(), col7:getRandomNumber()};
        dp.addItem(obj);
}

var dg:DataGrid = new DataGrid();
dg.setSize(200,300);
for (var k:int = 1; k <= 7; k ++) {
        dg.addColumn('col' + k );
}
dg.dataProvider = dp;
dg.horizontalScrollPolicy = ScrollPolicy.ON;
addChild(dg);

function getRandomNumber():uint
{
        return Math.round(Math.random() * 100);
}
分享到:
评论

相关推荐

    as3 datagrid flash 自定义检索程序

    AS3 Datagrid Flash 自定义检索程序是一个用于展示和搜索数据的高级组件,广泛应用于Flash和Flex应用程序中。本文将深入探讨这个程序的核心知识点,包括AS3编程基础、XML数据源的处理、正则表达式应用、自定义...

    Wpf datagrid 多选、单选、反选

    DataGrid dataGrid = sender as DataGrid; if (dataGrid != null) { dataGrid.SelectedIndex = dataGrid.SelectedIndex == -1 ? 0 : -1; } } ``` 接下来,我们讨论单选功能。如果希望`DataGrid`仅支持单选,...

    WPF DataGrid行号

    DataGrid dataGrid = d as DataGrid; if (dataGrid != null) { if ((bool)e.NewValue) { dataGrid.Loaded += OnDataGridLoaded; dataGrid.Items.CollectionChanged += OnDataGridItemsCollectionChanged; } ...

    DataGrid自定义列标题

    DataGridColumnHeader columnHeader = e.OriginalSource as DataGridColumnHeader; if (columnHeader != null) { // 排序逻辑 } } ``` 四、动态调整列宽 DataGrid允许用户通过拖动列边框来动态调整列宽。默认...

    vb中datagrid控件的详细使用方法

    Private Sub DataGrid1_CurrentCellChanged(sender As Object, e As EventArgs) Handles DataGrid1.CurrentCellChanged ' 在这里处理事件逻辑 End Sub ``` 5. **编辑与验证** 用户可以直接在`DataGrid`中编辑...

    DataGrid导出excel_poi和as3xls

    Flex DataGrid导出成excel的方法,介绍了导出的两种方式poi和as3xls

    Flex4.5导入Excel/csv到DataGrid及DataGrid右键

    在导入Excel或CSV数据时,我们通常会使用Flash Player的FileReference类来处理文件选择,然后通过AS3解析文件内容,将数据转换为适合DataGrid的数据结构,如ArrayCollection。 1. **导入Excel文件**: - 用户通过...

    Datagrid键盘事件响应

    Private Sub DataGrid1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles DataGrid1.KeyDown MsgBox("你输入的是:" + e.KeyCode.ToString) End Sub ``` 然而,对于像方向...

    Flex中DataGrid分页源码

    本文将详细解析使用AS3.0在Flex中实现DataGrid分页的功能,帮助你深入理解这一技术。 首先,Flex是Adobe开发的一个开放源代码框架,用于构建富互联网应用程序(RIA)。它提供了丰富的组件库,包括DataGrid,这是一...

    DataGrid全选并获取选中条目数

    (dataGrid.ItemContainerGenerator.ContainerFromItem(item) as DataGridRow)?.IsSelected = isChecked; } } ``` 接下来,我们需要实现获取选中条目数的功能。这可以通过迭代DataGrid的所有项来完成,检查每个项...

    开源码 as3 扩展瀑布流功能的DataGrid组件

    开源码 AS3 扩展瀑布流功能的 DataGrid 组件是一种强大的工具,它允许开发者在 ActionScript 3(AS3)环境中实现具有视觉吸引力和高度交互性的数据展示。这个组件扩展了标准的 Flex DataGrid 控件,引入了瀑布流布局...

    WPF中DataGrid得到其中一行的值

    DataGrid dataGrid = sender as DataGrid; if (dataGrid.SelectedItem != null) { YourDataType selectedItem = dataGrid.SelectedItem as YourDataType; // Do something with the selected item } } ``` ...

    Datagrid中使用combobox

    在Windows Presentation Foundation (WPF)开发中,DataGrid控件是一种强大的数据展示工具,它可以用于显示和编辑表格形式的数据。而当需要在某列中提供下拉选择功能时,我们通常会使用ComboBox控件。本篇文章将深入...

    WPF DataGrid 中显示图片的小例子

    string imageUrl = value as string; if (!string.IsNullOrEmpty(imageUrl)) { return new BitmapImage(new Uri(imageUrl)); } return null; } public object ConvertBack(object value, Type targetType, ...

    wpf DataGrid分组、排序、筛选

    在Windows Presentation Foundation (WPF) 中,`DataGrid`控件是用于显示和操作数据集的强大工具,尤其适合展示表格形式的数据。本篇文章将详细探讨如何利用`DataGrid`实现数据的分组、排序和筛选功能,以提高用户...

    在DataGrid中进行复选框的操作(全选和取消)

    DataGridRow row = dataGrid.ItemContainerGenerator.ContainerFromItem(item) as DataGridRow; if (row != null) { CheckBox cellCheckbox = FindVisualChild(row); if (cellCheckbox != null) { cell...

    Flex导出Excel之as3xls(包括datagrid全选功能)

    在博文链接中(),作者可能详细解释了如何实现这个过程,包括如何使用as3xls库创建Excel文件,以及如何结合DataGrid的全选功能。遗憾的是,由于没有具体的博文内容,无法提供更详细的步骤或代码示例。不过,通常的...

    DataGrid分页

    VB DataGrid分页 请看: 数据库:test2000.mdb 表:numbers 字段:Id(自动编号),anumber(数字) 因为DataGrid控件我们采用直接绑定记录集来显示数据.所以分页处理我们采用了间接的办法,定义另一个记录集objrs...

    vb DataGrid导出excel例子

    在VB(Visual Basic)编程环境中,DataGrid控件常用于显示和操作数据库中的数据。而将DataGrid中的数据导出到Excel是常见的需求,尤其在数据处理和报表生成的场景中。本例提供的"vb DataGrid导出excel例子"是一个很...

    wpf-DataGrid-checkBox

    var dataGrid = VisualTreeHelper.GetParent(checkBox) as DataGrid; if (dataGrid != null) { dataGrid.SelectAllCells(); dataGrid.UnselectAllCells(); } } ``` 4. **IsAllItemsSelected 属性**:这个...

Global site tag (gtag.js) - Google Analytics