[SOLVED] CheckBox in DGV Column Header

Answered Closed
0
0

Hi,

Is it possible to put a checkbox in a DGV column header ? This is a nice-to-have feature to select/unselect all rows.

Thanks.

 

  • You must to post comments
Best Answer
0
0

It is possible, but not yet 🙂

The DGV cells in Wisej have the Control property which is meant to be used to include a control in the cell, any cell. The top left cell is DGV.TopLeftHeaderCell, so you can assign a control to the call, the control can be created dynamically and all the events are wired back normally.

However the property is not wired on the client side yet and I’m not sure it will be by the first release.

Best,

Luca

  • You must to post comments
0
0

Hi Luca,

Got you. And I understand that your target first release date is fast approaching. What I asked maybe just considered as an enhancement and can be done after the first release if you are running out of time.

Just please include that in your TDL.

Thanks.

  • Huỳnh Tấn Phát
    Code here: Public Class vsDataGridViewCheckBoxColumn Inherits Wisej.Web.DataGridViewCheckBoxColumn #Region “Properties” Private _IsHeaderCheckBox As Boolean Public Property IsHeaderCheckBox() As Boolean Get Return Me._IsHeaderCheckBox End Get Set(value As Boolean) Me._IsHeaderCheckBox = value Me.checkBox1.Visible = value Try Me.DataGridView.Update() Catch ex As Exception End Try End Set End Property #End Region #Region “Variables” Private checkBox1 As New vsCheckBox() #End Region #Region “Design” Sub New() Me.checkBox1 = New vsCheckBox() Me.checkBox1.Visible = False Me.checkBox1.Text = “” AddHandler Me.checkBox1.CheckedChanged, AddressOf Me.checkBox1_CheckedChanged Me.HeaderCell.Control = Me.checkBox1 End Sub Private Sub checkBox1_CheckedChanged(ByVal sender As Object, ByVal e As System.EventArgs) Dim i As Integer For i = 0 To Me.DataGridView.RowCount – 1 Me.DataGridView.Item(Me.Index, i).Value = Me.checkBox1.Checked Next End Sub #End Region End Class
  • You must to post comments
Showing 2 results