empty row at the end of dataGridView

EDN Admin

Well-known member
Joined
Aug 7, 2010
Messages
12,794
Location
In the Machine
Hi,
I bind a dataGridView like below
<pre class="prettyprint private void Form1_Load(object sender, EventArgs e)
{
SqlDataReader dr = mydalbase.ExecuteReader(System.Data.CommandType.StoredProcedure, &quot;spGetAllContacts&quot;, new SqlParameter[]{
});

BindingSource BindingSource1 = new BindingSource();
BindingSource1.DataSource = dr;
dataGridView1.DataSource = BindingSource1;[/code]
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 isnt empty
but i want id column be empty too.
the id column in database is identity
thanks



View the full article
 
Back
Top