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. Binding images to datagrid from database using silverlight

Binding images to datagrid from database using silverlight

Scheduled Pinned Locked Moved WPF
databasewpfhelpcsswcf
4 Posts 2 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.
  • P Offline
    P Offline
    pavanip
    wrote on last edited by
    #1

    Hi, I am developing one application in that I stored images from xaml page using generic handler and i am retrieving image from database using generic handler.I have written the database code to retrieve image in generic handler and i am calling that handler page in xaml page.Retrieving the image is working for me now.But my problem is how to retrieving images from DB and bind it to Datagrid in silverlight.And how to call data grid function and where to call that function.I referred the following link to bind images to datagrid but its not working for me and i am not getting how they are calling datagrid function. http://www.dotnetcurry.com/ShowArticle.aspx?ID=264&AspxAutoDetectCookieSupport=1 Please can anybody help me solve this problem. Thanks in advance Pavani

    M 1 Reply Last reply
    0
    • P pavanip

      Hi, I am developing one application in that I stored images from xaml page using generic handler and i am retrieving image from database using generic handler.I have written the database code to retrieve image in generic handler and i am calling that handler page in xaml page.Retrieving the image is working for me now.But my problem is how to retrieving images from DB and bind it to Datagrid in silverlight.And how to call data grid function and where to call that function.I referred the following link to bind images to datagrid but its not working for me and i am not getting how they are calling datagrid function. http://www.dotnetcurry.com/ShowArticle.aspx?ID=264&AspxAutoDetectCookieSupport=1 Please can anybody help me solve this problem. Thanks in advance Pavani

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

      pavanip wrote:

      i am not getting how they are calling datagrid function

      Calling what datagrid function? There is an event handler added to the datagrid, and the only access from code to the datagrid is to the datagrid's Columns property.

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

      P 1 Reply Last reply
      0
      • M Mark Salsbery

        pavanip wrote:

        i am not getting how they are calling datagrid function

        Calling what datagrid function? There is an event handler added to the datagrid, and the only access from code to the datagrid is to the datagrid's Columns property.

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

        P Offline
        P Offline
        pavanip
        wrote on last edited by
        #3

        In datagrid I used the following attribute to call that function LoadingRow="dGrid_LoadingRow" But i am not getting when it will be fired and the code executes.I have written the following code in that event private void dGrid_LoadingRow(object sender, DataGridRowEventArgs e) { FrameworkElement ele = dGrid.Columns[4].GetCellContent(e.Row); string url = "http://localhost:52614/Display.ashx"; Uri imageUri = new Uri(url, UriKind.RelativeOrAbsolute); (ele as Image).Source = new BitmapImage(imageUri); } But its not executing when i debug it line by line. Or can you please tell me tell me how to bind images to datagrid in silverlight.

        M 1 Reply Last reply
        0
        • P pavanip

          In datagrid I used the following attribute to call that function LoadingRow="dGrid_LoadingRow" But i am not getting when it will be fired and the code executes.I have written the following code in that event private void dGrid_LoadingRow(object sender, DataGridRowEventArgs e) { FrameworkElement ele = dGrid.Columns[4].GetCellContent(e.Row); string url = "http://localhost:52614/Display.ashx"; Uri imageUri = new Uri(url, UriKind.RelativeOrAbsolute); (ele as Image).Source = new BitmapImage(imageUri); } But its not executing when i debug it line by line. Or can you please tell me tell me how to bind images to datagrid in silverlight.

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

          pavanip wrote:

          But its not executing when i debug it line by line.

          Line by line? Put a breakpoint in there instead and see if it gets hit. If it doesn't then you've either not provided any row data to the control or you've done something wrong adding the event handler to the control. The handler should get hit for every row the control creates.

          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