TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
meenakshi_krishnamurthy
NA
11
0
How to get datagrid cell value for the selected row?
Dec 9 2003 1:38 PM
Windows Forms Application vb.net / access I need to get the cell value of selected row of the datagrid and pass it on to another form to display info based on the cell value. I went as far as to get the current cell value of the grid. could not get the datagridtextboxcolumn to work. I have a getdataset routine which I am calling for various places and at each point passing a unique name for dataset to identify from where it is initiated. So the problem is I am not providing the correct Tablestyles index. I have the following code in Datagrid.DoubleClick event: Dim j As Integer = DataGrid1.CurrentRowIndex() Dim dgc As New DataGridCell() dgc.ColumnNumber = 11 dgc.RowNumber = j DataGrid1.CurrentCell = dgc Dim dgtb As DataGridTextBoxColumn = DataGrid1.TableStyles(0).GridColumnStyles(11) Dim pkey As String = dgtb.TextBox.Text Error message at DatagridTextBoxColumn - An unhandled exception of type 'System.ArgumentOutOfRangeException' occurred in mscorlib.dll Additional information: Index was out of range. Must be non-negative and less than the size of the collection Any help will be highly appreciated. TIA
Reply
Answers (
1
)
Can Datareader be used instead of Data Adapter to populate the Datagrid
connect to an external sql server from window form