创建动态表格视图以绑定来自多个表的数据 [英] Create Dynamic gridview to bind the data from multiple tables
问题描述
朋友....
我必须绑定我的Gridview才能以天为单位显示时间表,因此我的小时基准必须在列中显示我的日名,而HourNames列为我的Gridview的垂直列.在这个我的小时名称为(1stHour,2ndHour,.....)
现在,我想基于DayName和Hour Name在该gridview中绑定ClassNames.
我不知道如何动态显示.
任何人都可以帮助我...
Hi friends....
i Have to Bind My Gridview to display the timetable in day,Hours Basis for that i have to display my day Names in a column, and HourNames column as vertical column to my gridview. In this i have hourNames as(1stHour,2ndHour,.....)
Now I want to bind the ClassNames In that gridview Based on DayName and Hour Name...
I dont know how to display dynamically.
Anyone pls help me...
推荐答案
这可以通过SQL JOIN
语句完成.如果需要在客户端上执行操作,可以使用LINQ join
operator:
This could be done withSQL JOIN
statement. If you need to do in on the client you could useLINQ join
operator:
// Join on the time properties.
var query = from c in timeFrameCollection
join o in valueaCollection on c.Time equals o.Time
select new { c.Time, o.Value};
有关更多信息和示例,请遵循以下链接 [
For more information and samples please follow this link[^].
The collections could be anything implementing IEnumerable
. It could also be a DB DataSets
.
这篇关于创建动态表格视图以绑定来自多个表的数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!