Hello,
Q1 2010 VS2008 SL3
I have a GridView that contains an image in the first column, when I drag the row I don't want it to display the PrimaryKey of the row I'm dragging but I want it to show the image that is displayed in the first column.
The problem is that the image is stored in Bytes[] in the database so I cant give the field as a Source to the image control and put it in the DragCue...
I tried something like this in OnContactDragInfo :
if (e.Options.Status == DragStatus.DragInProgress)
{
ContentControl cue = new ContentControl();
cue.ContentTemplate = ((Party)(gvContacts.SelectedItem)).Photo as DataTemplate;
cue.Content = gvContacts.SelectedItem;
e.Options.DragCue = cue;
}
But VS is giving this error "Cannot convert type 'byte[]' to 'System.Windows.DataTemplate' " on ((Party)(gvContacts.SelectedItem)).Photo as DataTemplate
NB: The image is displaying fine in the grid view... so can I just take the first item from the GridView whatever it is and give it to the DragCue?
Thanks for your help,
Anthony
Q1 2010 VS2008 SL3
I have a GridView that contains an image in the first column, when I drag the row I don't want it to display the PrimaryKey of the row I'm dragging but I want it to show the image that is displayed in the first column.
The problem is that the image is stored in Bytes[] in the database so I cant give the field as a Source to the image control and put it in the DragCue...
I tried something like this in OnContactDragInfo :
if (e.Options.Status == DragStatus.DragInProgress)
{
ContentControl cue = new ContentControl();
cue.ContentTemplate = ((Party)(gvContacts.SelectedItem)).Photo as DataTemplate;
cue.Content = gvContacts.SelectedItem;
e.Options.DragCue = cue;
}
But VS is giving this error "Cannot convert type 'byte[]' to 'System.Windows.DataTemplate' " on ((Party)(gvContacts.SelectedItem)).Photo as DataTemplate
NB: The image is displaying fine in the grid view... so can I just take the first item from the GridView whatever it is and give it to the DragCue?
Thanks for your help,
Anthony