Results 1 to 5 of 5

Thread: [RESOLVED] [02/03] Controls Data Binding

  1. #1

    Thread Starter
    Lively Member deien's Avatar
    Join Date
    Sep 2007
    Posts
    81

    Resolved [RESOLVED] [02/03] Controls Data Binding

    I'm using VS 2003, and my problem detail is, I bind data to a set of controls e.g. Text Box, Combo Box...
    But I don't want the first record to appear on the controls upon opening of the form, and I want to initialize my controls with blank/null values instead.

    is there any possible way to do it than setting the "text" property of each and every control one by one?

    Please help me.. Thank you so much.

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [02/03] Controls Data Binding

    It's not possible, to the best of my knowledge. The CurrencyManager's Position property controls which list item is selected in the bound controls and it only accepts values from 0 to (Count-1), which means a valid item index must be selected.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  3. #3

    Thread Starter
    Lively Member deien's Avatar
    Join Date
    Sep 2007
    Posts
    81

    Re: [02/03] Controls Data Binding

    But still, can I use the setting of values as blank/null to the controls one by one?

  4. #4
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: [02/03] Controls Data Binding

    No. Once your controls are bound it's not possible. You could set the SelectedIndex of a ComboBox to -1 but any changes you made to a TextBox would still affect the last bound record.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  5. #5

    Thread Starter
    Lively Member deien's Avatar
    Join Date
    Sep 2007
    Posts
    81

    Re: [02/03] Controls Data Binding

    Is that so.. Ok then, maybe i'll just let it that way.. thank you so much.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width