Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/274.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 在.NET2003中更新DataGrid WinForm控件_C#_Datagrid_.net 1.1 - Fatal编程技术网

C# 在.NET2003中更新DataGrid WinForm控件

C# 在.NET2003中更新DataGrid WinForm控件,c#,datagrid,.net-1.1,C#,Datagrid,.net 1.1,我一直在使用VS2005和VS2008,从未问过这个问题,但现在我很难在VS2003中使用控件。dataGridView不存在,我被迫使用DataGrid控件来显示一些数据。问题是,我想编辑此控件显示的一些值,并在数据库中反映这些更改,但我没有找到实现这一点的方法。已经“谷歌搜索”,没有找到相关结果,所以请给我一些帮助。我正在用C#编码 将DataGrid替换为DataGridView是有原因的。。。我希望您需要为1.1找到一个第三方网格控件来实现这一点(但旧的1.1变得越来越难) 抱歉,如果这

我一直在使用VS2005和VS2008,从未问过这个问题,但现在我很难在VS2003中使用控件。dataGridView不存在,我被迫使用DataGrid控件来显示一些数据。问题是,我想编辑此控件显示的一些值,并在数据库中反映这些更改,但我没有找到实现这一点的方法。已经“谷歌搜索”,没有找到相关结果,所以请给我一些帮助。我正在用C#编码

DataGrid
替换为
DataGridView
是有原因的。。。我希望您需要为1.1找到一个第三方网格控件来实现这一点(但旧的1.1变得越来越难)


抱歉,如果这没有多大帮助…

您可以使用SqlDataAdapter填充数据集并将此数据集绑定到DataGrid,在对DataGrid进行更改后,只需调用SqlDataAdapter.Update方法来更新数据库

您可以使用listview来列出数据库中的数据。您可以将listview的itemsource绑定到从DB获得的列表。还可以使listview可编辑

如果listview不够,可以使用WindowsFormHost,如

 System.Windows.Forms.FlowLayoutPanel advancedFlowLayoutPanel =
                                                this.flowLayoutHost.Child as System.Windows.Forms.FlowLayoutPanel;
            advancedFlowLayoutPanel.WrapContents = true;

在它里面,你可以放置DataGrid。

我从谷歌那里得到了一个链接,作为一个新用户,我无法发布它,当你用“DataGrid Windows msdn”单词进行谷歌搜索时,第一个结果有一个示例确保你将msnd的版本更改为1.1框架

希望这有帮助