![]() Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem.Īs an alternate, you might consider creating your own class to do all of the various things you want done. IO.File.WriteAllLines(FileName, sender.ExportRows(AddHeader)) Public Sub WriteExportRowsToFile(ByVal sender As DataGridView, ByVal FileName As String, Optional ByVal AddHeader As Boolean = False) Return If(c.Value Is Nothing, "", c.Value.ToString) Where Not DirectCast(row, DataGridViewRow).IsNewRowĭirectCast(row, DataGridViewRow).Cells.Cast(Of DataGridViewCell).ToArray, Public Function ExportRows(ByVal sender As DataGridView, Optional ByVal AddHeader As Boolean = False) As String()įrom T In (Of DataGridViewColumn)() ''' Returns an array of data, optionally including One done here in DataGridViewExtensions.vb) ''' I advise you to take a few minutes to read the documentation and view their example.įor writing back to file ' Add column header
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |