Skip to content

how to iterate WebDataGrid Rows

New Discussion
Gabriel
Gabriel asked on Jan 31, 2014 5:44 PM

Hi, for UltraWebGrids I used the next code to iterate the ultrawebgrid rows. 

                foreach (Infragistics.WebUI.UltraWebGrid.UltraGridRow SRC in this.WebDataGridGastosProp.Behaviors.Selection.SelectedRows)

                {

                    BE.GastosParticulares unGasto = new BE.GastosParticulares();

                    unGasto.Codigo = int.Parse(SRC.Cells[0].Text.ToString());

                    unGasto.Importe = decimal.Parse(SRC.Cells[5].Text.ToString());

                    lista.Add(unGasto);

                }

But which would be the equivalent on WebDataGrid ?

 

Thanks!

 

Regards.

Sign In to post a reply

Replies

  • 0
    [Infragistics] Petar Ivanov
    [Infragistics] Petar Ivanov answered on Oct 26, 2011 8:29 AM

    Hi gabrieler,

    In order to iterate through WebDataGrid's rows you should be able to use something like:

    
    

            foreach (GridRecord row in WebDataGrid1.Behaviors.Selection.SelectedRows.Count)
            {
                var a = row.Items[0].ToString();
                var b = row.Items.FindItemByKey("ColKey").ToString();
            }

    Please let me know if you have any questions.

    Best Regards,

    Petar Ivanov
    Developer Support Engineer
    Infragistics, Inc.
    http://pt-br.infragistics.com/support

    • 0
      [Infragistics] Petar Ivanov
      [Infragistics] Petar Ivanov answered on Oct 31, 2011 7:54 AM

      Hi gabrieler,

      Please let me know if you need further assistance with this matter.

      Best Regards,

      Petar Ivanov
      Developer Support Engineer
      Infragistics, Inc.
      http://pt-br.infragistics.com/support

    • 0
      ross
      ross answered on Dec 15, 2013 9:37 PM

      How does this work in IG 2012.2? IE…. GridRecord is not in the namespace

      Infragistics.WebUI.UltraWebGrid.UltraGridRow GridRecord

      How do you do this in version 2012.2?

      • 0
        [Infragistics] Petar Ivanov
        [Infragistics] Petar Ivanov answered on Dec 16, 2013 8:11 AM

        Hello rookertrusted,

        The GridRecord class is part of the Infragisitcs.Web.UI.GridControls Namespace in the Infragistics.Web Assembly:

        http://help.infragistics.com/Doc/ASPNET/2013.2/CLR4.0/?page=Infragistics4.Web.v13.2~Infragistics.Web.UI.GridControls.GridRecord.html

        GridRecords are used by the WebDataGrid control which is different than the UltraWebGrid. Please note that since version 11.2, the UltraWebGrid has been retired as is no longer available.

        Hope this helps. Please do not hesitate to contact me if you have any questions.

  • 0
    Uchiha  Itachi
    Uchiha Itachi answered on Jan 10, 2014 3:41 AM

    It happens that I got a parallel question on the row iterating. Fortunate to see the problem solved.

    • 0
      Michael
      Michael answered on Jan 31, 2014 5:44 PM

      Sometimes you guys make basic stuff way too difficult. You also forget about the people coding in VB

      Here is a very easy Webdatagrid iteration through all rows in VB:

      Dim iSelectedCount As Integer = 0

      For index = 0 To WebDataGrid1.Rows.Count – 1

      If WebDataGrid1.Rows.Item(index).Items(3).Value = True Then

                      iSelectedCount += 1

      End If

      Next

       

      In this case Items(3) is a boolean or bit field and I am checking to see if it is checked

  • You must be logged in to reply to this topic.
Discussion created by
Favorites
Replies
Created On
Last Post
Discussion created by
Gabriel
Favorites
0
Replies
6
Created On
Jan 31, 2014
Last Post
12 years, 1 month ago

Suggested Discussions

Created by

Created on

Jan 31, 2014 5:44 PM

Last activity on

Jan 31, 2014 5:44 PM