在asp.net中向datagrid添加控件 [英] adding controls to datagrid in asp.net

查看:109
本文介绍了在asp.net中向datagrid添加控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在asp.net中将文本框控件和下拉列表(或组合框)添加到datagrid?

它应该在设计过程中添加,而不是动态添加..

我正在使用asp.net,C#,Visual Studio 2005 ...

有人可以帮我吗...

问候
karan

how can i add textbox control and dropdownlist(or combo box) to datagrid in asp.net?

it should be added during design not dynamically..

i am using asp.net, C#, visual studio 2005...

Can anybody help me please...

regards
karan

推荐答案

您只需要在设计时将控件放在网格的ItemTemplate中即可.

在开始编写代码之前,您需要阅读有关datagrid的信息:
看看他们:
DataGrid类 [ ^ ]
有关DataGrid Web服务器控件的热门问题 [ GridView快速入门 [
You just need to put the controls in the ItemTemplate of the grid during design time.

You need to read about datagrid''s before starting to code:
Have a look at them:
DataGrid Class[^]
Top Questions about the DataGrid Web Server Control[^]
GridView Quickstart[^]


< asp:DataGrid> ;
<专栏>
< asp:TemplateColumn>
< ItemTemplate>
----这里您可以使用任何ASP控件----
</ItemTemplate>
</asp:TemplateColumn>
</列>
</asp:DataGrid>

这可能有助于您
<asp:DataGrid>
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
----Here u can use any ASP controls----
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
</asp:DataGrid>

This may help u


尝试此链接

如何创建模板列&在网格视图中动态控制 [ ^ ]
try this Link

How to create template columns & Controls dynamically in a grid view[^]


这篇关于在asp.net中向datagrid添加控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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