且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在运行时从文本框向datagrid中添加数据?

更新时间:2023-12-06 15:18:58

您需要一些数据源来绑定您的gridview.通常,数据源来自数据库或某些文件系统.

可能您有一些不同的要求.您可以从文本框中获取所有数据,然后获取数据源(如datatable等)并将其绑定到gridview.

如果要动态格式化或更改网格中的某些内容,请实施gridview的rowdatabound event
You need some datasource to bind your gridview. Normally datasource comes from database or some file system.

Might be you hve some different requirement. You can get all the data from your textboxes and have then is datasource like datatable etc and bind it to gridview.

If you want to format or change something in grid dynamically then implement rowdatabound event of gridview