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

Empty grid on button click

2 Answers 99 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Allen
Top achievements
Rank 1
Allen asked on 22 Jan 2013, 12:53 PM
Hi
     I want to empty my grid on a button click. How shall I have it done?? Please share something helpful
thanks
Allen

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 22 Jan 2013, 12:59 PM
Hi,


Try the following code to achieve your scenario.
C#:
protected void Button2_Click(object sender, EventArgs e)
   {
       RadGrid1.DataSource = new int[] { };
       RadGrid1.Rebind();
   }

Thanks,
Princy
0
Jayesh Goyani
Top achievements
Rank 2
answered on 23 Jan 2013, 04:07 AM
Hello,

protected void Button2_Click(object sender, EventArgs e)
   {
       RadGrid1.DataSource = new int[] { };
       RadGrid1.DataBind();
 //OR
RadGrid1.Rebind();
 
   }


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Allen
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Jayesh Goyani
Top achievements
Rank 2
Share this question
or