如何行和列添加到DataGrid? [英] How to add rows and columns to a DataGrid?
本文介绍了如何行和列添加到DataGrid?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
怎么可能行和列添加到DataGrid?
how is it possible to add rows and columns to a DataGrid?
我试图写两个功能,如:
I am trying to write two functions like:
public void addRow(DataGrid grid);
public void addColumn(DataGrid grid);
不幸的是,DataGrid中本身默认情况下不具备这些功能。
Unfortunately the DataGrid itself doesn't have those functions by default.
多谢了。
推荐答案
我没有做很多与DataGrid的较晚,但据我所知,一个DataGrid有一个数据源,这是应该内扩展数据源code。
I haven't done lots with DataGrid's lately, but for as far I know, a DataGrid has a datasource, and it's the datasource that should be extended within the code.
扩展数据源(如数据表)后,您应该刷新数据网格。
After extending the datasource (like a datatable), you should refresh the datagrid.
这篇关于如何行和列添加到DataGrid?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文