在GridView中动态添加的列

在GridView中动态添加的列

本文介绍了在GridView中动态添加的列的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好朋友
我正在gridview中动态添加列,这工作得很好.
但我也想在不动态的网格视图中添加列之前添加复选框.
任何人都可以帮助我如何在gridview中添加复选框作为第一列,然后将动态添加所有列.
感谢

Hello friends
I m adding columns in gridview dynamically which is working perfectly fine.
but i also want to add checkbox before adding columns in grid view which is not dynamic.
can anyone help me how to add checkbox in gridview as first column and then all columns will be addded dynamically.
Thanks

推荐答案



Dim gridCheck As New DataGridViewCheckBoxColumn

        With gridCheck
            .HeaderText = ""
            .Name = "gridCheck"
            .Width = 30
            .HeaderCell.Style.Alignment = DataGridViewContentAlignment.MiddleCenter
        End With

dgvWhatEver.Columns.Insert(0, gridCheck)


这篇关于在GridView中动态添加的列的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-23 03:01