将控件添加到网格视图的最后一列 [英] adding control to the end column of grid view

查看:119
本文介绍了将控件添加到网格视图的最后一列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好
我需要在网格视图的最后一列中添加一个单选按钮,任何人都可以帮忙.

在此先感谢

hi all
I need to add a radio button to the end column of grid view can any one help me please.

Thanks in advance

推荐答案

检查RowCreated事件中的页脚行是否为Gridview并在指定的单元格中添加控件.

Check for the footer row on RowCreated Event for Gridview and add control in specified cell.

protected void grvRoles_RowCreated(object sender, GridViewRowEventArgs e)  
{  
        if (e.Row.RowType == DataControlRowType.Footer)  
    {  
        RadioButton radiobutton = new RadioButton();  
        e.Row.Cells[0].Controls.Add(textBox);  
    }  
} 



如果有帮助,请 投票 接受答案 .



Please vote and Accept Answer if it Helped.


这篇关于将控件添加到网格视图的最后一列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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