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

empty row at the end of dataGridView

$
0
0

Hi,

I bind a dataGridView like below

 private void Form1_Load(object sender, EventArgs e)
        {
            SqlDataReader dr = mydalbase.ExecuteReader(System.Data.CommandType.StoredProcedure, "spGetAllContacts", new SqlParameter[]{
            });
            BindingSource BindingSource1 = new BindingSource();
            BindingSource1.DataSource = dr;
            dataGridView1.DataSource = BindingSource1;

and the Allowusertoaddrows is true

I need an empty row at the end of datagridview,can I have it when I bind contol programmatically?

If no I have another question

when I bind control with wizard there is a blank row at the end but only the id column isn't empty

but i want id column be empty too.

the id column in database is identity

thanks


Viewing all articles
Browse latest Browse all 2535

Trending Articles



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