Home All Groups Group Topic Archive Search About

Windows Form and Windows Form User Control - Where Is The Method That Would corresspond To A Web For

Author
31 Mar 2005 8:33 PM
Richard
Hello



MyMainWebPage.aspx contains MyUserControl.ascx



MyUserControl.ascx has a DataTable Property MyDataTable



MyUserControl.ascx has a DataGrid which whose datasource is MyDataTable (or
technically it's private accessor but that I don't think is an issue here)



MyMainWebPage creates a DataTable dt . I then do a
"MyUserControl.MyDataTable = dt"



In order for the data to appear in the user control grid I must do the
"MyUserControl.MyDataTable = dt" in the Pre_Render of MyWebPage



I want to do this type of thing with a window form and windows user control.
Where in the windows form user control would I bind the datatable? If I do
it in the user controls page_load it does show the data in the datagrid?



Thank you,



Richard

Author
31 Mar 2005 9:42 PM
Bob Powell [MVP]
Page load or even constructor after the initializecomponent call will be
fine.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tipstricks.htm

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/faqmain.htm

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





Show quoteHide quote
"Richard" <a@b.com> wrote in message
news:U8Z2e.45959$rB3.8748817@twister.nyc.rr.com...
> Hello
>
>
>
> MyMainWebPage.aspx contains MyUserControl.ascx
>
>
>
> MyUserControl.ascx has a DataTable Property MyDataTable
>
>
>
> MyUserControl.ascx has a DataGrid which whose datasource is MyDataTable
> (or
> technically it's private accessor but that I don't think is an issue here)
>
>
>
> MyMainWebPage creates a DataTable dt . I then do a
> "MyUserControl.MyDataTable = dt"
>
>
>
> In order for the data to appear in the user control grid I must do the
> "MyUserControl.MyDataTable = dt" in the Pre_Render of MyWebPage
>
>
>
> I want to do this type of thing with a window form and windows user
> control.
> Where in the windows form user control would I bind the datatable? If I do
> it in the user controls page_load it does show the data in the datagrid?
>
>
>
> Thank you,
>
>
>
> Richard
>
>