"jaYPee" <hi******@yahoo.com> wrote in message
news:25********************************@4ax.com...
i'm wondering how can i get the value of primary key in datagrid.
Do you mean to have it present so that you can click on a row and retrieve
the value, but not see the pk in the grid?
If yes, you can include the column in your data set and set the width of the
column to 0.
Then, in your grids Click event, do something like this.
Dim dc As DataGridCell = MyGrid.CurrentCell 'This will be set to column 0
of the row you selected. You can change that to whatever column you like
Dim intID As Integer = MyGrid.Item(dc)
Hope that helps.