数据网格和图像 [英] Datagrids and images
问题描述
祝全部节日快乐!我想加载带有图像和文本的数据网格(图像,
文本,图像,文本等...)。此数据网格的数据将来自
sql server,图像存储为服务器上的文件而不是sql
服务器,但名称和路径图像与
sql server中的文本一起存储。我不知道如何将图像加载到网格中,所以
有人可以告诉我如何开始这个吗?
谢谢。
-
mo ******* @ nospam。 com
查看datagrid的asp:templatecolumn。您可以定义和项目
模板,其中可能包含< asp:image>服务器控制,src =<%#some
数据绑定表达式"%>使用你的DataSet中的图像路径
你绑定数据网格
希望有所帮助。
moondaddy <莫******* @ nospam.com>在留言中写道
news:u9 ************** @ TK2MSFTNGP10.phx.gbl ...祝全部节日快乐!我想加载一个带有图像和文本的数据网格
(图像,文本,图像,文本等...)。这个数据网格的数据将来自sql server的
,图像作为文件存储在服务器而不是sql
服务器上,但是,图像的名称和路径与文本一起存储。 b $ b在sql server中。我不知道如何将图像加载到网格中,
所以有人可以告诉我如何开始这个吗?
谢谢。
-
mo*******@nospam.com
谢谢。这听起来是一个好的开始。你知道任何关于这个问题的例子吗?
" George Durzi" < GD **** @ hotmail.com>在消息中写道
news:um ************** @ TK2MSFTNGP11.phx.gbl ...查看asp: datagrid的templatecolumn。您可以定义和项目
模板,其中可能包含< asp:image>服务器控制与src =<%#
一些数据绑定表达式%>使用你的DataSet中的图像路径来绑定数据网格
希望有所帮助。
moondaddy <莫******* @ nospam.com>在消息中写道
新闻:u9 ************** @ TK2MSFTNGP10.phx.gbl ...祝全部节日快乐!我想加载带有图像和文本的数据网格(图像,文本,图像,文本等...)。这个数据网格的数据将从sql server进入
,图像作为文件存储在服务器而不是
sql server中,但是,图像的名称和路径与sql server中的
文本一起存储。我不知道如何将图像加载到
网格中,所以有人可以告诉我如何开始这个吗? />
谢谢。
-
mo ******* @ nospam。 com
在HTML中,在datagrid元素中......
< datagrid .....>
< columns>
< asp:TemplateColumn HeaderText =" Image" >
< ItemTemplate>
< asp:Image id =" imgMyImage" runat =" server"
ImageURL ="<%#DataBinder.Eval(Container," ImageFilePath")%>">
< / ItemTemplate>
< / asp:TemplateColumn>
< / columns>
< / datagrid>
查看
http://msdn.microsoft.com/library/de...tomcolumns.asp
DataBinder.Eval允许您要在HTML中绑定到服务器控件的数据源
。我假设你知道并将DataGrid绑定到它'
数据源。
查看此链接以获取数据绑定表达式。
Carl Prothman发布了几篇帖子:
http://msdn.microsoft.com/library/en...xpressions.asp
" moondaddy" ; <莫******* @ nospam.com>在消息中写道
新闻:%2 **************** @ TK2MSFTNGP09.phx.gbl ...谢谢。这听起来是一个好的开始。你知道关于这个的任何例子或
文章吗?
" George Durzi" < GD **** @ hotmail.com>在消息中写道
新闻:嗯************** @ TK2MSFTNGP11.phx.gbl ...查看数据网格的asp:templatecolumn 。您可以定义和
item模板,其中可能包含< asp:image>服务器控制与src =<%#
一些数据绑定表达式%>使用从DataSet到
的图像路径,你绑定数据网格
希望有所帮助。
moondaddy <莫******* @ nospam.com>在消息中写道
新闻:u9 ************** @ TK2MSFTNGP10.phx.gbl ...祝全部节日快乐!我想加载带有图像和文本的数据网格
(图像,文本,图像,文本等...)。此数据网格的数据将来自sql server
,图像将作为文件存储在服务器上,而不是
sql server中的
text一起存储。我不知道如何将图像加载到
网格中,所以有人可以请建议我如何开始这个?
谢谢。
-
mo ******* @ nospam.com
Happy Holidays All! I want to load a datagrid with images and text (Image,
text, image, text, etc...). The data for this datagrid will be coming from
sql server and the images are stored as files on the server and not in sql
server, however, the name and path of the images are stored with the text in
sql server. I don''t have a clue on how to load the images into the grid, so
can someone please advise on how i can get started with this?
Thanks.
--
mo*******@nospam.com
Look into the asp:templatecolumn of the datagrid. You can define and item
template which could contain an <asp:image> server control with src=<%# some
databinding expression"%> using the image path from your DataSet to which
you''re binding the datagrid
hope that helps.
"moondaddy" <mo*******@nospam.com> wrote in message
news:u9**************@TK2MSFTNGP10.phx.gbl...Happy Holidays All! I want to load a datagrid with images and text (Image, text, image, text, etc...). The data for this datagrid will be coming from sql server and the images are stored as files on the server and not in sql
server, however, the name and path of the images are stored with the text in sql server. I don''t have a clue on how to load the images into the grid, so can someone please advise on how i can get started with this?
Thanks.
--
mo*******@nospam.com
Thanks. That sounds like a good start. do you know of any examples or
articles on this?
"George Durzi" <gd****@hotmail.com> wrote in message
news:um**************@TK2MSFTNGP11.phx.gbl...Look into the asp:templatecolumn of the datagrid. You can define and item
template which could contain an <asp:image> server control with src=<%# some databinding expression"%> using the image path from your DataSet to which
you''re binding the datagrid
hope that helps.
"moondaddy" <mo*******@nospam.com> wrote in message
news:u9**************@TK2MSFTNGP10.phx.gbl...Happy Holidays All! I want to load a datagrid with images and text (Image,text, image, text, etc...). The data for this datagrid will be coming
fromsql server and the images are stored as files on the server and not in sql server, however, the name and path of the images are stored with the
text insql server. I don''t have a clue on how to load the images into thegrid, so
can someone please advise on how i can get started with this?
Thanks.
--
mo*******@nospam.com
In your HTML, within the datagrid element ...
<datagrid ..... >
<columns>
<asp:TemplateColumn HeaderText="Image">
<ItemTemplate>
<asp:Image id="imgMyImage" runat="server"
ImageURL="<%#DataBinder.Eval(Container, "ImageFilePath")%>">
</ItemTemplate>
</asp:TemplateColumn>
</columns>
</datagrid>
Check out
http://msdn.microsoft.com/library/de...tomcolumns.asp
DataBinder.Eval allows you to bind to your server control''s datasource from
within your HTML. I''m assuming you know and have bound the DataGrid to it''s
data source.
Check out this link for data binding expressions.
Carl Prothman posted this a few posts down:
http://msdn.microsoft.com/library/en...xpressions.asp
"moondaddy" <mo*******@nospam.com> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...Thanks. That sounds like a good start. do you know of any examples or
articles on this?
"George Durzi" <gd****@hotmail.com> wrote in message
news:um**************@TK2MSFTNGP11.phx.gbl...Look into the asp:templatecolumn of the datagrid. You can define and itemtemplate which could contain an <asp:image> server control with src=<%#
somedatabinding expression"%> using the image path from your DataSet to which you''re binding the datagrid
hope that helps.
"moondaddy" <mo*******@nospam.com> wrote in message
news:u9**************@TK2MSFTNGP10.phx.gbl...Happy Holidays All! I want to load a datagrid with images and text
(Image,text, image, text, etc...). The data for this datagrid will be coming
fromsql server and the images are stored as files on the server and not in
sql server, however, the name and path of the images are stored with the
textinsql server. I don''t have a clue on how to load the images into the
grid,socan someone please advise on how i can get started with this?
Thanks.
--
mo*******@nospam.com
这篇关于数据网格和图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!