简体   繁体   English

如何在Winforms DevExpress中将GridView数据保存到Access数据库?

[英]How to Save GridView Data's to Access Database in Winforms DevExpress?

I Have GridView in the Form and Attached DataSource to it. 我在窗体中有GridView并将其附加了数据源。 1st Column having Repository_Grid_Lookup_Edit and Attached DataSource to it. 第一列具有Repository_Grid_Lookup_Edit并附加了数据源。 I perform Some Calculation and Obtain some results. 我执行一些计算并获得一些结果。 So now Totally 5 Rows and 6 Columns in the gridView. 所以现在在gridView中总共有5行和6列。 I have Save Button in the same Form, If i click Save Button I want to Store All this Data's to New Table in the GridView ?? 我在同一表格中有“保存”按钮,如果单击“保存”按钮,我想将所有这些数据存储到GridView中的“新表”中? How to Complete my Task. 如何完成我的任务。

Thanks in Advance. 提前致谢。 Sri 斯里

The GridView is just a View on the datas which you DataSource holds. GridView只是DataSource所保存数据的View。 So if you change some value in the GridView the underlying DataSource automaticly changes the value. 因此,如果您在GridView中更改某些值,则基础数据源会自动更改该值。 I recommend you to build a class which represents one data set. 我建议您建立一个代表一个数据集的类。 Then you create a List<MyClass> and use this as DataSource. 然后,创建一个List<MyClass>并将其用作数据源。 So your BusinessObjects change automaticly if someone edit a value in the Grid. 因此,如果有人在网格中编辑值,您的BusinessObjects会自动更改。

To your question: If you want to show the data in a new Table just create a new Grid and populate the List<MyClass> again. 问题:如果要在新表中显示数据,只需创建一个新的网格并再次填充List<MyClass> If you want to show the saved data only clone you List<MyClass> on SaveButton Click and populate it. 如果要仅显示已保存的数据克隆,请在SaveButton上单击List<MyClass>单击并填充它。

I hope i understand you. 我希望我能理解你。 If you need further help i post an short example. 如果您需要进一步的帮助,我会举一个简短的例子。

regards 问候

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在Winforms DevExpress中将GridView单元格值保存到Access数据库中? - How to Save GridView Cell Values to Access Database in winforms DevExpress? 从MS Access数据库和Gridview Winforms Devexpress中完全删除吗? - Delete Completely from MS Access Database and Gridview Winforms Devexpress? 如何从Access数据库获取值并在C#winforms Devexpress中的Gridview中进行设置? - How to get the values from Access Database and set in Gridview in C# winforms Devexpress? 如何将多行从GridView Winform Devexpress存储到Access数据库? - How to Store multiple Rows from GridView Winform Devexpress to Access Database? 如何通过例如过滤 GridView 数据。 第二个或第十个字符,DevExpress Winforms? - How to filter GridView data by eg. second or tenth character, DevExpress Winforms? 如何将数据填充到 devexpress gridview - How to populate data into devexpress gridview 如何使用EmbeddedNavigator在DevExpress GridView中保存行更改 - How to save row changes in DevExpress GridView with the EmbeddedNavigator 如何在Devexpress GridView中将CheckBoxRowSelect保存到类对象 - How to save CheckBoxRowSelect in Devexpress GridView to class object 如何将单击事件设置为行中的所有单元格? Gridview Winforms Devexpress - How to set click Event to all cells in a Row ? Gridview Winforms Devexpress 如何在EditValue中设置GridView的筛选器已更改? Winforms Devexpress - How to set filter for GridView in EditValue changed ? Winforms Devexpress
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM