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

Problem with verification of all items in radgrid

2 Answers 65 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Diego
Top achievements
Rank 1
Diego asked on 13 Apr 2012, 02:15 AM
Hi, i have a radgrid with allowpaging.
I need to make a verification in all items in the grid before saving in the database, but the code just verify only ten itens that displayed in the first page. How can i make a solution to resolve this problem ? 

Actually, my code do this: 

      foreach (GridDataItem item in rgdRebanho.Items)
                {
                    CheckBox ckbItem = (CheckBox)((item).FindControl("ckbItem"));
                    if (ckbItem.Checked == true && ckbItem.Enabled == true)
                    {
                            RadDateInput dt_ocorrencia = (RadDateInput)((item).FindControl("dt_ocorrencia"));
                            if (dt_ocorrencia.SelectedDate == null)
                            {
                                erro = true;
                            }
   
                    }
                }



Sorry if have some words wrong, but i don´t speak english very well.


Thanks!

2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 13 Apr 2012, 10:05 AM
Hello Deigo,

When paging is enabled in the grid, a solution would be to temporarily disable paging, loop through all the items in the grid, and then enable paging back.
 C#:
rgdRebanho.AllowPaging = false;
//your code
rgdRebanho.AllowPaging = true;
rgdRebanho.Rebind();

Thanks,
Princy.
0
Diego
Top achievements
Rank 1
answered on 13 Apr 2012, 06:05 PM
Hello Princy,
 
That´s correct. 
Thanks, 
Tags
Grid
Asked by
Diego
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Diego
Top achievements
Rank 1
Share this question
or