Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Data Binding Problem
Message
From
01/04/2003 10:17:18
 
 
To
01/04/2003 02:48:27
Keith Payne
Technical Marketing Solutions
Florida, United States
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00771847
Message ID:
00772407
Views:
5
Keith and Jim,

Keith ... No, Rows.Count - 1 was correct because he just added a new row and he wants to reposition at that row (zero-based, remember?).

Anyway, Jim, most of your code looks ok ... but of course we have no way of knowing what your SetEditNewMode() and SetArrowButtons() methods do. Plus, you havent' showed us the code that you are using to bind the textboxes.

~~Bonnie


>Jim,
>
>I'm not 100% certain, but
>
>        BindingContext(Me.DsJobTracker, "contacts").Position = DsJobTracker.Tables("contacts").Rows.Count
>
>looks like a winner in place of
>
>        BindingContext(Me.DsJobTracker, "contacts").Position = DsJobTracker.Tables("contacts").Rows.Count - 1
>
>
>I hope that works because my experience lays (+ grammar points!) with web forms not win forms.
>
>>Keith,
>>
>>Below is the code I have. Is there anything wrong with it?
>>
>>
>>  Dim Row As DataRow = DsJobTracker.Tables("contacts").NewRow()
>>
>>        'row = DsJobTracker.Tables("contacts").NewRow()
>>        Me.DsJobTracker.Tables("contacts").Rows.Add(Row)
>>        BindingContext(Me.DsJobTracker, "contacts").Position = DsJobTracker.Tables("contacts").Rows.Count - 1
>>        Me.SetEditNewMode(True, False)
>>        'ClearControls()
>>        Me.txtCompany.Select()
>>        Me.SetArrowButtons()
>>
>>
>>>Jim,
>>>
>>>Instead of clearing the textboxes, add a new row to the dataset.
>>>
>>>
>>>[Visual Basic]
>>>Dim workRow As DataRow = myDataset.Tables("mytable").NewRow()
>>>[C#]
>>>DataRow workRow = myDataset.Tables("mytable").NewRow();
>>>
>>>
>>>
>>>>Hello,
>>>>
>>>> I have a windows form with a bunch of textboxes that bind to a dataset. I also have a new button that clears the textboxes. When I enter text in my first textbox and tab off of it, the textboxes are populated with the previous record's information.
>>>>
>>>>What's wrong?
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Previous
Reply
Map
View

Click here to load this message in the networking platform