I'm working with vb.net 2005.
I have a class that i've loaded up with my data. Then created a datasource
off the class. I load up the datagridview with data from a class.. all this
is working fine. I've got data.
My problem is with the tag on the datagridview. I've gone in and bound it to
the column in the datasource taht I want (i've done it like this before)
when i create the double click event on the datagridview, in other code i've
been able to do a datagridview.tag and get the value of column and row that
i've double clicked on. I can't figure it out why it's giving me a value =
nothing instead.
there must be something that I'm forgetting because like I said.. i've done
this before...
hopefully someone can help.
Here is what I'm doing to load up the datagridview with data...
With oBuildingUtils
.LoadFromDB()
End With
With oBuildings
oBuildings = oBuildingUtils.Load("")
End With Me.BuildingDataGridView.DataSource = oBuildings
Like i mention above.. this part is working.. just not when i double click
on the datagridview.
thanks
shannon
jvCoach - 25 Sep 2006 13:56 GMT
If i do a
me.ComputerNameDataGridView.Rows(me.ComputerNameDatagridView.CurrentRow.Index).Cells(1).value
i get the value i want.. but using the tag has worked for me in the past but
i'm just not getting something... hopefully someone out there can tell me
what I've forgotten.
Thanks
Shannon
> I'm working with vb.net 2005.
>
[quoted text clipped - 29 lines]
> thanks
> shannon
Bart Mermuys - 25 Sep 2006 16:06 GMT
Hi,
> I'm working with vb.net 2005.
>
[quoted text clipped - 27 lines]
> Like i mention above.. this part is working.. just not when i double click
> on the datagridview.
The above code only shows the binding of the new DataSource to the
DataGridView, but you also need to bind the new DataSource to the Tag
property. .
A better option is probely using a BindingSource. Create a DataSource for
your Building class, from the DataSources Window drag the Building
DataSource on the Form and it will create a BuildingDataGridView and also a
BuildingBindingSource, then bind the DataGridView's Tag property to the
BuildingBindingSource.
Then in code you would only need to change the DataSource of the
BindingSource:
With oBuildingUtils
.LoadFromDB()
oBuildings = .Load("")
End With
BuildingBindingSource.DataSource = oBuildings
HTH,
Greetings
> thanks
> shannon
jvCoach - 25 Sep 2006 16:43 GMT
thanks a million.. that fixed it..
> Hi,
>
[quoted text clipped - 54 lines]
>> thanks
>> shannon