Vb .net 2005 Bindingnavigator Help

free web hosting
Free Web Hosting > Computers & Tech > Programming > Programming General > BASIC / Visual Basic (.NET)

Vb .net 2005 Bindingnavigator Help

dhanesh
As my earlier post mentioned about this small software i am trying to break my head with. Its a simple task of typing values into the field and when the "ENTER" button is hit it should add the values into the database and clear the text boxes and "Add a NEW row". This addition of new row is done through the Add New (Plus) button on the Binding Navigator bar. I dont need to manually press this button. I need to do the job of that plus button when i hit enter.

This is my code. Sorry its messed up with loads of comments but by time it was getting frustrating. I'd appriciate any small help on this. The events i mentioned after i hit ENTER are all under the button "btenter"

CODE
Public Class Form1

    Private Sub CFRecordsBindingNavigatorSaveItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
        Me.Validate()
        Me.CFRecordsBindingSource.EndEdit()
        Me.CFRecordsTableAdapter.Update(Me.KVCFDataSet.CFRecords)

    End Sub


    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        'TODO: This line of code loads data into the 'KVCFDataSet.CFRecords' table. You can move, or remove it, as needed.
        Me.CFRecordsTableAdapter.Fill(Me.KVCFDataSet.CFRecords)
        NameTextBox.Focus()
        NameTextBox.Text = ""
        AgeTextBox.Text = ""
        GenderTextBox.Text = ""
        NationalityTextBox.Text = ""
        UniversityCompanyTextBox.Text = ""
        EmailIDTextBox.Text = ""
        SpecializationTextBox.Text = ""



    End Sub

    'Private Sub btenter_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btenter.Click

    '    Me.Validate()
    '    Me.CFRecordsBindingSource.EndEdit()
    '    Me.CFRecordsTableAdapter.Update(Me.KVCFDataSet.CFRecords)
    '    NameTextBox.Text = ""
    '    'AgeTextBox.Text = ""
    '    GenderTextBox.Text = ""
    '    NationalityTextBox.Text = ""
    '    UniversityCompanyTextBox.Text = ""
    '    EmailIDTextBox.Text = ""
    '    SpecializationTextBox.Text = ""
    '    NameTextBox.Focus()

    '    'Dim nrow As DataRow = KVCFDataSet.CFRecords.NewRow

    '    'nrow("Name") = NameTextBox.Text
    '    'nrow("Age") = CInt(AgeTextBox.Text)
    '    'nrow("Gender") = GenderTextBox.Text
    '    'nrow("Nationality") = NationalityTextBox.Text()
    '    'nrow("UniversityCompany") = UniversityCompanyTextBox.Text
    '    'nrow("EmailID") = EmailIDTextBox.Text
    '    'nrow("Specialization") = SpecializationTextBox.Text

    '    'KVCFDataSet.CFRecords.Rows.Add(nrow)
    '    'Me.CFRecordsTableAdapter.Update(Me.KVCFDataSet.CFRecords)
    'End Sub

    'Private Sub CFRecordsBindingSource_AddingNew(ByVal sender As Object, ByVal e As System.ComponentModel.AddingNewEventArgs) Handles CFRecordsBindingSource.AddingNew
    '    Dim newrow As KVCFDataSet.CFRecordsRow
    '    newrow = KVCFDataSet.CFRecords.NewRow
    '    newrow.Name = NameTextBox.Text
    '    newrow.Age = AgeTextBox.Text
    '    newrow.Gender = GenderTextBox.Text
    '    newrow.Nationality = NationalityTextBox.Text
    '    newrow.UniversityCompany = UniversityCompanyTextBox.Text
    '    newrow.EmailID = EmailIDTextBox.Text
    '    newrow.Specialization = SpecializationTextBox.Text
    '    KVCFDataSet.CFRecords.AddCFRecordsRow(newrow)
    '    e.NewObject = newrow
    '    CFRecordsBindingSource.Position = CFRecordsBindingSource.Count - 1
    'End Sub

    Private Sub BindingNavigatorAddNewItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BindingNavigatorAddNewItem.Click

    End Sub

    Private Sub SpecializationTextBox_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles SpecializationTextBox.KeyDown
        If e.KeyCode = Keys.Enter Then
            Me.BindingNavigatorAddNewItem_Click(sender, e)
            'BindingNavigatorAddNewItem_Click(sender, e)
        End If
    End Sub

    Private Sub SpecializationTextBox_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles SpecializationTextBox.TextChanged

    End Sub
End Class


Regards
Dhanesh.


 

 

 


Reply

faulty.lee
Do you mind to attached the complete file for both form and code here, if possible the complete project, since it's a simple app. It would make us easier on helping you. Without the form file, we can't see what configuration has you configure for those control you placed on the form

Reply

dhanesh
QUOTE(faulty.lee @ Apr 28 2007, 10:12 PM) *
Do you mind to attached the complete file for both form and code here, if possible the complete project, since it's a simple app. It would make us easier on helping you. Without the form file, we can't see what configuration has you configure for those control you placed on the form

Here is the file .. If possible you can add me on msn or gmail, just let me know where and i'll pm you my ID

Thanks
Regards
Dhanesh.

Reply

faulty.lee
Try add

CODE
CFRecordsBindingSource.AddNew()


towards the end of your btenter_Click. I did that and it works out. Just not sure if that's what you want.

Reply

dhanesh
QUOTE(faulty.lee @ Apr 29 2007, 03:27 PM) *
Try add

CODE
CFRecordsBindingSource.AddNew()


towards the end of your btenter_Click. I did that and it works out. Just not sure if that's what you want.

Bingo ! This code works like a charm. I also tried it by adding this line to the btenter_Click
CODE
Me.CFRecordsTableAdapter.Fill(Me.KVCFDataSet.CFRecords)

This also works, incase anyone looking through this post would like an alternative.

Great healp lee, thanks again and i'll keep those questions shooting wink.gif

Regards
Dhanesh.

 

 

 


Reply

faulty.lee
You're welcome, glade that helps

Reply

FeedBacker
How to set datasource property of binding navigator control
Vb .net 2005 Bindingnavigator Help

Hi

I wanted to know how can set datasource property of bindingnavigator control dynamically.I have multiple databases based on the databse I select I want the binding navigator to work accordingly,can you Please help me

-deepthi

Reply

FeedBacker
How to get the next row data in the form by using a button
Vb .net 2005 Bindingnavigator Help

Hi there
Actually I am a programmer in VB 6.0 .Now need to do some work in VB.Net
And getting some problem
My question is
I have a Database which have a table called Notes which have some fields in it
Now I have VB.Net form which I have designed by putiing text and labels
Now I need to populate them withnotes database row at a time
I have a button in the form which when I press will give next row to me
I don't want to use bindingnavigator
Pleas help me with this

Regards
Vaibhav

-question by Vaibhav jindal

Reply


Got an Opinion! Express your Views! (no registration):-
Add your Reply/ Opinion/ Views/ Comments/ Suggestion/ Questions/ Queries etc.
Posts with decent grammar & English will be accepted and please refrain from profanities.
For asking a Question, We recommend you to sign-up (for free) so that you can track the topic easily.

Nature of your Post*: Opinion/ Reply/ Comments
Question/Query
Feedback to us.
       
Name   Email
Title/Question*

Recent Queries:-
  1. bindingnavigator - 0.33 hr back. (2)
  2. bindingnavigator en vb.net - 1.29 hr back. (1)
  3. "bindingnavigator" "search" - 1.93 hr back. (1)
  4. vb .net get set position of binging navigator - 2.05 hr back. (1)
  5. vb.net bindingnavigator tutorial - 2.23 hr back. (1)
  6. bindingnavigator vb net - 5.25 hr back. (1)
  7. button navigation & .net 2005 & next - 5.87 hr back. (1)
  8. binding navigator vb.net endedit - 6.05 hr back. (1)
  9. add new item button code in binding navigator vb - 6.99 hr back. (1)
  10. using bindingnavigator in vb.net - 10.52 hr back. (1)
  11. bindingnavigator cannot delete item - 12.79 hr back. (1)
  12. bindingnavigatoraddnewitem - 15.47 hr back. (1)
  13. bindingnavigator vb.net tutorial - 16.32 hr back. (2)
  14. vb.net how to use bindingnavigator - 18.20 hr back. (1)
Similar Topics

Keywords : vb, net, 2005, bindingnavigator

  1. Delete A Registry Subkey And Key
    Using Visual Basic 2005 Express (8)
  2. [help] Visual Studio .net 2005 Questions
    (8)
    Heya folks, i am back again with my annoying questions /wink.gif" style="vertical-align:middle"
    emoid=";)" border="0" alt="wink.gif" /> I have this project to submit by the 7th of may and i am
    really desperate for some help here. I will put my questions in numbers so it would be easy for you
    to solve them without confusion. 1) Earlier in a post i had asked if i could create Vista
    compatible applications in VB .NET 2005. Well i got a good response and i went ahead and installed
    the needful, but i still think something is wrong. Not that i know alot of whats going on aro....
  3. New Features In Visual Studio 2005 Windows Forms
    (1)
    i dunno if all of u are by now well versed with the new exciting features in visual studio 2005
    forms, but for me this article was enlightening. for the benifit of others who wre in the dark like
    me.... New Features in Visual Studio 2005 Windows Forms QUOTE The little voice in my head
    shouted "Don't do it! Don't do it!" as I contemplated using the worn out cliché "Good things
    come to those who wait" to describe the experience of designing Windows applications with Visual
    Studio 2005. However, that cliché accurately communicates the idea that building Wi....

    1. Looking for vb, net, 2005, bindingnavigator






*SIMILAR VIDEOS*
Searching Video's for vb, net, 2005, bindingnavigator
advertisement




Vb .net 2005 Bindingnavigator Help