Quantcast
Channel: Windows Forms Data Controls and Databinding forum
Viewing all articles
Browse latest Browse all 2535

How to add a set row to the beginning of DataGridView after or before its bound with the rest of the values

$
0
0

So I have a DataGridView that im binding with directory listings.. Not sure why when switching from the Checkboxlist control to this control my "root" directory is no longer being bound in the list.

So I need to be able to add the "root" directory listing "/" to the beginning of the DataGridView list.

I found this code and it works, but adds it to the end of the list and only the first time, after you navigate away from the directory listing to another directory, it doesn't work.

                DataGridViewRow row = (DataGridViewRow)dgvFiles.Rows[0].Clone();
                row.Cells[0].Value = "/";
                dgvFiles.Rows.Add(row);


Viewing all articles
Browse latest Browse all 2535

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>