We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

GridWrapBehaviour problem with disabled cells

Hi, I have a virtual grid with the GridWrapBehaviour set the WrapRow. My last row is set disabled, except for the first column. However, the grid will not wrap down to the last line. It appears that the wrap code checks the disabled state of the next rows same column before wrapping (ie the last column). How can I get the grid to wrap to the last line. (A simple example which demonstrates the problem is the QueryCellInfo has this code:) if ( this.gridControl1.RowCount == e.RowIndex ) { e.Style.Enabled = ( e.ColIndex <= 1 ); } Thanks, Sue

1 Reply

AD Administrator Syncfusion Team March 22, 2004 02:28 AM

I think you can work around this problem by handling QueryNextCurrentCellPosition and explicitly setting teh currentcell in this case.
private void gridControl1_QueryNextCurrentCellPosition(object sender, GridQueryNextCurrentCellPositionEventArgs e)
{
	GridCurrentCell cc = this.gridControl1.CurrentCell;
	if(e.Direction == GridDirectionType.Down 
		&& cc.ColIndex == this.gridControl1.ColCount
		&& cc.RowIndex == this.gridControl1.RowCount - 1)
	{
		e.Handled = true;
		e.Result = true;
		cc.MoveTo(this.gridControl1.RowCount, 1);
	}
}

Loader.
Live Chat Icon For mobile
Up arrow icon