Hello:
I have a big array of string and I need fast way to load this strings in a datagrid rows using virtual mode datagridview.
Please Can you help me?
Thank you very much
Printable View
Hello:
I have a big array of string and I need fast way to load this strings in a datagrid rows using virtual mode datagridview.
Please Can you help me?
Thank you very much
You need to put the strings into an object that implements IEnumerable (such as a List<string>), then you can just DataBind the list to the DataGridView.
Hi CGKevin:
If i have a List of string named str, how can I put his items in datagridview rows with datagrid virtual Mode?
Is possible you show me the correct code?
I think i need:
DataGridView1.VirtualMode = True
CellValueNeeded.(I donĀ“t know can i use it)
But I don`t know the way to do it.
Thank you very much.
See this Microsoft article on using virtual mode with a DataGridView. http://msdn.microsoft.com/en-us/library/2b177d6d.aspx
Hi CGKevin:
I see the link but I don't understand.
Is possible you help me with code?
I need put the items of list or array string in datagridview rows.
Thank you very much
The upshot is that if you are going to use virtual mode, that means you are not going to allow the DataGrid to manage it's data binding, you are going to code the DataGrid's data access yourself. While there are legitimate resons to do this, if you are a beginner, unless you have a compelling reason, you should probably allow the DataGrid to handle data access via it's built in data binding. The MS example gives you all the code you need to program the virtual mode of the DataGridView. I'm not sure what my re-writing that code would do for you.