简体   繁体   English

如何在GridView中绑定这些值(将3个值作为一行)

[英]how to bind these valuesin a gridview( which has 3 values as one row)

i have a gridview whose values are binded in 我有一个网格视图,其值绑定在

Day period1 period2 period3 日期1期2期3

Monday maths nill english 星期一数学英语

in this format 以这种格式

i have binded in a gridview that shows three records as 我已经绑定在显示三个记录为

Day period1 period2 period3 日期1期2期3

Monday maths nill english 星期一数学英语

Monday maths nill english 星期一数学英语

Monday maths nill english 星期一数学英语


but how to bind these values in a gridview since monday will have 3 records / values.. 但是自星期一以来如何在gridview中绑定这些值将有3条记录/值。

how to bind the periodwise subjects and timings inside gridview. 如何在gridview中绑定定期主题和时间。 how to get these records binded oly once in a row 如何使这些记录连续一次绑定

You will either need to do: 您要么需要做:

  • A pivot operation in the database to get it in the format you need. 数据库中的数据透视操作以所需的格式获取它。
  • Code to take the three values and convert them to columns (you can programmably create a DataTable object to store the data, then loop through the records and create your flattened UI). 编码以获取三个值并将它们转换为列(您可以通过编程方式创建一个DataTable对象来存储数据,然后遍历记录并创建展平的UI)。

HTH. HTH。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何将新数据表绑定到已经具有旧数据表的gridview - How to bind a new datatable to a gridview which already has an old datatable 如何将具有一个键和多个值的列表绑定到GridView或Repeater - How to bind a list with one key and multiple values to a GridView or a Repeater 如何将 gridview 聚焦的行值一一放入网格 - how to get gridview focused row values into grid one by one 如何将GridView绑定到表具有外键 - how to bind a gridview to a table has a foreign key 如何将数据库记录ID正确绑定到GridView行(ASP GridView)? - How to properly bind a DB record ID to a GridView Row (ASP GridView)? 如何从一页传递文本框值以绑定Gridview中的另一页 - How to Pass Textbox values from one page to bind another page in Gridview 如何将2个数据库表绑定到GridView并作为下拉列表 - How to bind 2 databse tables to gridview and one as dropdown 如何在gridview行中获取值,在其中使用c#选择了单选按钮 - How to get the values in gridview row, in which the radio button is selected using c# 如何通过双击行 C# WinForm 将一行数据从一个 gridview 复制到另一个表单上 - How to copy row by row data from one gridview to other which is on other form by double click on row C# WinForm 如何将datatable绑定到gridview,每列五行 - How to bind datatable to gridview with five row per column
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM