I have a fairly complicated app that uses a datagridview to display some database table data. I've set up routines to save the dgv layout such as column widths, column ordering, column visibility, etc.
What I've run into is that code like this naturally selects the *table* column zero, instead of what's visible to the user as column zero.
Column zero in my database is an auto incrementing primary key, so that column is hidden from the user. Additionally, the columns can be re-ordered by the user, further complicating the issue of determining what actually is the left most column in the grid that's visible to the user.
Is there a way to figure out what is the left most column in the datagridview visually, as seen by the user?
Hope this makes sense!
Thanks in advance.
Z
VB.NET:
DG.Rows(0).Selected = True
What I've run into is that code like this naturally selects the *table* column zero, instead of what's visible to the user as column zero.
Column zero in my database is an auto incrementing primary key, so that column is hidden from the user. Additionally, the columns can be re-ordered by the user, further complicating the issue of determining what actually is the left most column in the grid that's visible to the user.
Is there a way to figure out what is the left most column in the datagridview visually, as seen by the user?
Hope this makes sense!
Thanks in advance.
Z