This is a migrated thread and some comments may be shown as answers.

detecting new data & auto-refreshing

2 Answers 191 Views
Grid
This is a migrated thread and some comments may be shown as answers.
chris_cf
Top achievements
Rank 2
chris_cf asked on 18 Oct 2011, 05:00 AM
I have a RadGrid which when I add a record, launches a thread to create a new record and other things. The new record is created with status "Generating". When the thread finishes executing, it changes the status to "Generated".

Is it possible to have RadGrid auto-refresh when the record's status changes? Or auto-refresh even when it detects a new record in the database table it is bound to?

2 Answers, 1 is accepted

Sort by
0
Jayesh Goyani
Top achievements
Rank 2
answered on 18 Oct 2011, 05:47 AM
Hello,

You can achieve this thing by using Ajaxify Timer.

...........
public void Timer1_Tick(object sender, EventArgs e)
{
   // check here your DB have any new records if yes then rebind your grid.
      RadGrid1.Rebind();
}


..............
in page_load event you can store total no of rows of table in session.
and in Timer1_Tick event again get total no of records and check it is equal not to session value then rebind your grid.


Thanks,
Jayesh Goyani
0
Shinu
Top achievements
Rank 2
answered on 18 Oct 2011, 06:13 AM
Hello Chris,

I am not sure about your scenario. When you are doing automatic data source operations RadGrid will automatically rebind after inserting a new record. In the case of manual insert you can call the Rebind method which will rebind the Grid. Hope this helps.

Thanks,
Shinu
Tags
Grid
Asked by
chris_cf
Top achievements
Rank 2
Answers by
Jayesh Goyani
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
Share this question
or