Hello,I'm using UltraWebGrid and my actual situation let me:
I would like to:
This article explain how to do some things I want to do (delete), but not all:http://dotnetslackers.com/articles/aspnet/QuickGuideToImplementingTheNetAdvantageUltraWebGrid.aspxAnd in the infragistics sample page (http://samples.infragistics.com/2008.3/WebFeatureBrowser/Default.aspx) also have an example of a column with an edit image, but looking at the sourcecode I don't know how it creates that button (it isn't a "normal button column"). It also let you edit the row clicking in any part of the row. The example I mean is "WebGrid -> Row Templates".Thanks in advance
Hi,
I added another line of code in the UltraWebGrid1_AfterRowTemplateCloseHandler to check if the first cell of the row is empty or not before deleting it. In case of new row it is empty.
This changes the UltraWebGrid1_AfterRowTemplateCloseHandler method as follows:
function UltraWebGrid1_AfterRowTemplateCloseHandler(gridName, rowId, bSaveChanges)
{
var row = igtbl_getRowById(rowId);
var cell = row.getCell(0); // gets the first cell in the row
var val = cell.getValue(); //gets the value of present in the first cell
//for the new row the value in the first cell is null
if(event.srcElement.id == "igtbl_reCancelBtn" && val == null )
row.deleteRow();
}
Hope this helps.
Thanks
Would not running this code also delete any row that the cancel button was clicked on?
For example if I open rowedit template on historical data, then click cancel.
Has this been resolved? I too am looking to use validation. In the post you say that you will send the individual any updates. Can you also post them on the forums?
Bill
It looks like the row is deleted from the client side, even though there is an error. I went through the sample and think it needs more investigation. I'm going to open a case for this issue and will send you the updates.
I have seen a new problem :(
If I try to delete a row but something happens (a foreing key constraint make that you can't delete the row for example) the row dissapears from the grid even if I try to cancel the deletion (e.Cancel = true on the deleterow method).
---------------------------------------------------------------------------------------------------------
protected void gridPersonas_DeleteRow(object sender, Infragistics.WebUI.UltraWebGrid.RowEventArgs e) { try { int id = Convert.ToInt32(e.Row.Cells[columnaDatosInicio + 0].Value); portalManejador.Personas_B(id, SEmpresaCliente); } catch { e.Cancel = true; } }
Any idea of this or any of the previous unsolved posted problems?