I know it'll be simple for you guys| call takes 1 overload???
Hi,
Just wondering if you could tell me what im meant to put in the Call() brackets.
private void Call(DataGridViewCellEventArgs o)
{
int rowIndex = o.RowIndex;
string t = dataGridView2.Rows[o.RowIndex].Cells["Name"].Value.ToString();
textBox1.Text = t;
}
private void button3_Click(object sender, EventArgs e)
{
Call();
}
}
Thanks
Anthony
Subhendu DePosted Dec 11, 2010, 11:23 PM
Normally you can write
DataGridViewCellEventArgs obj = new DataGridViewCellEventArgs(
Pass this obj to the Call method.
ColumnIndex & RowIndex is mandatory field and you have to specify.
Thanks.....
Sam HobbsPosted Dec 12, 2010, 5:36 PM
Suthish NairPosted Dec 12, 2010, 5:19 PM
http://social.msdn.microsoft.com/Forums/en-US/Vsexpressvcs/thread/6a2892f3-007c-4e1a-a0f7-484f2f8791f9
Anthony ClarkePosted Dec 12, 2010, 3:57 PM
I just want to be able to call that function with another but it keeps erroring because it says call needs at least 1 overload.
Thanks Anthony
Sam HobbsPosted Dec 12, 2010, 3:24 PM
And then you don't need to call Call. If however there is more that the Call method does and you must call Call then say so and we will figure out how to do that.
Anthony ClarkePosted Dec 12, 2010, 1:56 PM
public void Call(DataGridViewCellEventArgs o)
{
int rowIndex = o.RowIndex;
string t = dataGridView2.Rows[o.RowIndex].Cells["Name"].Value.ToString();
textBox1.Text = t;
}
private void button2_Click_1(object sender, EventArgs e)
{
DataGridViewCellEventArgs obj = new DataGridViewCellEventArgs(obj.ColumnIndex , obj.RowIndex);
Call(obj);
}
it errors on obj saying use of unassigned variable.
On button click im trying to convert the select row with column "Name" to a textbox.
Thanks
Anthony
Sam HobbsPosted Dec 12, 2010, 12:10 AM