Where do you display the fields to add a new record ?
You cannot edit a new record, you add it, then it becomes
an existing record, and then you Edit the existing
record...
So I am assuming that you are using a DataSet, Adding the
record to the DataTable before you send it to the
database, displaying in the DataGrid and then Commiting it
to the database when the user confirms.
in this case you can check the RowState of the currentrow
of the DataTable to check if it is a new record or not.
LEts say you have a DataKeyField ID in dtNotes datatable...
You can put in the codebehind
protected DataSet dsNotes;
protected DataTable dtNotes ;
public bool CheckNew(object myKey)
{
}
<asp:TextBox ID="txtNote" Runat="server" ReadOnly='<%
#CheckNew(Container.DataItem("ID"))%>'
text='<%#Container.DataItem("Note")%>' Rows="2"
TextMode="MultiLine"
MaxLength="250">
-----Original Message-----
I created an ASP.net form with an editable datagrid on
it. I cancreate new records, and update and delete existing
records. Theproblem I have is that I want a field in the grid to be
editible whenI'm editing a new record, but disabled when editable an
existingrecord. Any ideas
Mark
.