简体   繁体   English

如何从没有绑定源 C# 生成的 datagridview 中检索数据源?

[英]How to retrieve the data source from a datagridview generated without a binding source C#?

I have a datagridview in my code.我的代码中有一个 datagridview。 And I've added data to the datagridview through my program results.(without a data/binding source)我已经通过我的程序结果将数据添加到 datagridview 中。(没有数据/绑定源)

ie dataGridView1.Rows.Add("var1", "var2", "var3");即dataGridView1.Rows.Add("var1", "var2", "var3");

How can I bring back the displayed data as data source of that datagridview?如何将显示的数据恢复为该 datagridview 的数据源?

I could write like.. dataTable.Rows.Add("var1", "var2", "var3");… for making data source我可以这样写.. dataTable.Rows.Add("var1", "var2", "var3");... 用于制作数据源

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

相关问题 在C#中将数据源对象内的集合绑定到DataGridView - Binding a collection inside a data source object to a DataGridView in C# 如何从C#获取原始页面源(非生成源) - How to get raw page source (not generated source) from c# C#-在没有数据源控件的情况下绑定GridView Eval数据 - C# - Binding a GridView Eval data without a Data Source Control 当DataGridView数据源为空时,如何将按钮设置为Disable? C# - How to DIsable Button When DataGridView Data Source is empty? C# c#将图像添加到datagridview数据源 - c# adding images to a datagridview data source C#WinForms:如何强制DataGridView绑定其来自数据源的数据 - C# WinForms: How to enforce the DataGridView to bind its data from the data source 从C#中的数据源填充dataGridView之后,如何调整列的大小? - How do I resize columns after I populate the dataGridView from a data source in c#? 绑定源正确时,DataGridView不在C#中更新 - DataGridView Not Updating in C# When Binding Source is Correct 使用C#中的绑定源计算datagridview中的填充行问题 - Counting filled rows issue in datagridview using binding source in C# 具有图像路径的C#datagridview绑定源(如果不存在) - C# datagridview binding source with image path if not existing
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM