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
49
Finding out the 'rowstate' of an ultragridrow
posted

First time poster, long time user. Here is my issue

  • If a user wants to update the grid, I only allow them to update 2 of 5 cells in a gridrow. (i programatically set noedit on the remaining 3 cells)
  • If a user wants to add a row, I allow them to update all 5 cells in the addrow.
  • If a user has added several new rows, and wants to go back and edit one of the previously added new rows' cells, they are not an 'addrow' anymore, and therefore they can only edit 2 of 5 cells again.

Is there any way to find out the rowstate of the grid row, similar to a dataset retaining information of insert, update, delete?

Is there a property I can access that will tell me 'even though this is not currently an addrow, it is an inserted row in the grid?

here is my code, really hope to be able to add an OR to the if statement:

private void _grdGLMapping_AfterRowActivate(object sender, EventArgs e)
{
if (this._grdGLMapping.ActiveRow.IsAddRow == true || this._grdGLMapping.Rows.????)
{

this._grdGLMapping.ActiveRow.Cells["sDWHTwoPartCode"].Activation = Activation.AllowEdit;
this._grdGLMapping.ActiveRow.Cells["sOrigGeoCode"].Activation = Activation.AllowEdit;
this._grdGLMapping.ActiveRow.Cells["sProductMappingID"].Activation = Activation.AllowEdit;
this._grdGLMapping.ActiveRow.Cells["sTradeAccountCode"].Activation = Activation.AllowEdit;
this._grdGLMapping.ActiveRow.Cells["sICAccountCode"].Activation = Activation.AllowEdit;
}
else
{
this._grdGLMapping.ActiveRow.Cells["sDWHTwoPartCode"].Activation = Activation.NoEdit;
this._grdGLMapping.ActiveRow.Cells["sOrigGeoCode"].Activation = Activation.NoEdit;
this._grdGLMapping.ActiveRow.Cells["sProductMappingID"].Activation = Activation.NoEdit;
this._grdGLMapping.ActiveRow.Cells["sTradeAccountCode"].Activation = Activation.AllowEdit;
this._grdGLMapping.ActiveRow.Cells["sICAccountCode"].Activation = Activation.AllowEdit;
}
}

Parents
No Data
Reply
  • 299
    Offline posted

    I have not found a great way to do this except to use another field (probably a database IDENTITY column) to test this kind of thing.

    For instance, if adding the record to the database change "iTradeAccountMappingID" from 0/null to something like 121243124, then you could say, if "iTradeAccountMappingID" IS NOT NULL AND IS > 0

Children