PC Review


Reply
Thread Tools Rate Thread

BindingSource

 
 
Vasco
Guest
Posts: n/a
 
      4th May 2010
You cannot vote on your own post
0

Hello,

I use a master/detail form, where records are shown. this form was created
in VB 2010, using the design tools of VS. When i select add on
BindingNavigator, the bound controls clear, as expected.

The behaviour i need is the opposite. Like that i can create a new record,
based on the last one.
Any suggestion?

thanks
 
Reply With Quote
 
 
 
 
Miro
Guest
Posts: n/a
 
      5th May 2010
I am not quite sure if I understand what you are asking for.

You want to "Default" the current record with the prior record?

Is that what you are looking for?

"Vasco" <(E-Mail Removed)> wrote in message
news:4A426B74-4F43-46E8-96E8-(E-Mail Removed)...
> You cannot vote on your own post
> 0
>
> Hello,
>
> I use a master/detail form, where records are shown. this form was created
> in VB 2010, using the design tools of VS. When i select add on
> BindingNavigator, the bound controls clear, as expected.
>
> The behaviour i need is the opposite. Like that i can create a new record,
> based on the last one.
> Any suggestion?
>
> thanks


 
Reply With Quote
 
Vasco
Guest
Posts: n/a
 
      5th May 2010
i want to create a new record, based on the values of another record.

basixally i want to copy records.

anyway, i managed to find a solution:

If Me.G01BindingSource.Current IsNot Nothing Then
Dim drvOld As DataRowView =
DirectCast(Me.G01BindingSource.Current, DataRowView)
Dim drvNew As DataRowView =
DirectCast(Me.G01BindingSource.AddNew(), DataRowView)
For Each dc As DataColumn In drvNew.Row.Table.Columns
If Not dc.ReadOnly AndAlso Not dc.AutoIncrement Then 'Don't
try to overwrite a ReadOnly or AutoIncrement column.
drvNew.Row(dc) = drvOld.Row(dc)
End If
Next dc

Me.G01BindingSource.ResetBindings(False)
End If

G01_BindindSource refers to main table. Process is similar to child table.


"Miro" wrote:

> I am not quite sure if I understand what you are asking for.
>
> You want to "Default" the current record with the prior record?
>
> Is that what you are looking for?
>
> "Vasco" <(E-Mail Removed)> wrote in message
> news:4A426B74-4F43-46E8-96E8-(E-Mail Removed)...
> > You cannot vote on your own post
> > 0
> >
> > Hello,
> >
> > I use a master/detail form, where records are shown. this form was created
> > in VB 2010, using the design tools of VS. When i select add on
> > BindingNavigator, the bound controls clear, as expected.
> >
> > The behaviour i need is the opposite. Like that i can create a new record,
> > based on the last one.
> > Any suggestion?
> >
> > thanks

>
> .
>

 
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
about using BindingSource Tony Johansson Microsoft C# .NET 3 27th Aug 2009 02:18 PM
BindingSource Tony Johansson Microsoft C# .NET 0 26th Aug 2009 01:10 PM
about BindingSource Tony Johansson Microsoft C# .NET 0 12th May 2009 10:39 AM
bindingsource =?Utf-8?B?dGl6aWFubyBmYWJicmk=?= Microsoft Dot NET Compact Framework 0 18th Jul 2006 01:51 PM
bindingsource silesius Microsoft C# .NET 3 21st Dec 2005 07:28 AM


Features
 

Advertising
 

Newsgroups
 


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