Edit grid row in new window

May 12, 2010 at 8:28 AM


I have a databound grid with a ticketid as a unique id for each row. I am using a 'WindowField' to edit that row in a new window. The ticketid are parsed to the window control with the 'DataIFrameUrlFields' property, like this:

<ext:Grid ID="Grid1" runat="server" EnableCheckBoxSelect="false" EnableMultiSelect="false" EnableMouseOverColor="true" AllowPaging="true" onrowdatabound="Grid1_RowDataBound" >


<ext:WindowField Width="150px" ColumnID="windowField1" WindowID="Window1" HeaderText="Ticket" DataIFrameUrlFields="ticketnumber" DataIFrameUrlFormatString="ShowCase.aspx?id={0}" />

<ext:Window ID="Window1" Popup="false" EnableIFrame="true" IFrameUrl="about:blank" Target="Parent" runat="server" IsModal="true" Width="800px" OnClose="Window1_Close" EnableConfirmOnClose="true" Height="625px"></ext:Window>


In the ShowCase.aspx.cs file I am fetching the ticketid again with the following code inside Page_Load:

if (!Page.IsPostBack)

The problem is that it is not the correct id that is fed to the querystring - it is always the next row in the grid... why is this??

BTW: I am setting the title of the window inside the Grid1_RowDataBound method, and THAT ticketid is the right one:

ExtAspNet.WindowField windowField1Row = gridCaseOverview.FindColumn("windowField1") as ExtAspNet.WindowField;
windowField1Row.Title = i.ticketnumber;

May 17, 2010 at 6:42 AM
Edited May 17, 2010 at 9:25 AM


BTW: The Grid is databound with a Generic List of 'incident' objects (List<incident>)... Is that a problem compared to databound with a DataTable?

EDIT: Case solved - it was because I was using RowDataBound instead of PreRowDataBound to edit the row data.