不同种类的细胞在同一列 [英] different kinds of cells in the same column

查看:130
本文介绍了不同种类的细胞在同一列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要在同一列中渲染具有不同类型单元格的数据网格。例如,我有一个datagrid的列name和一列值。根据我的记录的类型,我将在值列中有不同的单元格,如组合框或简单的文本框。我并没有真正看到如何以编程方式执行...我不知道datagrid是否是最佳选择。任何提示?

I need to render a datagrid with different kinds of cells in the same column. For example, I have a datagrid with a column "name" and a column "value". Depending on the "type" of my record, I would have different cells in the column "value" like a combobox or a simple textfield. and I don't really see how to do that programmatically... I don't know if the datagrid is the best choice. Any hint?

我正在框架3.5中使用asp.net/vb.net

I'm using asp.net/vb.net with framework 3.5

推荐答案

您可以使用用户控件进行此操作,将类型传递给用户控件,用户控件将处理要显示或生成的控件类型。

You can do that using the user control, where you pass the "type" to the user control and the user control will handle the type of control to show or generate.

这篇关于不同种类的细胞在同一列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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