|
|
I want to Add text near the checkbox in header, how can I Set the Text at the left/Right of CheckBox.
Thanks in Advance
|
|
|
|
|
I have tried to use this all checkbox are selected but when I commit to change update to dataadapter, first row is not updated. because its state stay Unchanged and its isEdit property is true.
How to reset isEdit to false and row state to unchanged.
|
|
|
|
|
Apologies if this is a trivial question, but I haven't been able to figure it out.
How would I go about getting the header checkbox to uncheck if say a user presses a button?
|
|
|
|
|
I really wanted a similar kind of control to be used in one of our applications for Official purpose.
Could I use it as it is or is it licensed?
Could you please let me know about your approval for the usage of this.
|
|
|
|
|
It's better to add Checked Property in class to get or set checkd state dynamically as follow
public bool Checked
{
get { return _checked; }
set
{
_checked = value;
this.DataGridView.InvalidateCell(this);
}
}
|
|
|
|
|
Hi,
I would like to know if there is any licence restriction to use this code.
Is just what I was looking for and I modified a little to fit my needs.
Thank you in advance
|
|
|
|
|
Hi,
you can use code as it is without my responsibility . Feel free to use it, change it, share it...
Best regards,
DLM
|
|
|
|
|
First class is an extension for enum of real checkbox states:
public static class CheckBoxStateExtension
{
public static bool IsExactUnchecked(this CheckBoxState state) {
return (int)state > 0 && (int)state < 5;
}
public static bool IsExactChecked(this CheckBoxState state) {
return (int)state > 4 && (int)state < 9;
}
public static bool IsExactMixed(this CheckBoxState state) {
return (int)state > 8 && (int)state < 13;
}
public static bool IsDisabled(this CheckBoxState state) {
return (int)state % 4 == 0;
}
public static bool IsNormal(this CheckBoxState state) {
return (int)state % 4 == 1;
}
public static bool IsHot(this CheckBoxState state) {
return (int)state % 4 == 2;
}
public static bool IsPressed(this CheckBoxState state) {
return (int)state % 4 == 3;
}
public static CheckBoxState SetDisabled(this CheckBoxState state, bool value) {
return SetModulo(state, value, 3, 0);
}
public static CheckBoxState SetNormal(this CheckBoxState state, bool value) {
return SetModulo(state, value, 0, 0);
}
public static CheckBoxState SetHot(this CheckBoxState state, bool value) {
return SetModulo(state, value, 1, 0);
}
public static CheckBoxState SetPressed(this CheckBoxState state, bool value) {
return SetModulo(state, value, 2, 0);
}
public static CheckBoxState SetUnchecked(this CheckBoxState state, bool value) {
return SetQuotient(state, value, 0, 1);
}
public static CheckBoxState SetChecked(this CheckBoxState state, bool value) {
return SetQuotient(state, value, 1, 0);
}
public static CheckBoxState SetMixed(this CheckBoxState state, bool value) {
return SetQuotient(state, value, 2, 2);
}
public static CheckBoxState SetModulo(this CheckBoxState state, bool value, int trueModulo, int falseModulo) {
int safe = GetDurty(state);
int valueQuotient = safe / 4;
int valueMod = safe % 4;
if (valueMod == trueModulo && value)
return state;
if (valueMod != trueModulo && !value)
return state;
return Restore(valueQuotient, value ? trueModulo : falseModulo);
}
public static CheckBoxState SetQuotient(this CheckBoxState state, bool value, int trueQuotient, int falseQuotient) {
int safe = GetDurty(state);
int valueQuotient = safe / 4;
int valueMod = safe % 4;
if (valueQuotient == trueQuotient && value)
return state;
if (valueQuotient != trueQuotient && !value)
return state;
return Restore(value ? trueQuotient : falseQuotient, valueMod);
}
private static int GetDurty(CheckBoxState value) {
return (int)value - 1;
}
private static CheckBoxState Restore(int quotient, int mod) {
return (CheckBoxState)(4 * quotient + mod + 1);
}
}
Second class is clean version of DatagridViewCheckBoxHeaderCell:
public class DatagridViewCheckBoxHeaderCell : DataGridViewColumnHeaderCell
{
private Rectangle boxBounds;
private Point cellLocation;
private bool headerCheckBoxClicked;
private bool inited;
public DatagridViewCheckBoxHeaderCell() {
CheckBoxState = CheckBoxState.UncheckedNormal;
}
public event Action<bool> CheckBoxClicked;
public void OnCheckBoxClicked(bool value) {
if (CheckBoxClicked != null)
CheckBoxClicked(value);
}
public CheckBoxState CheckBoxState {
get;
set;
}
public bool Checked {
get { return CheckBoxState.IsExactChecked(); }
set { CheckBoxState = CheckBoxState.SetChecked(value); }
}
protected override void Paint(Graphics graphics, Rectangle clipBounds, Rectangle cellBounds, int rowIndex, DataGridViewElementStates dataGridViewElementState, object value, object formattedValue, string errorText, DataGridViewCellStyle cellStyle, DataGridViewAdvancedBorderStyle advancedBorderStyle, DataGridViewPaintParts paintParts) {
base.Paint(graphics, clipBounds, cellBounds, rowIndex, dataGridViewElementState, null, null, errorText, cellStyle, advancedBorderStyle, paintParts);
if (this.DataGridView != null && !inited)
InitializeGridEvents();
cellLocation = cellBounds.Location;
var size = CheckBoxRenderer.GetGlyphSize(graphics, CheckBoxState.UncheckedNormal);
boxBounds = new Rectangle(new Point
{
X = cellBounds.Location.X + (cellBounds.Width / 2) - (size.Width / 2),
Y = cellBounds.Location.Y + (cellBounds.Height / 2) - (size.Height / 2)
}, size);
CheckBoxRenderer.DrawCheckBox(graphics, boxBounds.Location, CheckBoxState);
}
protected override void OnMouseClick(DataGridViewCellMouseEventArgs e) {
if (IsBoxContains(e.X, e.Y))
ToggleChecked();
base.OnMouseClick(e);
}
protected override void OnMouseDoubleClick(DataGridViewCellMouseEventArgs e) {
if (IsBoxContains(e.X, e.Y))
ToggleChecked();
base.OnMouseDoubleClick(e);
}
protected override void OnKeyUp(KeyEventArgs e, int rowIndex) {
if (e.KeyCode == Keys.Space)
ToggleChecked();
base.OnKeyUp(e, rowIndex);
}
protected override void OnMouseMove(DataGridViewCellMouseEventArgs e) {
MarkHot(IsBoxContains(e.X, e.Y));
base.OnMouseMove(e);
}
protected override void OnMouseLeave(int rowIndex) {
MarkHot(false);
base.OnMouseLeave(rowIndex);
}
protected override void OnMouseDown(DataGridViewCellMouseEventArgs e) {
MarkPressed(IsBoxContains(e.X, e.Y));
base.OnMouseDown(e);
}
protected override void OnMouseUp(DataGridViewCellMouseEventArgs e) {
MarkPressed(false);
base.OnMouseUp(e);
}
private void InitializeGridEvents() {
inited = true;
this.DataGridView.CellValueChanged += GridCellValueChanged;
this.DataGridView.CurrentCellDirtyStateChanged += GridCurrentCellDirtyStateChanged;
}
private void GridCellValueChanged(object sender, DataGridViewCellEventArgs e) {
if (headerCheckBoxClicked)
return;
RowCheckboxClick(this.DataGridView[e.ColumnIndex, e.RowIndex]);
}
private void GridCurrentCellDirtyStateChanged(object sender, EventArgs e) {
if (this.DataGridView.CurrentCell is DataGridViewCheckBoxCell)
this.DataGridView.CommitEdit(DataGridViewDataErrorContexts.Commit);
}
private void RowCheckboxClick(DataGridViewCell checkBox) {
if (checkBox == null)
return;
int count = this.DataGridView.Rows.Cast<DataGridViewRow>().Count(row => (bool)row.Cells[this.ColumnIndex].Value);
if (count == 0)
CheckBoxState = CheckBoxState.SetUnchecked(true);
else if (count < this.DataGridView.RowCount)
CheckBoxState = CheckBoxState.SetMixed(true);
else
CheckBoxState = CheckBoxState.SetChecked(true);
this.DataGridView.InvalidateCell(this);
}
private bool IsBoxContains(int x, int y) {
return (boxBounds.Contains(new Point(x + cellLocation.X, y + cellLocation.Y)));
}
private void ToggleChecked() {
headerCheckBoxClicked = true;
var @checked = !Checked;
foreach (DataGridViewRow row in this.DataGridView.Rows)
row.Cells[this.ColumnIndex].Value = @checked;
this.DataGridView.RefreshEdit();
OnCheckBoxClicked(Checked = @checked);
this.DataGridView.InvalidateCell(this);
headerCheckBoxClicked = false;
}
private void MarkHot(bool value) {
CheckBoxState = CheckBoxState.SetHot(value);
this.DataGridView.InvalidateCell(this);
}
private void MarkPressed(bool value) {
CheckBoxState = CheckBoxState.SetPressed(value);
this.DataGridView.InvalidateCell(this);
}
}
And using
this.CheckedColumn.HeaderCell = new DatagridViewCheckBoxHeaderCell();
Where CheckedColumn is DataGridViewCheckBoxColumn
Good luck
|
|
|
|
|
I've translated the code to vb.net version, and made some improvment.
First I add a default handler to check all the checkbox belongs to the column, and add a 'Handled' property to the eventargs to control whether the action would do or not...
#Region "Imports"
Imports System.Drawing
Imports System.Windows.Forms
Imports System.Windows.Forms.VisualStyles
Imports System.ComponentModel
#End Region
Public Class DataGridViewColumnHeaderCheckBoxCell
Inherits DataGridViewColumnHeaderCell
#Region "Fields"
Private _Checked As Boolean
Private _CheckBoxSize As Size
Private _CheckBoxLocation As Point
Private _CheckBoxBounds As Rectangle
Private _CellLocation As New Point()
Private _CheckBoxAlignment As HorizontalAlignment = HorizontalAlignment.Center
#End Region
#Region "Events"
Public Event CheckBoxCheckedChanged As DataGridViewCheckBoxHeaderCellEvenHandler
#End Region
#Region "Constructor"
Public Sub New()
MyBase.New()
End Sub
#End Region
#Region "Properties"
Public Property CheckBoxAlignment() As HorizontalAlignment
Get
Return _CheckBoxAlignment
End Get
Set(ByVal value As HorizontalAlignment)
If Not [Enum].IsDefined(GetType(HorizontalAlignment), value) Then
Throw New InvalidEnumArgumentException("value", CInt(value), GetType(HorizontalAlignment))
End If
If _CheckBoxAlignment <> value Then
_CheckBoxAlignment = value
If Me.DataGridView IsNot Nothing Then
Me.DataGridView.InvalidateCell(Me)
End If
End If
End Set
End Property
Public Property Checked() As Boolean
Get
Return _Checked
End Get
Set(ByVal value As Boolean)
If _Checked <> value Then
_Checked = value
If Me.DataGridView IsNot Nothing Then
RaiseCheckBoxCheckedChanged()
Me.DataGridView.InvalidateCell(Me)
End If
End If
End Set
End Property
#End Region
#Region "Methods"
Protected Overridable Sub OnCheckBoxCheckedChanged(ByVal e As DataGridViewCheckBoxHeaderCellEventArgs)
RaiseEvent CheckBoxCheckedChanged(Me, e)
End Sub
#End Region
#Region "Override"
Protected Overrides Sub Paint(ByVal graphics As Graphics, ByVal clipBounds As Rectangle, ByVal cellBounds As Rectangle, ByVal rowIndex As Integer, ByVal dataGridViewElementState As DataGridViewElementStates, ByVal value As Object, _
ByVal formattedValue As Object, ByVal errorText As String, ByVal cellStyle As DataGridViewCellStyle, ByVal advancedBorderStyle As DataGridViewAdvancedBorderStyle, ByVal paintParts As DataGridViewPaintParts)
Dim state As CheckBoxState = Me.CheckBoxState
_CellLocation = cellBounds.Location
_CheckBoxSize = CheckBoxRenderer.GetGlyphSize(graphics, state)
Dim p As New Point()
p.Y = cellBounds.Location.Y + (cellBounds.Height / 2) - (_CheckBoxSize.Height / 2)
Select Case _CheckBoxAlignment
Case HorizontalAlignment.Center
p.X = cellBounds.Location.X + (cellBounds.Width / 2) - (_CheckBoxSize.Width / 2) - 1
Exit Select
Case HorizontalAlignment.Left
p.X = cellBounds.Location.X + 2
Exit Select
Case HorizontalAlignment.Right
p.X = cellBounds.Right - _CheckBoxSize.Width - 4
Exit Select
End Select
_CheckBoxLocation = p
_CheckBoxBounds = New Rectangle(_CheckBoxLocation, _CheckBoxSize)
paintParts = paintParts And Not DataGridViewPaintParts.ContentForeground
MyBase.Paint(graphics, clipBounds, cellBounds, rowIndex, dataGridViewElementState, value, _
formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts)
Select Case _CheckBoxAlignment
Case HorizontalAlignment.Center
cellBounds.Width = _CheckBoxLocation.X - cellBounds.X - 2
Exit Select
Case HorizontalAlignment.Left
cellBounds.X += _CheckBoxSize.Width + 2
cellBounds.Width -= _CheckBoxSize.Width + 2
Exit Select
Case HorizontalAlignment.Right
cellBounds.Width -= _CheckBoxSize.Width + 4
Exit Select
End Select
paintParts = DataGridViewPaintParts.ContentForeground
MyBase.Paint(graphics, clipBounds, cellBounds, rowIndex, dataGridViewElementState, value, _
formattedValue, errorText, cellStyle, advancedBorderStyle, paintParts)
CheckBoxRenderer.DrawCheckBox(graphics, _CheckBoxLocation, state)
End Sub
Protected Overrides Sub OnMouseClick(ByVal e As DataGridViewCellMouseEventArgs)
If e.Button = MouseButtons.Left Then
If Not Me.OwningColumn.ReadOnly Then
Dim p As New Point(_CellLocation.X + e.X, _CellLocation.Y + e.Y)
If _CheckBoxBounds.Contains(p) Then
RaiseCheckBoxCheckedChanged()
End If
End If
End If
MyBase.OnMouseClick(e)
End Sub
Protected Overrides Sub OnKeyDown(ByVal e As KeyEventArgs, ByVal rowIndex As Integer)
If e.KeyCode = Keys.Space Then
If Not Me.OwningColumn.ReadOnly Then
RaiseCheckBoxCheckedChanged()
End If
End If
MyBase.OnKeyDown(e, rowIndex)
End Sub
Public Overrides Function Clone() As Object
Dim cell As DataGridViewColumnHeaderCheckBoxCell = TryCast(MyBase.Clone(), DataGridViewColumnHeaderCheckBoxCell)
If cell IsNot Nothing Then
cell.Checked = Me.Checked
End If
Return cell
End Function
#End Region
#Region "Private"
Private Sub RaiseCheckBoxCheckedChanged()
Dim e As New DataGridViewCheckBoxHeaderCellEventArgs(Not _Checked)
Me.OnCheckBoxCheckedChanged(e)
If Not e.Cancel Then
Me._Checked = e.Checked
Me.DataGridView.InvalidateCell(Me)
If Not e.Handled Then
Me.SetColumnCheckBoxChecked(e.Checked)
End If
End If
End Sub
Private Sub SetColumnCheckBoxChecked(ByVal checked As Boolean)
For Each dgvr As DataGridViewRow In Me.DataGridView.Rows
If (dgvr.IsNewRow) Then
Continue For
End If
dgvr.Cells(Me.OwningColumn.Index).Value = checked
Next
Dim currCell As DataGridViewCell = Me.DataGridView.CurrentCell
If (currCell IsNot Nothing AndAlso currCell.ColumnIndex = Me.OwningColumn.Index) Then
Me.DataGridView.RefreshEdit()
End If
End Sub
Private ReadOnly Property CheckBoxState() As CheckBoxState
Get
Dim enabled As Boolean = True
If MyBase.DataGridView IsNot Nothing AndAlso Not MyBase.DataGridView.Enabled Then
enabled = False
End If
If enabled Then
Return IIf((_Checked), CheckBoxState.CheckedNormal, CheckBoxState.UncheckedNormal)
End If
Return IIf((_Checked), CheckBoxState.CheckedDisabled, CheckBoxState.UncheckedDisabled)
End Get
End Property
#End Region
End Class
#Region "Events and Delegates"
Public Delegate Sub DataGridViewCheckBoxHeaderCellEvenHandler(ByVal sender As Object, ByVal e As DataGridViewCheckBoxHeaderCellEventArgs)
Public Class DataGridViewCheckBoxHeaderCellEventArgs
Inherits CancelEventArgs
Private _Checked As Boolean = False
Private _Handled As Boolean = False
Public Sub New(ByVal checkedValue As Boolean)
MyBase.New()
_Checked = checkedValue
End Sub
Public Sub New(ByVal checkedValue As Boolean, ByVal cancel As Boolean)
MyBase.New(cancel)
_Checked = checkedValue
End Sub
Public Sub New(ByVal checkedValue As Boolean, ByVal handled As Boolean, ByVal cancel As Boolean)
MyBase.New(cancel)
_Checked = checkedValue
_Handled = handled
End Sub
Public ReadOnly Property Checked() As Boolean
Get
Return _Checked
End Get
End Property
Public Property Handled() As Boolean
Get
Return _Handled
End Get
Set(ByVal value As Boolean)
_Handled = value
End Set
End Property
End Class
#End Region
|
|
|
|
|
Thanks for the VB.net conversion. I appreciate you taking the time and sharing it.
|
|
|
|
|
Thanks for the conversion! runs pretty solid! Calling it as shown below...
Dim Column As DataGridViewCheckBoxColumn = New DataGridViewCheckBoxColumn()
Dim ColHeader As DataGridViewColumnHeaderCheckBoxCell = New DataGridViewColumnHeaderCheckBoxCell()
ColHeader.ToolTipText = "Select Clause"
Column.HeaderCell = ColHeader
Column.ValueType = GetType(System.Boolean)
Column.TrueValue = "True"
Column.FalseValue = "False"
dgvData.Columns.Insert(0, Column)
|
|
|
|
|
Thank you so much, you saved my day.
|
|
|
|
|
Hi
I found the cause of this problem & the solution.
When 'DataPropertyName' is set it looks like the custom headerCell is cloned a number of times (possibly on painting the container).
The custom class dose not override the clone method so any handlers registered for the event are not copied to the newly cloned headerCell.
Adding the following solves the problem:
public override object Clone()
{
DatagridViewCheckBoxHeaderCell obj = (DatagridViewCheckBoxHeaderCell)base.Clone();
obj._checkBoxLocation = _checkBoxLocation;
obj._checkBoxSize = _checkBoxSize;
obj._checked = _checked;
obj._cellLocation = _cellLocation;
obj._cbState = _cbState;
obj.OnCheckBoxClicked = OnCheckBoxClicked;
return obj;
}
Hope this helps
Trevor
|
|
|
|
|
thank you, it saves a lot of time
|
|
|
|
|
|
Thanks a lot, very useful.
|
|
|
|
|
In your form class where the grid is:
private readonly List<CheckBox> _ListCheckboxes = new List<CheckBox>();
private readonly List<DataGridViewCell> _ListCellsToIgnore = new List<DataGridViewCell>();
public XXForm()
{
InitializeComponent();
//TODO
// add data to your grid
AddCheckBoxesToGridHeader();
UpdateGrid();
}
private void AddCheckBoxesToGridHeader()
{
Rectangle rect;
CheckBox checkboxHeader;
// add checkbox header
// TODO specify here the columns where
// checkboxes should appear in the header
int [] cols = new int [] {0, 2, 3};
foreach( int col in cols )
{
// set checkbox header to center of header cell. +1 pixel to position correctly.
rect = dataGridView1.GetCellDisplayRectangle(col, -1, true);
rect.X = rect.Location.X + 5;//+ (rect.Width / 4);
// create checkbox
checkboxHeader = new CheckBox();
checkboxHeader.Name = "checkboxHeader" + col;
checkboxHeader.Tag = col;
checkboxHeader.Size = new Size(18, 18);
checkboxHeader.ThreeState = true;
checkboxHeader.Location = rect.Location;
//checkboxHeader.CheckedChanged += checkboxHeader_CheckedChanged;
checkboxHeader.CheckStateChanged += checkboxHeader_CheckStateChanged;
checkboxHeader.BackColor = Color.Transparent;
dataGridView1.Controls.Add(checkboxHeader);
_ListCheckboxes.Add(checkboxHeader);
dataGridView1.Columns[col].Width += checkboxHeader.Size.Width;
}
}
private void UpdateGrid()
{
// TODO
// you want an specific cell of an CheckBoxColumn
// NOT have chaeckboxes?
int row = 0;
int col = 0;
// overwrite with text cell
DataGridViewCell cell = new DataGridViewTextBoxCell();
dataGridView1.Rows[row].Cells[col] = cell;
_ListCellsToIgnore.Add(cell);
}
//TODO add handler in designer
private void dataGridView1_DataError(object sender, DataGridViewDataErrorEventArgs e)
{
DataGridViewCell cell = dataGridView1.Rows[e.RowIndex].Cells[e.ColumnIndex];
if( _ListCellsToIgnore.Contains(cell))
{
e.ThrowException = false;
e.Cancel = true;
}
}
// TODO add handler in designer
private void dataGridView1_ColumnWidthChanged(object sender, DataGridViewColumnEventArgs e)
{
foreach(CheckBox checkboxHeader in _ListCheckboxes)
{
int col = (int) checkboxHeader.Tag;
// set checkbox header to center of header cell. +1 pixel to position correctly.
Rectangle rect = dataGridView1.GetCellDisplayRectangle(col, -1, true);
rect.X = rect.Location.X +5;//+ (rect.Width / 4);
checkboxHeader.Location = rect.Location;
}
}
void checkboxHeader_CheckStateChanged(object sender, EventArgs e)
{
CheckBox checkboxHeader = (CheckBox) sender;
int col = (int) checkboxHeader.Tag;
MessageBox.Show("You pressed column " + col + " to value " + checkboxHeader.CheckState);
}
|
|
|
|
|
This is an interesting idea, but it won't work if you need a horizontally scrolling datagridview. The checkboxes stay in the same spot when you scroll to the right/left.
|
|
|
|
|
I want to uncheck the header check box when any of the check boxex in the grid is unchecked because not all check box is selected at that time
Ravi Mishra
|
|
|
|
|
Here is the VB.NET Code:
Let us assume the Name of checkbox column is "chkBox".
Private Sub DataGridView1_CellContentClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridView1.CellContentClick
If CType(sender, DataGridView).Columns(e.ColumnIndex).Name = "chkBox" And e.RowIndex >= 0 Then
Dim dgCB As DataGridViewCheckBoxCell
dgCB = CType(DataGridView1("chkBox", e.RowIndex), DataGridViewCheckBoxCell)
If Not CBool(dgCB.EditedFormattedValue) Then
'Check box unselected
If dgvColumnHeader.CheckAll Then
dgvColumnHeader.uncheckHeaderCheckBox()
End If
End If
End If
End Sub
Add a new method in dgvColumnHeader.
Public Sub uncheckHeaderCheckBox()
Me.m_checkAll = Not Me.m_checkAll
Me.DataGridView.Invalidate()
End Sub
|
|
|
|
|
How to implement in the above vb.net code ?
|
|
|
|
|
Please let me was this problem fixed. I have the same issue and couldn't find solution.
|
|
|
|
|
Hello tout le monde,
If you want to have a readable column label close to the checkbox, here is a
very small code. In the body of the Paint method :
DataGridViewPaintParts paintParts)
{
base.Paint(graphics, clipBounds, cellBounds, rowIndex,
dataGridViewElementState, value,
formattedValue, errorText, cellStyle,
advancedBorderStyle, paintParts);
// Begin
Size sText = TextRenderer.MeasureText(formattedValue as string, cellStyle.Font, cellBounds.Size);
int sWidthText = cellBounds.Width;
Point ptCellText = cellBounds.Location;
ptCellText.X += sText.Width;
sWidthText -= sText.Width;
cellBounds.Location = ptCellText;
cellBounds.Width = sWidthText;
// End
...
It works well, currently I do not met an unwanted side effect.
Thanks
|
|
|
|
|
Hello,
Wrong copy/paste in my previous sequence. The good code is :
Size sText = TextRenderer.MeasureText(formattedValue as string, cellStyle.Font, cellBounds.Size);
int sWidthText = cellBounds.Width;
Point ptCellText = cellBounds.Location;
ptCellText.X += sText.Width;
sWidthText -= sText.Width;
_cellLocation = cellBounds.Location;
cellBounds.Location = ptCellText;
cellBounds.Width = sWidthText;
If not you won't catch the checkbox is clicked.
Thanks to BYPsoft for this sample.
|
|
|
|
|