|
|
|
start date: Tue, 7 Aug 2007 02:08:00 -0700,
posted on: microsoft.public.dotnet.languages.vb.controls
back
| Thread Index |
|
1
Matt
|
|
2
AlexS LEASE
|
|
3
Matt
|
|
4
AlexS LEASE
|
DataGridView Possible Bug?
I have what looks like a bug using the DataGridView:
I am populating a DataView and then setting the DataGridView to display this
as the source. I then want to add two unbound columns to add some derived
information:
nL1 = DataGridView1.Columns.Add("OULevel1", "OULevel1")
nL2 = DataGridView1.Columns.Add("OULevel2", "OULevel2")
These columns are added correctly and nL1 =0 and nL2 =1 but when I try and
access the data in them:
For i As Long = dvMain.Count To 1 Step -1
Debug.Print(dvMain.Item(i - 1).Item(nL1))
Debug.Print(dvMain.Item(i - 1).Item(nL2))
Next
These actually return the data in columns 2 and 3 (which were columns 0 and
1 before the add)
How can I access the data in these new columns?
Date:Tue, 7 Aug 2007 02:08:00 -0700
Author:
|
Re: DataGridView Possible Bug?
Do you have row header column visible?
"Matt" wrote in message
news:DB090334-D117-4B33-8019-6B25E734AF8E@microsoft.com...
>I have what looks like a bug using the DataGridView:
>
> I am populating a DataView and then setting the DataGridView to display
> this
> as the source. I then want to add two unbound columns to add some derived
> information:
>
> nL1 = DataGridView1.Columns.Add("OULevel1", "OULevel1")
> nL2 = DataGridView1.Columns.Add("OULevel2", "OULevel2")
>
> These columns are added correctly and nL1 =0 and nL2 =1 but when I try and
> access the data in them:
>
> For i As Long = dvMain.Count To 1 Step -1
> Debug.Print(dvMain.Item(i - 1).Item(nL1))
> Debug.Print(dvMain.Item(i - 1).Item(nL2))
> Next
>
> These actually return the data in columns 2 and 3 (which were columns 0
> and
> 1 before the add)
>
> How can I access the data in these new columns?
Date:Tue, 7 Aug 2007 07:41:05 -0400
Author:
|
Re: DataGridView Possible Bug?
RowHeadersVisible = True
"AlexS" wrote:
> Do you have row header column visible?
>
> "Matt" wrote in message
> news:DB090334-D117-4B33-8019-6B25E734AF8E@microsoft.com...
> >I have what looks like a bug using the DataGridView:
> >
> > I am populating a DataView and then setting the DataGridView to display
> > this
> > as the source. I then want to add two unbound columns to add some derived
> > information:
> >
> > nL1 = DataGridView1.Columns.Add("OULevel1", "OULevel1")
> > nL2 = DataGridView1.Columns.Add("OULevel2", "OULevel2")
> >
> > These columns are added correctly and nL1 =0 and nL2 =1 but when I try and
> > access the data in them:
> >
> > For i As Long = dvMain.Count To 1 Step -1
> > Debug.Print(dvMain.Item(i - 1).Item(nL1))
> > Debug.Print(dvMain.Item(i - 1).Item(nL2))
> > Next
> >
> > These actually return the data in columns 2 and 3 (which were columns 0
> > and
> > 1 before the add)
> >
> > How can I access the data in these new columns?
>
>
>
Date:Tue, 7 Aug 2007 05:06:00 -0700
Author:
|
Re: DataGridView Possible Bug?
Then, most probably, you need to adjust index for this additional column.
Maybe you should use Rows and Columns collections instead
"Matt" wrote in message
news:C645D807-4097-41D2-AAD9-623DCB144EAE@microsoft.com...
> RowHeadersVisible = True
>
>
>
> "AlexS" wrote:
>
>> Do you have row header column visible?
>>
>> "Matt" wrote in message
>> news:DB090334-D117-4B33-8019-6B25E734AF8E@microsoft.com...
>> >I have what looks like a bug using the DataGridView:
>> >
>> > I am populating a DataView and then setting the DataGridView to display
>> > this
>> > as the source. I then want to add two unbound columns to add some
>> > derived
>> > information:
>> >
>> > nL1 = DataGridView1.Columns.Add("OULevel1", "OULevel1")
>> > nL2 = DataGridView1.Columns.Add("OULevel2", "OULevel2")
>> >
>> > These columns are added correctly and nL1 =0 and nL2 =1 but when I try
>> > and
>> > access the data in them:
>> >
>> > For i As Long = dvMain.Count To 1 Step -1
>> > Debug.Print(dvMain.Item(i - 1).Item(nL1))
>> > Debug.Print(dvMain.Item(i - 1).Item(nL2))
>> > Next
>> >
>> > These actually return the data in columns 2 and 3 (which were columns 0
>> > and
>> > 1 before the add)
>> >
>> > How can I access the data in these new columns?
>>
>>
>>
Date:Wed, 8 Aug 2007 18:32:48 -0400
Author:
|
|
|