Click here to Skip to main content
15,891,633 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
public class Employee
{
        System.Windows.Forms.BindingSource Source;
        public Employee()
        {            
            Source = new System.Windows.Forms.BindingSource();
            ReLoadEmployee(true);
        }
        
        private void ReLoadSource(bool Refreash = false)
        {
            if (Refreash)
            {
                Source.DataSource = 
                            Bll.Controller.EmployeesControl.SelectAllEmployee();
            }
            else
            {
                Source.ResetBindings(true);

                DataGridView.DataSource = Source;                
            }
        }
}

when insert new row in database and call ReloadSource Method i do not see any change in datasource if execute {else statment}
how i can get change in database without reload all record again??
Posted
Comments
tumbledDown2earth 3-May-13 3:31am    
You can add a Version tag or check by the last updated datetimeutc value.
GregWyatt 3-May-13 13:25pm    
I am unfamiliar with the particular method you are using, but I have to call DataBind() after setting the source or else nothing will happen. (ie DataGridView.DataBind();) Also, if your gridview is in an update panel you have to also call the update mehtod on the panel to get it to change its content if a trigger outside of the panel is causing the postback and the panel's update mode is set to conditional.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900