How To Insert A Row To A Specific Row Index

  • Thread starter Thread starter Arif Çimen
  • Start date Start date
A

Arif Çimen

Hi all,
I tried some code below:

//**************
int row=dataGrid1.CurrentRowIndex;

dataSet1.AcceptChanges();

DataRow newRow=dataSet1.Tables[0].NewRow();

newRow["Tarih"]=DateTime.Now.ToString();

int count=dataSet1.Tables[0].Rows.Count;

dataSet1.Tables[0].Rows.InsertAt(newRow,0);

//************

But these codes adds the newRow to end of the rows, not to index 0 .

Any ideas?

Thanks for any help.

Arif Çimen
 
Thanks Cor,
I 've already read the help. But I still need some assistance.

Can you help me more?

Arif.
 
Back
Top