How to refresh Datagridview content after perticular duration
I am creating a windows application,( i am very new to windows applications in .net ) in which I am displaying online users in the DataGridView control. I want to refresh the grid content after 3 seconds. plz tel me hw can i do that?

Vimal KandasamyRank #2,151 · 661 reputationPosted May 6, 2009, 2:46 AM EDT
Simply add a timer control in your windows application.
then set its properties Enabled=True and Interval=3000 and in timer1_Tick() event, add your code to update data grid view content.
try this, it may help you.
Tejaswini Prashant J78 reputationPosted May 6, 2009, 4:13 AM EDT
Thanks for quick answer. I tried it..it's calling the timer_tick event after the given duration..but it's nt refreshing the data :(
here is my code...
private void FillUsers()
{
LinqChatDataContext _dataContext =new LinqChatDataContext();
var _users = from _u in _dataContext.LoggedInUsers
select _u;
bindingUser.DataSource= _users;
grid_users.DataSource= bindingUser;
//grid_users.Refresh();
}
private void timer_refresh_Tick(object sender, EventArgs e)
{
FillUsers();
}
Vimal KandasamyRank #2,151 · 661 reputationPosted May 6, 2009, 8:54 PM EDT
and before call fillusers() method.simply clear the contents of datagridview.then call that function.it will add updated data.Make sure your data updated within 3 seconds.
Tejaswini Prashant J78 reputationPosted May 6, 2009, 11:20 PM EDT