Click here to Skip to main content
15,880,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am working with grid view, The data will bind from sql,
My problem with i am using array to delete a single row,

After deleting the row, when i added another one, the deleted row also showing me.

Ex:
SelectItem ADD.

Gridview:
1. Delete Apple Cost
2. Delete Mango Cost
3. Delete Pain apple Cost

The data is from SQL. i want to delete 3rd row. and want to insert another one. but i am getting like this.

Gridview:
1. Delete
2. Delete
3. Delete
4. Delete Orange Cost

I am using array to delete rows.

My Code is:
GV_Order.Rows.RemoveAt(e.RowIndex);
Array.Clear(arr,e.RowIndex,5);

Please help me
Posted
Comments
Al Moje 8-Sep-11 2:27am    
Hi,
I think the best way to manage the deletion of Data Grid, Data List or Array which is connected into Database is that upon deletion on such in a grid, list or array must reflect immediately in the database table rather delete it immediately in the database table.
Jephunneh Malazarte 8-Sep-11 4:31am    
can you post ur entire code for that instance? you probably have late binding of some sort?
[no name] 8-Sep-11 6:11am    
can u explain in more detail or add your code becuase idid n't understand excataly your describtion

1 solution

Hi,
You need to rebind the grid after deleting each item with your updated data source.
If you post more code it will help me to provide specific answer
Thanks
Faisal
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900