how can I make the Row edit template pop up after clicking on the Add New Box without having to click on the new empty row?
If I try to do this in the UltraWebGrid1_AfterRowInsertHandler event using row.editRow() method it tries to update the record.
Hi Robert,
I have a simple ASP.NET application with a WebGrid bound to a SqlDataSource and I am handling the AfterRowInsertHandler client side event.
Here is the code in that event handler:
function UltraWebGrid1_AfterRowInsertHandler(gridName, rowId, index){
//Add code to handle your event here.
igtbl_getRowById(rowId).editRow();
}
Once I click on the AddNew box, a new row is inserted and immediately, I see the RowEditTemplate open
Off the top of my head you should check:
1. Are you handling any server side events that will fire when you add a new row?
2. Are you causing any postbacks to occur?
Anything that causes a postback will stop the RowEditTemplate from showing.
I have similar need. I have a button placed outside the Grid. Now when I click the button, it should open the RET (RowEditTemplate).
Can you share what properties need to set up in UGV(UltraGirdView) to pop up the RET ? I just need to popup the RET.
This is my button
input value="New" type="button" id="abc" runat="server" onclick="test()"
This is my function to get the RET
function test()
{
alert(
"Open RET");
row = igtbl_addNew(grid, 0);
row.editRow();
There is problem when ur grid is absolutely empty and you try to add rows using the above concept. The controls inside the Row Edit Template doesnot render properly.
Hi Rajib,
Let me know if you need any further assistance with this matter.
Bhadresh
Using the link mentioned above by Tom (http://help.infragistics.com/NetAdvantage/ASPNET/2010.1/CLR3.5/?page=WebGrid_Using_Row_Templates.html ) I have created a sample. I was able to show the popup row edit template by modifying the code you have provided as follows:
var grid = igtbl_getGridById("UltraWebGrid1"); var row = grid.Rows.getRow(0); row.editRow();
Please modify the code in your application and let me know if you need any further assistance with this matter.
var grid1 = document.getElementById("ctl00_PageContent_grdbatchs");
var grid2 = document.getElementById("ctl00xPageContentxgrdbatchs");
var
grid3 = igtbl_getGridById("ctl00_PageContent_grdbatchs");
var grid4 = "ctl00_PageContent_grdbatchs";
igtbl_addNew(grid1, 0);
I have tried with the grid1, grid2, grid3 and grid4 and I am not able to create a new row or open the RoweditTemplate. Please advice.
Looks like you are on the right track. All you need to do now is to create a Row Edit Template that represents the fields that you want to show in the popup RowEditTemplate that shows.
Check out this topic:
http://help.infragistics.com/NetAdvantage/ASPNET/2010.1/CLR3.5/?page=WebGrid_Using_Row_Templates.html
Regards,
Tom