如何将网格视图的每一行显示为单个块 [英] How to display a each row of a grid view as individual block
问题描述
如何将网格视图的每一行显示为单个产品
例如我有一个带有ID,ProductName,品牌,类别,价格和用户搜索的表格
品牌说parx,我的gridview将在表格中显示品牌为parx的所有行。
但是我想将每行显示为一个带有样式的块标签像品牌的粗体字体,差异颜色的价格等,就像我们在电子商务网站中搜索产品一样,也可以从与产品相关的数据库表中获取图像链接应该在一个块中显示
请帮忙。
How to display a each row of a grid view as individual products
For Example i have a table with ID, ProductName , brand , Category , Price and the user search the
brand say parx , my gridview will display all rows with brand as parx in table .
But i want to display each row as a block with Styling for each tag Like bold fonts for Brand ,price with diff color etc just like wen we search a product in e commerce site,also image link could be taken from db table related to the product should be showed in a block
Please help.
推荐答案
使用GridView.RowDataBound Event [ ^ ]绘制自定义格式的单元格/rows.
请参阅:
根据该行中的值更改Gridview行颜色 [ ^ ]
根据数据库值更改网格视图行颜色 [ ^ ]
根据ASP.Net中的列值格式化GridView行 [ ^ ]
更多:教程11:基于数据的自定义格式 [ ^ ]
Use GridView.RowDataBound Event[^] to draw custom format of cells/rows.
Please, see:
Changing Gridview row color based on value in that row[^]
Changing grid view row color based on database value[^]
Conditionally Formatting GridView Row based on a Column value in ASP.Net[^]
More: Tutorial 11: Custom Formatting Based Upon Data[^]
这篇关于如何将网格视图的每一行显示为单个块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!