?
Solved

My DataRowState.Modified always when I fill data in winform and my Combobox is filled.

Posted on 2011-09-27
3
Medium Priority
?
308 Views
Last Modified: 2012-05-12
I've a Combobox that loads date on fill. The may code is activated to do something. After that my DataRowState is always modified. Even if i didn't change the selectedrow of a combobox.

What kind of property do i need to use to get the DataRowState Modified and not when i fill the date on starting.

Hope you can help.
Private Sub ucboFromCompanyName_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ucboFromCompanyName.ValueChanged
        MaterialInwardBindingSource.Current("FromCompanyName") = ucboFromCompanyName.SelectedRow.Cells("CompanyName").Value
        MaterialInwardBindingSource.Current("FromAddress1") = ucboFromCompanyName.SelectedRow.Cells("Address1").Value
        MaterialInwardBindingSource.Current("FromAddress2") = ucboFromCompanyName.SelectedRow.Cells("Address2").Value
        MaterialInwardBindingSource.Current("FromAddress3") = ucboFromCompanyName.SelectedRow.Cells("Address3").Value
        MaterialInwardBindingSource.Current("FromPostalCode") = ucboFromCompanyName.SelectedRow.Cells("PostalCode").Value
        MaterialInwardBindingSource.Current("FromCity") = ucboFromCompanyName.SelectedRow.Cells("City").Value
        MaterialInwardBindingSource.Current("FromRegion") = ucboFromCompanyName.SelectedRow.Cells("Region").Value
        MaterialInwardBindingSource.Current("FromCountryName") = ucboFromCompanyName.SelectedRow.Cells("CountryName").Value
    End Sub

Open in new window

0
Comment
Question by:prinsbj
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 2000 total points
ID: 36712962
This is one of these things that happens behind your back when you use DataBinding.

Call the AcceptChanges method on the DataRow. It will reset the RowState to Unchanged.
0
 

Author Comment

by:prinsbj
ID: 36712967
How can I do that?
0
 

Author Comment

by:prinsbj
ID: 36712999
I've found it. Thank you!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In part one, we reviewed the prerequisites required for installing SQL Server vNext. In this part we will explore how to install Microsoft's SQL Server on Ubuntu 16.04.
Ready to get certified? Check out some courses that help you prepare for third-party exams.
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question