• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1162
  • Last Modified:

Rownumber from DataRow

This is probably a fairly simple question which I cannot seem to recall the answer.  I have a Datarow which I have pulled from a datagrid by using the following command:

(dtInfoSchema is a datatable)
dr = dtInfoSchema.Rows.Find(obj);

What I would like to know is which row from within the datagrid this datarow was positioned at.  How can I find out which row number in the datagrid this row is positioned at?  I need to know so that I can make a specific cell active and selected at that row number.


0
gvector1
Asked:
gvector1
1 Solution
 
topdog770Commented:
//Obtaining Current DataTable Row for a DataGrid

http://www.codeproject.com/cs/miscctrl/DBGridCurrentRow.asp >

// finding the index for a specific row  < from link below >

                intRow = ds.Tables[0].DefaultView.Find(txtFindArg.Text);

This link provides some good examples and complete info on getting the specific index of a datarow in a datatable

http://www.akadia.com/services/dotnet_find_methods.html  >



0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now