Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. Iterate DataGrid in Silverlight web application.

Iterate DataGrid in Silverlight web application.

Scheduled Pinned Locked Moved WPF
tutorialquestion
5 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sunil G 3
    wrote on last edited by
    #1

    Hi All, I want to iterate all the rows of the DataGrid in my SilverLight web application.. Can anyone tell me how to iterate? I have googled, but no luck.... Thanks, Sunil G.

    P M 2 Replies Last reply
    0
    • S Sunil G 3

      Hi All, I want to iterate all the rows of the DataGrid in my SilverLight web application.. Can anyone tell me how to iterate? I have googled, but no luck.... Thanks, Sunil G.

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      The usual way is not to work against the rows, but rather to work against the underlying data. With Silverlight and WPF it pays to stop thinking in the old ways of doing things, and embrace the rich databinding support along with a pattern such as MVVM.

      I'm not a stalker, I just know things. Oh by the way, you're out of milk.

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Onyx

      M 1 Reply Last reply
      0
      • P Pete OHanlon

        The usual way is not to work against the rows, but rather to work against the underlying data. With Silverlight and WPF it pays to stop thinking in the old ways of doing things, and embrace the rich databinding support along with a pattern such as MVVM.

        I'm not a stalker, I just know things. Oh by the way, you're out of milk.

        Forgive your enemies - it messes with their heads

        My blog | My articles | MoXAML PowerToys | Onyx

        M Offline
        M Offline
        Mycroft Holmes
        wrote on last edited by
        #3

        I found an exception to that particular rule. There does not seem to be a reasonable way to bind the SelectedItems of the gridview, I'm iterating them in the code behind and stuffing a list<> in the viewmodel.

        Never underestimate the power of human stupidity RAH

        P 1 Reply Last reply
        0
        • S Sunil G 3

          Hi All, I want to iterate all the rows of the DataGrid in my SilverLight web application.. Can anyone tell me how to iterate? I have googled, but no luck.... Thanks, Sunil G.

          M Offline
          M Offline
          Mycroft Holmes
          wrote on last edited by
          #4

          Sunil G 3 wrote:

          I have googled, but no luck....

          Thats b/c is is WRONG, as Pete suggested use the underlying data collection

          Never underestimate the power of human stupidity RAH

          1 Reply Last reply
          0
          • M Mycroft Holmes

            I found an exception to that particular rule. There does not seem to be a reasonable way to bind the SelectedItems of the gridview, I'm iterating them in the code behind and stuffing a list<> in the viewmodel.

            Never underestimate the power of human stupidity RAH

            P Offline
            P Offline
            Pete OHanlon
            wrote on last edited by
            #5

            You could do it by having an

            IsSelected

            property and update that if it's selected.

            I'm not a stalker, I just know things. Oh by the way, you're out of milk.

            Forgive your enemies - it messes with their heads

            My blog | My articles | MoXAML PowerToys | Onyx

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups