Code for check the checkbox when clicked:
private void DG_ClickCell(object sender, ClickCellEventArgs e)
{
Infragistics.Win.UltraWinGrid.UltraGrid grid = (UltraGrid)sender;
Infragistics.Win.UIElement element = grid.DisplayLayout.UIElement.LastElementEntered;
if (element is Infragistics.Win.UIElement)
{
UltraGridCell cell =
element.GetContext(typeof(UltraGridCell)) as UltraGridCell;
if (cell != null)
{
//cell.Value = !((bool)cell.Value);
//e.Cell.Row.Cells["Check"].Value = cell.Value;
e.Cell.Row.Cells["Check"].Value = !((bool)e.Cell.Row.Cells["Check"].Value);
}
}
}
Code for make a "check all" in header:
Copy and paste this code in UltraGrid InitializeLayout
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].Hidden = false;
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].Header.CheckBoxVisibility = Infragistics.Win.UltraWinGrid.HeaderCheckBoxVisibility.Always;
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].Header.CheckBoxSynchronization = Infragistics.Win.UltraWinGrid.HeaderCheckBoxSynchronization.Band;
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].Header.VisiblePosition = 7;
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].Width = 50;
ugPostingDegree.DisplayLayout.Bands[0].Columns["Check"].CellActivation = Infragistics.Win.UltraWinGrid.Activation.ActivateOnly;
What is the version you used.
ReplyDeleteI'm using infragistics2 v8.3. It's not support CheckBoxVisibility property.
What should I do ?