EDN Admin
Well-known member
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, "spGetAllContacts", 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
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, "spGetAllContacts", 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