Hi,
Please cen anyone help me with the following, I am trying to retrieve the values from a NewRow using the rowvalidated event, all is fine, the first time you add a new row
The second time you add a new row I am unable to get the values from the CheckBox Column
Is there any other way of doing this, am I doing it correctly??
I have attached the code for review
Thanks
Pieter
Please cen anyone help me with the following, I am trying to retrieve the values from a NewRow using the rowvalidated event, all is fine, the first time you add a new row
The second time you add a new row I am unable to get the values from the CheckBox Column
Is there any other way of doing this, am I doing it correctly??
I have attached the code for review
Thanks
Pieter
private void gridAddress_RowValidated(object sender, Telerik.WinControls.UI.RowValidatedEventArgs e) |
{ |
if (e.Row is Telerik.WinControls.UI.GridViewNewRowInfo) |
{ |
Telerik.WinControls.UI.GridViewDataRowInfo newRowInfo = (Telerik.WinControls.UI.GridViewDataRowInfo)((Telerik.WinControls.UI.GridViewNewRowInfo)e.Row).DataRowInfo; |
//... |
if (newRowInfo != null) |
{ |
CustomerAddress add = new CustomerAddress(); |
add.CustomerID = currentitem.CustomerID; |
add.Addresstype = AddressTypes.AddressTypesByID(Convert.ToInt32(newRowInfo.Cells["AddressType"].Value)); |
add.Address1 = newRowInfo.Cells["Address1"].Value.ToString(); |
add.Address2 = newRowInfo.Cells["Address2"].Value.ToString(); |
add.Suburb = newRowInfo.Cells["Suburb"].Value.ToString(); |
add.City = newRowInfo.Cells["City"].Value.ToString(); |
add.Zipcode = newRowInfo.Cells["ZipCode"].Value.ToString(); |
//if (newRowInfo.Cells["IsPrimary"].Value.Equals(true)) |
//{ |
// add.IsPrimary = Convert.ToBoolean( newRowInfo.Cells["IsPrimary"].Value.ToString() ); |
//} |
//else |
//{ |
// add.IsPrimary = false; |
//} |
add.IsPrimary = Convert.ToBoolean(newRowInfo.Cells["IsPrimary"].Value.ToString()); |
currentitem.CustomerAddress.Add(add); |
} |
} |
} |