Click to See Complete Forum and Search --> : DataGrid View TextMatrix???


ykpatel80
October 7th, 2006, 04:43 AM
Hi,
Can Anyone Tell me how to Access a particular column of a particular row. Same as there is TextMatrix Property in FlexGrid.
For e.g In FlexGrid I use
Val(grd.TextMatrix(R, 8)) to access the value at Rth row and 8th Column.
Can AnyOne tell me how to achieve the same funtionlity using
datagrid view.I am using using VB 2005 Express Edition.
thanks

aniskhan
October 7th, 2006, 01:53 PM
item property of datagridview
text=DataGridView1.Item(1,2).Value.ToString

aniskhan
October 7th, 2006, 01:56 PM
u can also do this
Text = DataGridView1.Rows(1).Cells(2).Value.ToString

ykpatel80
October 8th, 2006, 10:54 PM
I have tried bot of your suggestion but I am receiving error as below:
I any thing something that I am doing wrong.PLZ Help....


Index was out of range. Must be non-negative and less than the size of the collection.
Parameter name: index

aniskhan
October 9th, 2006, 06:04 AM
the row at index 1 and column at index 2 do not exist in ur datagridview thats why u get this indexOutofRange exception.

ykpatel80
October 12th, 2006, 12:40 AM
u can also do this
Text = DataGridView1.Rows(1).Cells(2).Value.ToString

Still, I am getting the error.
PLZ Help me
Object reference not set to an instance of an object.

aniskhan
October 12th, 2006, 01:30 PM
Sample

using Access DB "Attendence"
Student (Table)
--------
rno number
name text
sessno number

Can u show how r u using it in ur code so anybody can help u.