Getting data from a datagrid

R

Robert Batt

Hello,
I have a bound datagrid called dgjobs that is bound
to a dataset called dsjobs using the following code.

Me.dgJobs.DataSource = dsJobs.Tables!Jobs
cm = CType(Me.BindingContext(dsJobs.Tables!jobs),
CurrencyManager)

The grid populates just fine however when the
currentcellchanged event is triggered (i.e. when you
scroll or click another row) I wish to get the value of the
first column (jobkey) in the currently selected row so
that I may use this as a parameter for a procedure. Any
ideas how I can read the data from the grid.

Thanx in advance

Robert Batt
 
K

Ken Tucker

Hi,

Try something like this.
Me.Text = DataGrid1(DataGrid1.CurrentRowIndex,0).ToString

Ken
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top