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.
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();
}
Hey Robert, I can show the source of the page RTS_CFR_Maint.ascx? Problems in the development of RowEditTemplat and I'd like to see. My mail is vegabens@naver.com. Please. Thank you.
Hey Robert,
Sorry to hear you are experiencing trouble with this.
I made a sample that should model what you are trying to accomplish (based on my interpretation of these posts) and things seem to work for me.
Take a look at the code and comments in the sample that I am attaching and see if you can follow the same techniques that I used to get this working.
I never did figure a solution to this problem. No matter how simple a solution the row edit template user control always disappears when I click on the add new box. I tried setting a variable and capturing this in the template close event to cancel that event but that only caused other problems.
I have a simple form with a UltraWebGrid and a SqlDataSource. I wire them up together and add the following client side event. :
function UltraWebGrid1_AfterRowInsertHandler(gridName, rowId, index){ igtbl_getRowById(rowId).editRow();}
In the server side I add the following:
Protected Sub UltraWebGrid1_InitializeLayout(ByVal sender As Object, ByVal e As Infragistics.WebUI.UltraWebGrid.LayoutEventArgs) Handles UltraWebGrid1.InitializeLayout UltraWebGrid1.DisplayLayout.AddNewBox.Hidden = False UltraWebGrid1.DisplayLayout.AddNewRowDefault.Visible = Infragistics.WebUI.UltraWebGrid.AddNewRowVisible.No UltraWebGrid1.DisplayLayout.AllowAddNewDefault = Infragistics.WebUI.UltraWebGrid.AllowAddNew.Yes UltraWebGrid1.DisplayLayout.AllowUpdateDefault = Infragistics.WebUI.UltraWebGrid.AllowUpdate.RowTemplateOnly End Sub Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load Dim template As ITemplate template = Page.LoadTemplate("RTS_CFR_Maint.ascx") UltraWebGrid1.Bands(0).RowEditTemplate = template ' Add an extra column for a button to allow template editing UltraWebGrid1.Columns.Insert(0, "Edit") UltraWebGrid1.Columns(0).Type = ColumnType.Custom UltraWebGrid1.Columns(0).Width = New Unit(75) Me.UltraWebGrid1.DisplayLayout.Bands(0).Columns(0).Header.Caption = "" End Sub
I run the application and only firing an edit event retains the row edit template. Clicking "add new" fires the event to close the row edit template after the row has been added to the grid on the client side.
You mentioned possibly causing a post back... I have no other events other than above in my simple demo so I am confused as to what is happening here.
Anything that causes a postback will stop the RowEditTemplate from showing.
Thanks....