Edit the add new link’s click event of the ListView code-behind and write the following code:

private void lkAddNew_Click(object sender, EventArgs e)
{
    //Retrieving the SaveViewData
    SaveViewData saveViewData = this.GetSessionData(typeof(SaveViewData).Name) as SaveViewData;

    //Set the creation mode
    saveView.IsCreation = true;
    
    //Invoking the action
    this.InvokeController(typeof(SaveController).Name, ApplicationData.InitAction);
}

Edit the CellContentClick event of the GridView and write the following code:

private void contactDataGridView_CellContentClick(object sender, DataGridViewCellEventArgs e)
{            
    //Check that the clicked cell is the edit cell
    if (contactDataGridView.Columns[e.ColumnIndex].Name != this.EditDataColumn.Name) return;

    //Retrieve the SaveViewData
    SaveViewData saveViewData = this.GetSessionData(typeof(SaveViewData).Name) as SaveViewData;
//Set the modification mode
    saveView.IsCreation = false;

    //Invoking the action
    this.InvokeController(typeof(SaveController).Name, ApplicationData.InitAction);
}


Last edited Jun 22, 2009 at 8:31 PM by koossery, version 2

Comments

No comments yet.