Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
295
infragestic Grid "Groupby" functionality problem
posted

I have infragesticgrid with (id,area,Eqname etc). I used infragestic grupuby functionlity on grid( eq-groupby Eqname). No I m exporting data from infragestic grid, as following-

for (int i = 0; i < grdCtrl.Grid.Rows.Count; i++)
                        {

  areaId = ProcessNull.GetInteger(dtObject.Select(primaryKey + "='" + grdCtrl.Grid.Rows[i].Cells[Eqname].Value.ToString() + "'")[0]["AreaID"].ToString());

   grdCtrl.Grid.Rows[i].Cells["AreaPath"].Value

}  grdCtrl.Grid.Ido_ExportToExcel();

But I got error -  grdCtrl.Grid.Rows[i].Cells is Null.

If i add condition -

if (Grid.Rows[i].IsGroupByRow)

{  areaId = ProcessNull.GetInteger(dtObject.Select(primaryKey + "='" + grdCtrl.Grid.Rows[i].Cells[Eqname].Value.ToString() + "'")[0]["AreaID"].ToString());}

It never go inside conditon . How to resolve null problem i want to set areaid atleast for child rows.

Any idea?

thanks in advance

 

Parents
  • 469350
    Offline posted

    If you group the grid using using OutlookGroupBy, then the grid rows at the root level will be UltraGridGroupByRows and the data rows with the cells are under those rows.

    So if you want to loop through the data rows and ignore the GroupByRows, the easiest way to do that is like this:

                 foreach (UltraGridRow row in this.ultraGrid1.Rows.GetAllNonGroupByRows())
                {
                }

Reply Children