具有3列的数据网格视图 [英] Data Grid View with 3 Columns

查看:90
本文介绍了具有3列的数据网格视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想在3列的数据网格视图中显示我的图像,每列图像都与其他图像不同 请帮帮我.
更改代码.
谢谢.

现在:
|
|
|
|

想要:
| | |
| | |
| | |

Hi
I want show my images in data grid view in 3 columns that each columns image differ than other
please help me.
change the code.
thanks.

now:
|
|
|
|

want:
| | |
| | |
| | |

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False">
                        <Columns>
                            <asp:TemplateField>
                              <ItemTemplate>
                              <img src='<%# GetImageUrl(Eval("FullName")) %>' />
                                </ItemTemplate>
                            </asp:TemplateField>
                        </Columns>
                    </asp:GridView>

推荐答案

您应该执行以下操作:
You should do something like this:
<asp:gridview id="GridView1" runat="server" autogeneratecolumns="False" xmlns:asp="#unknown">
                        <columns>
                            <asp:templatefield>
                              <itemtemplate>
                              <img src="<%# GetImageUrl(Eval("FullName1")) %>" />
                                </itemtemplate>
                            </asp:templatefield>
                        </columns>
              <columns>
                            <asp:templatefield>
                              <itemtemplate>
                              <img src="<%# GetImageUrl(Eval("FullName2")) %>" />
                                </itemtemplate>
                            </asp:templatefield>
                        </columns>
              <columns>
                            <asp:templatefield>
                              <itemtemplate>
                              <img src="<%# GetImageUrl(Eval("FullName3")) %>" />
                                </itemtemplate>
                            </asp:templatefield>
                        </columns>
                    </asp:gridview>



后面有一个包含FullName1等名称的类...



With a class behind that contains the names FullName1 etc...


这篇关于具有3列的数据网格视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆