This is a migrated thread and some comments may be shown as answers.

Assign data to specific row

6 Answers 35 Views
GridView
This is a migrated thread and some comments may be shown as answers.
chih hsien
Top achievements
Rank 1
chih hsien asked on 02 Apr 2012, 03:41 AM
Hi,

How to insert the data into the specific row on gridview?

Regards,
Clare

6 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 02 Apr 2012, 07:07 AM
Hello,

 Can you clarify what do you mean by "insert the data into the specific row on gridview"? Do you want to insert rows? 

All the best,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
chih hsien
Top achievements
Rank 1
answered on 02 Apr 2012, 11:48 AM
I can insert data at first row or last row of the gridview.
Now, I would like to know if I can insert data to specific row in the middle of the gridview?

Regards,
Clare

0
Vlad
Telerik team
answered on 02 Apr 2012, 11:50 AM
Hi,

 Have you tried to use Insert() method of the collection bound to the grid? 

All the best,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
chih hsien
Top achievements
Rank 1
answered on 03 Apr 2012, 03:54 AM
Thanks for your reply.
I can insert data successfully.

Now, I have another question.

When I click the insert button and press ESC button.
The new row will not cancel automatically like use ADD command.
I have to use Delete button to delete the data.

How to make "Insert" button do the same as ADD command?



0
Vlad
Telerik team
answered on 03 Apr 2012, 07:20 AM
Hello,

 You need to write custom code to achieve this. You need to execute some custom action on ESC press and delete previously remembered inserted item. The grid cannot handle such case by default. 

Regards,
Vlad
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
0
chih hsien
Top achievements
Rank 1
answered on 03 Apr 2012, 08:46 AM
I understanded.
Thanks for yor reply.
Tags
GridView
Asked by
chih hsien
Top achievements
Rank 1
Answers by
Vlad
Telerik team
chih hsien
Top achievements
Rank 1
Share this question
or