473,773 Members | 2,345 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

Hello

MyMainWebPage.a spx contains MyUserControl.a scx

MyUserControl.a scx has a DataTable Property MyDataTable

MyUserControl.a scx 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
Nov 17 '05 #1
1 1880
Page load or even constructor after the initializecompo nent 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.

"Richard" <a@b.com> wrote in message
news:U8******** *************@t wister.nyc.rr.c om...
Hello

MyMainWebPage.a spx contains MyUserControl.a scx

MyUserControl.a scx has a DataTable Property MyDataTable

MyUserControl.a scx 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

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
370
by: dickson.matt | last post by:
OK, I have created a user control that contains a dropdown for office locations. Here is the code.... Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load 'Put user code to initialize the page here If Not Page.IsPostBack Then
0
2314
by: Tim Haughton | last post by:
I've just released an article on using Test Driven Development with C# and Windows Forms. GUI's are often difficult to test, so I thought it might be of interest. The article along with the example source code can be downloaded here: http://www.blogitek.com/timhaughton/archives/files/User%20Interrogator%20And%20TDD.zip The article text is below. Not sure what it will do to the formatting when
5
11363
by: Dave | last post by:
How do I check in a Windows Forms app if any controls have changed? I have a form that collects data, and I want to prompt the user if they try to exit the app, or load a new file, without saving changes that have been made. In MFC/Win32, you'd trap the WM_COMMAND/EN_CHANGE notification messages, etc. But, this doesn't seem to happen in Windows Forms. I tried Spy-ing a windows forms app, and the WM_COMMAND messages don't even get sent...
0
1168
by: Not Available | last post by:
I have windows form user control which I load into the browser via this ascx web user control and it works. The process is explained at this link: http://www.codeproject.com/cs/miscctrl/htmlwincontrol.asp Instead of loading the windows form user control I'm trying to load a windows form directly into the web control using the same method, meaning basically replacing in the code below OrderEntry.DLL with OrderEntry.exe Is this possible?...
1
1101
by: serge calderara | last post by:
Dear all, I have created a simple user control (server Button) with a public property define has follow: Public Property value() As Integer Get 'return value Return ViewState("Value") End Get
1
1119
by: Richard | last post by:
Hello MyMainWebPage.aspx contains MyUserControl.ascx MyUserControl.ascx has a DataTable Property MyDataTable
3
13612
by: anadimpa | last post by:
Hello all I build a javascript function string in the code behind and register it in the Page_Load of my User Control. I do this because I build the javascript based on some variables that are passed to this user control. How do I (or from where do I) call this function? I tried several ways like: this.Attributes.Add("onLoad", "javascript:openDoc();"); in the page_load / page_prerender etc...
21
3385
by: Dan Tallent | last post by:
In my application I have a form (Customer) that I want to be able to open multiple copies at once. Within this form I have other forms that can be opened. Example: ZipCode. When the user enters a zipcode that is unknown this form will open. I don't want users to modify any of this customers data until they close the zipcode form. Normally this can accomplished using a modal form, however this prevents me from opening a new copy of...
0
10264
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10039
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8937
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7463
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6717
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5355
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5484
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4012
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2852
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.