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

I am working with a windows Forms. If txtValue="A" then I want to bind the Data source with different column headers. If txtValue="B" then I want to bind the data source with different column headers. How to achieve this in windows Forms for Datagridview?
Posted

1 solution

you can change the column name based on condition
VB
If txtValue="A" then
  Datagridview1.Columns(0).Name = "Column1(A)"
endif txtValue="B" then
  Datagridview1.Columns(0).Name = "Column1(B)"
end if
 
Share this answer
 
v2

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