PC Review


Reply
Thread Tools Rate Thread

bindingSource.Position = ... doesn't change the current property.

 
 
Mr. X.
Guest
Posts: n/a
 
      29th May 2010
Hello.
I have
bs as BindingSource

When I do :
bs.Position = 3.

Current isn't changed to the position I gave.

What should I do instead ?

Thanks
 
Reply With Quote
 
 
 
 
Armin Zingler
Guest
Posts: n/a
 
      29th May 2010
Am 29.05.2010 20:10, schrieb Mr. X.:
> Hello.
> I have
> bs as BindingSource
>
> When I do :
> bs.Position = 3.
>
> Current isn't changed to the position I gave.
>
> What should I do instead ?


How do you see that it doesn't change? I've tried it based on the example here:
http://msdn.microsoft.com/en-us/library/system.windows.forms.bindingsource.current(VS.90).aspx

If you add

Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
MyBase.OnLoad(e)

PopulateBindingSourceWithFonts()
Debug.WriteLine(bindingSource1.Current.ToString)
bindingSource1.Position = 1
Debug.WriteLine(bindingSource1.Current.ToString)

End Sub

the output is:

[Font: Name=Arial Black, Size=8, Units=3, GdiCharSet=1, GdiVerticalFont=False]
[Font: Name=Bart, Size=9, Units=3, GdiCharSet=1, GdiVerticalFont=False]

So, Current does change in this case.


--
Armin
 
Reply With Quote
 
Mr. X.
Guest
Posts: n/a
 
      29th May 2010
O.K.
My mistake.
I didn't free an object that is connected to binding-source.
By doing that, some strange things happen.

Thanks

"Armin Zingler" <(E-Mail Removed)> wrote in message
news:ODwHDA2$(E-Mail Removed)...
> Am 29.05.2010 20:10, schrieb Mr. X.:
>> Hello.
>> I have
>> bs as BindingSource
>>
>> When I do :
>> bs.Position = 3.
>>
>> Current isn't changed to the position I gave.
>>
>> What should I do instead ?

>
> How do you see that it doesn't change? I've tried it based on the example
> here:
> http://msdn.microsoft.com/en-us/library/system.windows.forms.bindingsource.current(VS.90).aspx
>
> If you add
>
> Protected Overrides Sub OnLoad(ByVal e As System.EventArgs)
> MyBase.OnLoad(e)
>
> PopulateBindingSourceWithFonts()
> Debug.WriteLine(bindingSource1.Current.ToString)
> bindingSource1.Position = 1
> Debug.WriteLine(bindingSource1.Current.ToString)
>
> End Sub
>
> the output is:
>
> [Font: Name=Arial Black, Size=8, Units=3, GdiCharSet=1,
> GdiVerticalFont=False]
> [Font: Name=Bart, Size=9, Units=3, GdiCharSet=1, GdiVerticalFont=False]
>
> So, Current does change in this case.
>
>
> --
> Armin


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
BindingSource.Current is null on position change. Gerard Microsoft ADO .NET 4 18th Mar 2008 09:19 AM
BindingSource.EndEdit and Position =?iso-8859-1?Q?Samuel_Garc=EDa?= Microsoft ADO .NET 0 3rd Nov 2007 08:11 PM
onclick change property value of form position =?Utf-8?B?WmVsamtv?= Microsoft C# .NET 1 20th Jun 2007 06:02 PM
Why doesn't changing the position in a table change the position of the DatGridView that's bound to it? Sam Malone Microsoft VB .NET 2 2nd Jun 2006 02:40 PM
BindingSource TableAdapter Position =?Utf-8?B?R2lvdmFubmk=?= Microsoft ADO .NET 0 6th Feb 2006 09:30 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:58 AM.