gridview行生成 [英] gridview row generation

查看:112
本文介绍了gridview行生成的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有两个下拉菜单.都包含1-2006到53-2008(周和年)值.

如果我将下拉菜单1-2006(Dropdown1)选择为5-2008(Dropdown2),则我的gridview列应生成1-2006,2-2006直到53-2008(包括leap周).

怎么样..?

问候,
Ganesh.S

解决方案

如果您要从数据库中提取反映您选择的数据,则进行数据绑定,然后在绑定数据时在gridview中自动生成列即可.
如果您手动执行所有操作,则需要关闭自动列生成功能,并且在后面的代码中,需要根据选择手动创建列.我的建议是使用一个自定义实现对GridView进行子类化,该实现将为您完成所有这些工作,因此您只需要在开始和结束的一周内为它播种,然后网格便可以从那里开始对其进行处理. />

Hi,

I have the two drop down. both contain 1-2006 to 53-2008 (Week and Year) values.

If i select my dropdown 1-2006 (Dropdown1) to 5-2008 (Dropdown2) then my gridview column should generate 1-2006,2-2006 till 53-2008 (inluding leap week''s).

How..?

Regards,
Ganesh.S

解决方案

If you are pulling data from the database that reflects your selections, then databinding then your auto column generation in the gridview can do that when you bind data.
If you are doing everything manually, then you will need to turn off auto column generation and in your code behind you will need to create the columns manually based on the selections. My suggestion would be to subclass the GridView with a custom implementation that does all this for you so that you just have to seed it with a start and end week and the grid will process it on its own from there.


这篇关于gridview行生成的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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