如何在gridview中显示图像列和行 [英] how to display image column and row wise in gridview

查看:63
本文介绍了如何在gridview中显示图像列和行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在数据库中有一个gridview和一个图像列我想在这个gridview中显示这些图像。

i想要按列显示图像,意味着第一列中的第一个图像,第二列中的第一个图像列

和第三列是第三列,第二行和第二行中的四个图像只显示三个图像。

再次在下一行显示三个图像等等... on。

i希望在asp.net(C#)中执行此操作。怎么可能这样做。



请帮忙。



提前感谢。

I have a gridview and a image column in database i want to display that images in this gridview.
i want to display images in column wise, means first image in first column and second is in second column
and third is third column, and four image in second row and in second row display only three image.
again in next row display three image and so...on.
i want to do this in asp.net(C#). how is that possible to do this.

please help.

thanks in advance.

推荐答案

您需要了解 GridView 的工作原理。当你说三列时,你必须在 GridView 中定义这些列。



所以,重要的是在获取数据时,您必须在所需的结构中组织 DataTable 或任何其他 DataSource 。在查询中连续组织3个图像并将其绑定到网格,它最终会反映出来。



但是,在所有这些之前,只要问问自己,为什么需要这个?如果您正在尝试构建滑块或图像幻灯片放映,那么还有许多其他控件。您也可以使用许多 jQuery Sliders 。我已经写了一个 Blog



Check - 带有jQuery Slider的ASP.NET转发器 [ ^ ]。
You need to understand how GridView works. When you say three columns, then you have to define these Columns in GridView.

So, important thing is while getting the data, you have to organize in a DataTable or any other DataSource in the structure you need. Organize 3 images in a row in the query and bind that to the Grid, it will eventually reflect.

But, before all these, just ask yourself, why you need this? If you are trying to build a Slider or image Slide Show, then there are many other controls for that. You can also use many jQuery Sliders for that. I have written one Blog on that.

Check - ASP.NET Repeater with jQuery Slider[^].


这篇关于如何在gridview中显示图像列和行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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