Trapping Double Click Event

Hello,

We have an issue when trying to trap the double click event on the grid. So far we have tried to insert the grid in an ASCX control, and are trying to insert the control dynamicaly into the page. We have the following error on the cell double click:

Error :

Object not set to an instance of an object.

Stack:

[NullReferenceException: La référence d'objet n'est pas définie à une instance d'un objet.]
   Aspose.Grid.Web.GridWeb.(String ) +140
   Aspose.Grid.Web.GridWeb.ী(String, NameValueCollection ূ) +208
   System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) +718
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4526
Any help would be greatly appriciated
Thanks in advance,
Vincent

Hi Vincent,

I did some test about ascx but did not find any problems. How did you insert the user control dynamicaly into the page? Could you please post your source file here?

Hi,

Here's an example of the code I've used to insert the grid into an ascx (we've called it WebUserControlGantt). To make this, I did a drag and drop of the aspose grid into the ASCX. It may also help you to know that we use in parallel your icalendar control in ASCX. We've noticed that all the control (ms and yours) produce an error when there's an event.

Hope this helps, Thanks in advance,

Vincent.

public partial class _Default : System.Web.UI.Page

{

protected void Page_Load(object sender, EventArgs e)

{

WebUserControlGantt uc1 = LoadControl("WebUserControl.ascx") as WebUserControlGantt;

if (uc1 != null)

this.Controls.Add(uc1);

}

}

Hi,

You can't insert a control into to top-level control collection of a Page object. You may create a placeholder object on the page an insert your user control into it.

Here is a sample:

protected void Page_Load(object sender, EventArgs e)
{
WebUserControl uc1 = (WebUserControl)Page.LoadControl("WebUserControl.ascx");
uc1.ID = "uc1";
PlaceHolder1.Controls.Add(uc1);
}