Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi

i have a datarepeater and a moving label in my c# winform
when i update my repeater the lael stop moving

i've read and i realise that both controls uses the current GUI thread

i created another thread but still hangs the UI
my code
 private void refresh_test_Tick(object sender, EventArgs e)
        {
            Thread t =new Thread(new ThreadStart(set_datasource));
            if (fcon.State == ConnectionState.Open)
            fcon.Close();
            fcon.Open();
            dt.Clear();
            sda.Fill(dt);
            get_printed_tests();

        }
        delegate void _set_datasource();

        private void set_datasource ()
        {
            if (this.testsDataRepeater.InvokeRequired)
            {
                _set_datasource d = new _set_datasource(set_dtsrc);
                this.Invoke(d, dt);
            }
            else
            {
                testsDataRepeater.DataSource = dt;

            }
           
        }
        private void set_dtsrc()
        {
            testsDataRepeater.DataSource = dt;
        }

public void get_printed_tests()
        {
                testsDataRepeater.DataSource = dt;
            if (testsBindingSource.Position<testsbindingsource.count-1)>
                testsBindingSource.MoveNext();
            else
                testsBindingSource.MoveFirst();
            }



of course the datarepeater refreshed accoring to timer interval

another questhion--- is there a way to moke refresh not seen by user ??

thanks alot
Posted
Updated 3-Jan-14 7:15am
v2

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