Display few columns in datagridview.
-
Hi everyone, I have a table with 4 columns = "Name", "Age", "Place","Salary". I want to display only "Name" and "Age" column with entries in Datagridview in my Form. Cany anyone please tell me how to do this?
I'll assume you're using VB.NET or something similar... If you don't want to show certain columns, simply don't show them. This may entail turning off auto-generate columns in your grid and adding in your own custom column definitions (lots of examples of grids can be found on Google.) The other alternative is to make your datasource come from a query or view rather than grabbing the whole table. -Dave
-
Hi everyone, I have a table with 4 columns = "Name", "Age", "Place","Salary". I want to display only "Name" and "Age" column with entries in Datagridview in my Form. Cany anyone please tell me how to do this?
simple just do it
gv.Cloumns["YourColumnsName4hide"].Visible = False
that's itSyed Shahid Hussain