Hi,
I have a table with a varbinary column to store a photo. User will be able to select an image and i will need to handle the insertion manually. I need to convert the image into linq binary type.
Here is my xaml code for that column.
<xcdg:Column.CellEditor>
<xcdg:CellEditor>
<xcdg:CellEditor.EditTemplate>
<DataTemplate>
<StackPanel Orientation="Vertical">
<TextBox x:Name="photoSource" />
<Button x:Name="browseButton"
Width="50"
Content="Browse..."
Click="browseButton_Click" />
</StackPanel>
</DataTemplate>
</xcdg:CellEditor.EditTemplate>
</xcdg:CellEditor>
</xcdg:Column.CellEditor>
I am using OpenFileDialog to select the image file.
I have some problem :
- I would like to display the selected file to textbox "photoSource", how can access this textbox ?
- On CommittingNewItem event handle what the type e.CollectionView.SourceCollection. I cant
get the right type therefore i can update the propperty photo of my table.
- is there any better way to accompolish my task. Basicly i just want user to be able to upload image.
Tq.
Regards,
Amdys