Skip to Content
0
Former Member
Mar 22, 2005 at 01:43 PM

How can I delete the last row of a Matrix

18 Views

Hi All,

Does anyone know whether deleting the last row of a matrix controlled by a UDO child table gives problems? I have the strange effect that I cannot delete the very last existing row in the matrix, i.e. after updating the delete the last to-be deleted row comes back into my matrix !!

I give you a snippet of my code (function getSelectedRow gives the selected row in the matrix):

==

if (evnt.ItemUID.Equals(ViewConstants.Items.DELETEBUTTON))

{

if (evnt.EventType == BoEventTypes.et_ITEM_PRESSED)

{

if (evnt.BeforeAction)

{

form = BusinessOne.Application.Forms.Item(formUID);

mtx = (Matrix)form.Items.Item(ViewConstants.Items.MATRIX).Specific;

int numRow = getSelectedRow(mtx);

if (numRow != -1)

{

mtx.DeleteRow(numRow);

form.Mode = BoFormMode.fm_UPDATE_MODE;

}

Item btn = (Item)form.Items.Item(ViewConstants.Items.ADDBUTTON);

btn.Enabled = true;

}

}

}

==

Cheers,

Marcel Peek

Alpha One

Message was edited by: Marcel Peek

Message was edited by: Marcel Peek