Essential Grid with cell type as MonthCalendar
I have a problems with the Grid and Tabcontrol
on a user control.
There is tabcontrol with 2 tabpages and the essential grid is on one of the tabpages, the essential grid has a column whose cell type is Month Calendar. Whenever the calendar is opened for date selection the application hangs
I see the following trace
System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Windows.Forms.PopupCloseRequestListener.Attach()
at Syncfusion.Windows.Forms.PopupCloseRequestListener.set_ParentControl(Control value)
at Syncfusion.Windows.Forms.PopupControlContainer.OnPopup(EventArgs args)
at Syncfusion.Windows.Forms.PopupControlContainer.ShowPopup(Point location)
at Syncfusion.Windows.Forms.Grid.GridDropDownCellRenderer.OnShowDropDown()
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.ShowDropDown()
at Syncfusion.Windows.Forms.Grid.GridCurrentCell.ToggleDropDown()
at Syncfusion.Windows.Forms.Grid.GridDropDownCellRenderer.OnButtonClicked(Int32 rowIndex, Int32 colIndex, Int32 button)
at Syncfusion.Windows.Forms.Grid.GridCellRendererBase.ButtonClicked(Object sender, GridCellEventArgs e)
at Syncfusion.Windows.Forms.Grid.GridCellButton.OnClicked(GridCellEventArgs e)
Can anyone offer some ideas?
Thanks
Indhu
SIGN IN To post a reply.
5 Replies
AD
Administrator
Syncfusion Team
April 9, 2004 09:44 PM UTC
I tried to see the problem in the attached sample in the latest code here. It seemed to work as expected. The attached version has the the first tab, but it also worked from the second tab.
Does this sample work for you? If not, what version of our grid are you using?
If it does work, what are you doing differently in your user control?
forum12736_5229.zip
IB
Indhu Balasubramaniam
April 11, 2004 03:09 PM UTC
Hi Clay
Thanks for getting back to me. The version of the gird I am using is 2.0.3.0. My calling program is an MFC program.
Indhu
>I tried to see the problem in the attached sample in the latest code here. It seemed to work as expected. The attached version has the the first tab, but it also worked from the second tab.
>
>Does this sample work for you? If not, what version of our grid are you using?
>
>If it does work, what are you doing differently in your user control?
>forum12736_5229.zip
>
>
AD
Administrator
Syncfusion Team
April 11, 2004 06:29 PM UTC
It is not clear why the Attach method would be throwing a Null Reference exception.
private void Attach()
{
if(this.parentControl != null)
{
this.parentControl.LostFocus += new EventHandler(this.ParentLostFocus);
Form parentForm = FindFormHelper.FindForm(this.parentControl);
if (parentForm != null)
{
parentForm.Resize += new EventHandler(this.MenuCloseEvent);
parentForm.Move += new EventHandler(this.MenuCloseEvent);
parentForm.Deactivate += new EventHandler(this.FormDeactivate);
if (parentForm.ParentForm != null)
{
parentForm.ParentForm.Move += new EventHandler(this.MenuCloseEvent);
parentForm.ParentForm.Deactivate += new EventHandler(this.FormDeactivate);
}
}
}
}
If you own the source code, you can step into this method to pinpoint what is null, and why it is being referenced.
If you can attach a small sample, we can try to spot something here.
IB
Indhu Balasubramaniam
April 13, 2004 10:57 AM UTC
I have attached 2 Zip files one is the .NET cs UserControl (GridSamp)with the TabControl and Grid and the other is a MFC7 (NetCtrlTest) program which launches the control. OnInitDialog has code for launching the control
Thanks
Indhu
>It is not clear why the Attach method would be throwing a Null Reference exception.
>
>private void Attach()
>{
> if(this.parentControl != null)
> {
> this.parentControl.LostFocus += new EventHandler(this.ParentLostFocus);
> Form parentForm = FindFormHelper.FindForm(this.parentControl);
> if (parentForm != null)
> {
> parentForm.Resize += new EventHandler(this.MenuCloseEvent);
> parentForm.Move += new EventHandler(this.MenuCloseEvent);
> parentForm.Deactivate += new EventHandler(this.FormDeactivate);
> if (parentForm.ParentForm != null)
> {
> parentForm.ParentForm.Move += new EventHandler(this.MenuCloseEvent);
> parentForm.ParentForm.Deactivate += new EventHandler(this.FormDeactivate);
> }
> }
> }
>}
>
>
>If you own the source code, you can step into this method to pinpoint what is null, and why it is being referenced.
>
>If you can attach a small sample, we can try to spot something here.
GridSamp_7146.zip
NetCtrlTest_8891.zip
AD
Administrator
Syncfusion Team
April 13, 2004 04:25 PM UTC
Thank you for your sample.
If I remove all grid dependencies and just put a DateTimePicker on the tab, I see the same behavior. So, I do not think it has anything specifically to do with the grid.
It almost looks like there are two message pumps running, and this is just locking up the system.
Here are a couple of forum threads talking about hosting .NET Windows Forms controls in other containers. Sound like there may be some inherit problem in doing this.
http://discuss.develop.com/archives/wa.exe?A2=ind0312c&L=dotnet-winforms&D=0&T=0&P=4343
http://discuss.develop.com/archives/wa.exe?A2=ind0312c&L=dotnet-winforms&D=0&T=0&P=6632
Also, here is a case study from MS that might offer an aalternative approach though it sounds invovled to me. http://www.microsoft.com/resources/casestudies/CaseStudy.asp?CaseStudyID=14934
SIGN IN To post a reply.
- 5 Replies
- 2 Participants
-
IB Indhu Balasubramaniam
- Apr 9, 2004 03:54 PM UTC
- Apr 13, 2004 04:25 PM UTC