Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gridview - select column can I hide?

Status
Not open for further replies.

flynbye

Programmer
Nov 16, 2001
68
US
Have a gridview where I've written come vb.net code to highlight each of the rows etc. on the mouseover even and will want to process a click event on the gridview control but don't want to see the "select" column and would rather the user able to select the row just based on the highlighting I've built in.

Problem that I'm having is that when I remove the gridview select column auto generate I get a validation error on the onclick event. Sooo... can I simply hide the select column? If so how in the world do I "touch" the thing as I can't see it in the regular column controls.

Thanks for your help!
CF

I always makes things much harder than they should be... that way later I can slap myself in the forhead after spending hours and hours on two lines of code and say to myself "DUH!"
 
Generally the easiest way to hide a column is to set the column width to 0. Its impossible to help further without you posting some sample code, and also please specify if you are using the Datagrid control


Sweep
...if it works dont f*** with it
curse.gif
 
i had the problem before and what i did was, populate a datatable and then use column mapping (as below) to hide the column, then bind it to the datagrid

Dim dtDatabase As New DataTable
'..populate it from db
dtDatabase.Columns("PKID").ColumnMapping = MappingType.Hidden
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top