Click here to Skip to main content
15,892,072 members
Please Sign up or sign in to vote.
2.00/5 (3 votes)
See more:
using that index no delete the column
Posted
Comments
deepankarbhatnagar 30-Mar-15 6:51am    
Please elaborate your query..
Member 11565624 30-Mar-15 8:40am    
we have gridview in that gridview i add delete button of every column.when click on delete button that column is deleted..

1 solution

IN GridView RowDataBound event


DataRowView tableData = e.Row.DataItem as DataRowView;
int pos = tableData.GetIndex("MyFieldName");
 
Share this answer
 
Comments
Member 11565624 30-Mar-15 8:06am    
dont use field name.
Member 11565624 30-Mar-15 8:45am    
don't use field name.with out using field name we find the column index..and use that index we delete the column in gridview in button click event.

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