Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / Design Time / June 2008

Tip: Looking for answers? Try searching our database.

DataGrid IsupportInitialize Compact Framework Problem

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Jayesh Modha - 10 Jun 2008 23:11 GMT
Hi,

I am using .NET CF 3.5 and Windows CE.
I have inherited DataGrid and made my custom DataGrid. I just have few
function on my custom datagrid.
After adding my custom DataGrid to my form, the designer add following
lines to my InitializeComponent.

((System.ComponentModel.ISupportInitialize)(this.myGrid)).BeginInit();
.
.
.
.
.
((System.ComponentModel.ISupportInitialize)(this.myGrid)).EndInit();

.NET CF DataGrid does not support ISupportInitialize but still
desinger is adding that and runtime I get Invalid Cast Exception as it
can not convert DataGrid to ISupportInitialize.

If I use just CF standard DataGrid, it does not add the above
statement to InitializeComponent.
CF DataGrid does not support ISupportInitialize interface and full
framework DataGrid supports ISupportInitialize interface.

I am wondering why this happens with inheriting DataGrid control and
not with CF DataGrid.

Is this a Designer bug?

Please help.

Thanks,
Jayesh Modha
terveer@gmail.com - 19 Jun 2008 18:01 GMT
> ((System.ComponentModel.ISupportInitialize)(this.myGrid)).BeginInit();
> ((System.ComponentModel.ISupportInitialize)(this.myGrid)).EndInit();
>
> .NET CF DataGrid does not support ISupportInitialize but still
> desinger is adding that and runtime I get Invalid Cast Exception as it
> can not convert DataGrid to ISupportInitialize.

I suffer from that as well - did you find a solution?

regards,
Ralf ter Veer
Jayesh Modha - 19 Jun 2008 22:29 GMT
On Jun 19, 10:01 am, terv...@gmail.com wrote:

> > ((System.ComponentModel.ISupportInitialize)(this.myGrid)).BeginInit();
> > ((System.ComponentModel.ISupportInitialize)(this.myGrid)).EndInit();
[quoted text clipped - 7 lines]
> regards,
> Ralf ter Veer

Hi,
I could not find any solution yet.
But until I get the correct solution, i made a workaround.
I implemented the ISupportInitialize interface with empty methods.

public class DataGridEx : DataGrid, ISupportInitialize
{
       #region ISupportInitialize Members
       public void BeginInit()
       {

       }

       public void EndInit()
       {

       }
       #endregion
}
You make this workaround until we get correct solution.

Thanks,
Jayesh Modha

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.