Click here to Skip to main content
15,914,452 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how to delete selected column in datagridview VB.Net
Posted
Updated 29-Nov-18 10:33am

See this link [Convert accordingly]

Deleting column from the datagridview[^]

Regards..:)
 
Share this answer
 
v2
Easier to just answer it, say you want to delete columns 2 through 5
VB
for i as integer = 5 to 2 step -1
     datagridview.Columns.RemoveAt(i)
next i

Remove highest index first or you'll run into difficulties
 
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