Friday, February 26, 2016

How do I make the EditForm Template in an ASPxGridView appear as a modal?

I put this just inside the ASPxGridView. I seeing some bad behavior in which the modal sometimes does not stay open, but that may be a different problem altogether...

<SettingsEditing Mode="PopupEditForm"
   PopupEditFormHorizontalAlign="WindowCenter"
   PopupEditFormVerticalAlign="WindowCenter" PopupEditFormModal="True">
</SettingsEditing>

 
 

Bonus! I fixed the flickering form. You have to wire up this event.

MyGrid.RowDeleting += MyGrid_RowDeleting;

 
 

Like so:

private void MyGrid_RowDeleting(object sender, ASPxDataDeletingEventArgs e)
{
}

 
 

Also, open the form in JavaScript like this:

function MyButton_Click(s, e) {
   AdaptersGrid.AddNewRow();
   AdaptersCallback.PerformCallback(CreateCallbackParam("edit", "-1"));
}

 
 

Maybe I was supposed to be using RowInserting and RowUpdating events? This doesn't work after all. No! I needed to have the .AddNewRow without it being followed by the .PerformCallback.

No comments:

Post a Comment