Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
355
I can't check a bound checkbox
posted

...using Infragistics Infragistics2.Win.UltraWinGrid.v9.2 and VS2010 (.net 4.0)

I have a form with two grids that are both backed by a generic list of the same type. The user can move rows from on grid to another, but when rows are moved to the ImageGrid, I want the IsStale property to be displayed.  This works fine.

My problem is that I'm not able to check/uncheck the checkbox in the IsStale column. The checkbox in the header does toggle all the checkboxes in the column, but I'm not able to cherry-pick.  

I've looked at this article but no positive results yet.

Thanks in advance

public class MissingLanguageDTO
{
public bool IsStale { get; set; }
public string GroupNumber { get; set; }
public string LanguageIndicator { get; set; }
public string State { get; set; }
public DateTime? DateOfService { get; set; }

//... other properties

}

private void Grid_InitializeRow(object sender, UltraGrid.InitializeRowEventArgs e)
{
MissingLanguageDTO m = e.Row.ListObject as MissingLanguageDTO;
if (m != null)
{
var isStaleCell = e.Row.Band.Columns.Exists(KEY_MISSING_IS_STALE) ? e.Row.Cells[KEY_MISSING_IS_STALE] : null;

e.Row.Activation = UltraGrid.Activation.AllowEdit;
if (isStaleCell != null)
{
isStaleCell.Activation = UltraGrid.Activation.AllowEdit;
isStaleCell.Value = true ;
}

//more logic left out

}

private void Grid_InitializeLayout(object sender, UltraGrid.InitializeLayoutEventArgs e)

{

// each grid is backed by List<MissingLanguageDTO>
// I want to show different columns on each grid
var band = e.Layout.Bands[0];
var grid = (UltraGrid.UltraGrid)sender;
var isImageGrid = grid == ImagedGrid;

e.Layout.Override.AllowUpdate = Infragistics.Win.DefaultableBoolean.True;
e.Layout.Override.WrapHeaderText = Infragistics.Win.DefaultableBoolean.True;
e.Layout.Override.HeaderAppearance.TextHAlign = Infragistics.Win.HAlign.Center;

band.Override.RowSizing = UltraGrid.RowSizing.Free;
band.Override.RowSizingAutoMaxLines = 5;
band.Override.CellMultiLine = Infragistics.Win.DefaultableBoolean.True;

var colIsStale = band.Columns.Exists(KEY_MISSING_IS_STALE) ? band.Columns[KEY_MISSING_IS_STALE] : band.Columns.Add(KEY_MISSING_IS_STALE, KEY_MISSING_IS_STALE_CAPTION);

//for the ImagedGrid display the isStale column
if (isImageGrid)
{
colIsStale.CellActivation = UltraGrid.Activation.AllowEdit;
colIsStale.CellClickAction = UltraGrid.CellClickAction.Edit;
colIsStale.Style = UltraGrid.ColumnStyle.CheckBox;
//add a "toggle all" checkbox to the header
colIsStale.Header.CheckBoxVisibility = UltraGrid.HeaderCheckBoxVisibility.Always;
colIsStale.Header.CheckBoxAlignment = UltraGrid.HeaderCheckBoxAlignment.Right;
colIsStale.Header.CheckBoxSynchronization = UltraGrid.HeaderCheckBoxSynchronization.Band;

colIsStale.Header.VisiblePosition = 0;
colIsStale.Hidden = false;

}
else
{
colIsStale.Hidden = true;
}

//more logic left out

}

  • 355
    Verified Answer
    posted

    Apparently I didn't read closely enough.

    If it is neccessary to allow editing in a single Cell whose column or row is otherwise disabled or Read-only, the cell can be forced to honor it's own Activation Property by setting the IgnoreRowColActivation property on the cell to true.