c# - How to insert data into datatable from datagrid without using ItemSource in Wpf? -


i have datagrid has dataview itemsource . datagrid not display data in dataview. i.e if dataview has 21 column datagrid displayed 13 column.now want select 13 columns , add new datatable. dont know how this. please me. thankyou

you can use dataview.totable:

c#:

string[] columnnames = { " col1", "col2", "...", "col13" }; datatable newtable = view.totable("tablename", false, columnnames); 

vb.net:

dim columnnames = { " col1", "col2", "...", "col13" } dim newtable datatable = view.totable("tablename", false, columnnames) 

Comments

Popular posts from this blog

javascript - jQuery: Add class depending on URL in the best way -

caching - How to check if a url path exists in the service worker cache -

Redirect to a HTTPS version using .htaccess -