473,788 Members | 2,867 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 21 '05 #1
1 1119
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 21 '05 #2

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

Similar topics

0
1014
by: Amir Eshterayeh | last post by:
Dear Friends Hope things goes well to you. I have this problem. Would you please give me your solution? I want to change a property that I define on my user control in my web form that contains that user control. but when I want to set the property of user control at my web form, got this error c:\inetpub\wwwroot\test4\WebForm1.aspx.vb(19): Name 'Uc1' is not declared. How can I solve this problem. Please help.
0
888
by: Ewok | last post by:
Im having trouble getting the values of form fields when the form is in an included user control form01.ascx is loaded via loadcontrol in a select case statement in the main page and everything is fine until I submit. When I try to output the value of the fields like... fname.text.. it is just blank (but the value is still in the box) same thing with any fields on the form. the form retains all info and selections but I just cant access...
1
1881
by: Richard | last post by:
Hello MyMainWebPage.aspx contains MyUserControl.ascx MyUserControl.ascx has a DataTable Property MyDataTable
0
1012
by: Nick Lewis | last post by:
I'm trying to process an event raised by a user control in the web form that contains that control. I've fathomed out how to handle the event within the control but how can I then pass it on to the parent web form? Thanks, Nick
3
1283
by: Celine | last post by:
Hi, I am just starting developping in ASP.Net and I have some trouble using a user control in a web form. In my user control I have a datagrid with hyperlink and in my web page I want to display the hyperlink that the user click in my user control. Does anyone know how to do this?
2
1101
by: Christian Ista | last post by:
Hello, I have a usercontrol on page, this one is place on a panel. On the page there is some others panel and controls on it. I'd like from the user control use a another control on the form. For example, I have a panel, with a Label to display the error message generated by the user control. Could you tell me how to do that ?
4
1743
by: Charles Law | last post by:
Can anyone think how I could get a user control to host a Windows form? In fact, what I actually want to do is have a docked toolwindow within a user control, along with another user control. The reason I want to do this is because I am creating an add-in for the VS IDE, and when creating a toolwindow for an add-in it needs to be a control hosted in a shim ActiveX control ... or that is what I have found. If anyone has an alternative...
0
1083
by: Sharat Koya | last post by:
Hi, I have a user control that pops up much like intelisense in visual studio to display a range of navigable options when a key combo is pressed within a textbox. I have called the user control within the parent form and programmatically called it using the following code within the parent form. MyUserControl control1 = new MyUserControl; control1.BorderStyle = BorderStyle.FixedSingle; this.Controls.Add(control1);
5
1837
by: Guy Noir | last post by:
I have a quick question on custom controls. I have a control that I created with a class that extends the NumericUpDown control. My problem is that when I use this usercontrol on my form, the click event gets handled by the user class. I want the event to be passed to the Windows form (not the user control). So I am guessing that I need to raise an event from the user control
4
1821
by: Mrozu | last post by:
Hi, i've got an inherited usercontrol with added DataGridView. I plant my control on form and I want to hide datagridview when user click on that form. I've tried to use LostFocus and Leave. It works great, when focus is set to other control on form, but not fired on form.Click.
0
9656
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10366
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...
0
9967
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8993
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
7517
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
6750
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
5399
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...
1
4070
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
2
3674
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.