When I double click on the row rather than an individual cell I get this exception:
[IndexOutOfRangeException: Index was outside the bounds of the array.] Infragistics.WebUI.UltraWebGrid.UltraWebGrid.RaisePostBackEvent(String eventArgument) +13535 System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13 System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565
It never even gets to my handler. Code is below:
="left: -21px;
top: -4px"
="grdProducts_DblClick">
>
="NotSet">
="Header"
="4.00">
="">
/>
="1px">
="8pt">
="White">
="300px">
="Solid">
="0px">
="469px">
<
BorderDetails>
</
protected void Page_Load(object sender, EventArgs e)
{
XmlDataSource1.Data =
BSHFactory.GetProductList();
grdProducts.DataSourceID =
"XmlDataSource1";
grdProducts.DataBind();
grdProducts.Columns[0].Hidden =
true;
grdProducts.Columns[1].CellStyle.TextOverflow = Infragistics.WebUI.UltraWebGrid.
TextOverflow.Ellipsis;
grdProducts.Columns[1].Width =
Unit.Pixel(150);
grdProducts.Columns[2].CellStyle.TextOverflow = Infragistics.WebUI.UltraWebGrid.
grdProducts.Columns[2].Width =
Unit.Pixel(500);
grdProducts.Columns[3].Width =
grdProducts.Width =
Unit.Pixel(803);
foreach (UltraGridRow r in grdProducts.Rows)
r.Cells[3].TargetURL =
'@' + r.Cells[3].Text;
}
protected void grdProducts_DblClick(object sender, ClickEventArgs e)
if (e.Cell != null)
UltraGridRow row = e.Cell.Row;
Product p = BSHFactory.GetProduct(Int64.Parse(row.Cells[0].Text));
if (p != null)
lblMsg.Text = p.Description;
else
lblMsg.Text =
;
Hello,
As far as I can tell by looking at the code, it is a combined page lifecycle / databinding issue. Declarative datasources like XmlDataSource need to be set declaratively through the DataSourceID in the ASPX of the page, e.g.
<igtbl:UltraWebGrid runat="server" ID="UltraWebGrid1" DataSourceID="XmlDataSource1" ... />
This way, you will not need to explicitly bind the grid in Page_Load and i think this will address the issue.