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