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. how to bind images horizontally in datagrid

how to bind images horizontally in datagrid

Scheduled Pinned Locked Moved WPF
databasesql-serverwpfwcfsysadmin
10 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.
  • J Offline
    J Offline
    Jagz W
    wrote on last edited by
    #1

    i want to bind images horizontally using datagrid i don't want to use listbox because i m binding images directly from sql server table on rowbinding event datagrid.

    One person's data is another person's program. --J.Walia

    A 1 Reply Last reply
    0
    • J Jagz W

      i want to bind images horizontally using datagrid i don't want to use listbox because i m binding images directly from sql server table on rowbinding event datagrid.

      One person's data is another person's program. --J.Walia

      A Offline
      A Offline
      Abhinav S
      wrote on last edited by
      #2

      A list box can be used with an ItemsPanelTemplate tag and a StackPanel to achieve this[^]. If your binding is done correctly, I dont think you should need the rowbinding event of the datagrid. Use an ObservableCollection to bind to the list box.

      There are only 10 types of people in this world — those who understand binary, and those who don't.

      J 1 Reply Last reply
      0
      • A Abhinav S

        A list box can be used with an ItemsPanelTemplate tag and a StackPanel to achieve this[^]. If your binding is done correctly, I dont think you should need the rowbinding event of the datagrid. Use an ObservableCollection to bind to the list box.

        There are only 10 types of people in this world — those who understand binary, and those who don't.

        J Offline
        J Offline
        Jagz W
        wrote on last edited by
        #3

        Hi abhinav thanks for reply Actually i m binding images directly from datagrid. for this purpose i am generic handler. i bind the images to image control on rowbinding event of datagrid. In listbox i dint find rowbinding event. http://dotnetcurry.com/ShowArticle.aspx?ID=264

        One person's data is another person's program. --J.Walia

        M 1 Reply Last reply
        0
        • J Jagz W

          Hi abhinav thanks for reply Actually i m binding images directly from datagrid. for this purpose i am generic handler. i bind the images to image control on rowbinding event of datagrid. In listbox i dint find rowbinding event. http://dotnetcurry.com/ShowArticle.aspx?ID=264

          One person's data is another person's program. --J.Walia

          M Offline
          M Offline
          Mark Salsbery
          wrote on last edited by
          #4

          J walia wrote:

          Actually i m binding images directly from datagrid. for this purpose i am generic handler. i bind the images to image control on rowbinding event of datagrid.

          So the bindings work but you need to arrange Image elements horizontally? What are you trying to do once the Image elements have their bindings?

          Mark Salsbery Microsoft MVP - Visual C++ :java:

          J 1 Reply Last reply
          0
          • M Mark Salsbery

            J walia wrote:

            Actually i m binding images directly from datagrid. for this purpose i am generic handler. i bind the images to image control on rowbinding event of datagrid.

            So the bindings work but you need to arrange Image elements horizontally? What are you trying to do once the Image elements have their bindings?

            Mark Salsbery Microsoft MVP - Visual C++ :java:

            J Offline
            J Offline
            Jagz W
            wrote on last edited by
            #5

            i want arrange image controls horizontally

            One person's data is another person's program. --J.Walia

            M 1 Reply Last reply
            0
            • J Jagz W

              i want arrange image controls horizontally

              One person's data is another person's program. --J.Walia

              M Offline
              M Offline
              Mark Salsbery
              wrote on last edited by
              #6

              J walia wrote:

              i want arrange image controls horizontally

              Grid, StackPanel, Canvas are some elements that can have child elements arranged horizontally.

              <StackPanel Orientation="Horizontal" >
              <Image .../>
              <Image .../>
              <Image .../>
              </StackPanel>

              For data coming from a collection, you could use an ItemsControl or derived. Do you have an example or some details of what you want, or something you tried that didn't work?

              Mark Salsbery Microsoft MVP - Visual C++ :java:

              J 1 Reply Last reply
              0
              • M Mark Salsbery

                J walia wrote:

                i want arrange image controls horizontally

                Grid, StackPanel, Canvas are some elements that can have child elements arranged horizontally.

                <StackPanel Orientation="Horizontal" >
                <Image .../>
                <Image .../>
                <Image .../>
                </StackPanel>

                For data coming from a collection, you could use an ItemsControl or derived. Do you have an example or some details of what you want, or something you tried that didn't work?

                Mark Salsbery Microsoft MVP - Visual C++ :java:

                J Offline
                J Offline
                Jagz W
                wrote on last edited by
                #7

                but these controls does't have row binding event

                One person's data is another person's program. --J.Walia

                M 1 Reply Last reply
                0
                • J Jagz W

                  but these controls does't have row binding event

                  One person's data is another person's program. --J.Walia

                  M Offline
                  M Offline
                  Mark Salsbery
                  wrote on last edited by
                  #8

                  J walia wrote:

                  these controls does't have row binding event

                  What is a row binding event (what event are you referring to) and why do you think you need it?

                  Mark Salsbery Microsoft MVP - Visual C++ :java:

                  J 1 Reply Last reply
                  0
                  • M Mark Salsbery

                    J walia wrote:

                    these controls does't have row binding event

                    What is a row binding event (what event are you referring to) and why do you think you need it?

                    Mark Salsbery Microsoft MVP - Visual C++ :java:

                    J Offline
                    J Offline
                    Jagz W
                    wrote on last edited by
                    #9

                    Hello Mark Please check this link http://dotnetcurry.com/ShowArticle.aspx?ID=264 I have used same logic. please help now i need this badly.

                    One person's data is another person's program. --J.Walia

                    M 1 Reply Last reply
                    0
                    • J Jagz W

                      Hello Mark Please check this link http://dotnetcurry.com/ShowArticle.aspx?ID=264 I have used same logic. please help now i need this badly.

                      One person's data is another person's program. --J.Walia

                      M Offline
                      M Offline
                      Mark Salsbery
                      wrote on last edited by
                      #10

                      J walia wrote:

                      I have used same logic.

                      Thanks. So you are using the LoadingRow event....so what are you trying to do in your LoadingRow event handler? Do you have multiple images per row instead of one like the sample?

                      Mark Salsbery Microsoft MVP - Visual C++ :java:

                      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