I have a aspxImage but I can't give to datasource. I need to bind my "image1". You can take it from gridview or sqldatasource doesn't matter. How can I bind my image1 to aspxImage?
Here's my aspximage,gridview and my sqldatasource
<dx:ASPxPopupControl ID="popup" runat="server"
ClientInstanceName="popup"
Modal="true" HeaderText="Büyütülmüş CRQS Fotoğrafları" PopupHorizontalAlign="WindowCenter" PopupVerticalAlign="Middle">
<ContentCollection>
<dx:PopupControlContentControl>
<dx:ASPxImage ID="img" runat="server" ImageUrl='<%# Eval("image1")%>'></dx:ASPxImage>
</dx:PopupControlContentControl>
</ContentCollection>
</dx:ASPxPopupControl>
<dx:ASPxGridView ID="PhotoGrid" DataSourceID="PhotoDataSource" KeyFieldName="id" Width="100%" runat="server" Visible="false" >
<ClientSideEvents RowClick="onRowClick" />
<Columns>
<dx:GridViewDataTextColumn FieldName="id" Visible="False">
</dx:GridViewDataTextColumn>
<dx:GridViewCommandColumn ShowEditButton="true" />
<dx:GridViewDataBinaryImageColumn FieldName="image1" Caption="Resim 1">
<PropertiesBinaryImage ImageHeight="170px" ImageWidth="160px" >
<EditingSettings Enabled="true" />
</PropertiesBinaryImage>
</dx:GridViewDataBinaryImageColumn>
<dx:GridViewDataBinaryImageColumn FieldName="image2" Caption="Resim 2">
<PropertiesBinaryImage ImageHeight="170px" ImageWidth="160px">
<EditingSettings Enabled="true" />
</PropertiesBinaryImage>
</dx:GridViewDataBinaryImageColumn>
</Columns>
</dx:ASPxGridView>
<asp:SqlDataSource runat="server" ID="PhotoDataSource"
UpdateCommand="UPDATE CRQSGroupsT SET image1 = @image1, image2 = @image2 WHERE id = @id"
SelectCommand="Select id,image1,image2 from CRQSGroupsT where id=@id"
ConnectionString="<%$ ConnectionStrings:default %>">
<UpdateParameters>
<asp:Parameter Name="image1" DbType="Binary" />
<asp:Parameter Name="image2" DbType="Binary" />
<asp:Parameter Name="id" />
</UpdateParameters>
<SelectParameters>
<asp:Parameter Name="id" />
</SelectParameters>
</asp:SqlDataSource>
First change the aspximage to aspxbinaryimage and put it in a callback-panel:
Then add a button (or link) to the gridview to send the
id(orkeyvalue) to the callback routine and get the image data from database:or
In callback, retrieve the image-data from database and set it to the
valueof image in popup control: