473,804 Members | 2,146 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

How to Insert User Control into DataGrid Cell

How do insert a user control i have created into a datagrid cell.
Basically i am trying to create a column of my user controls. This is
what i have tried so far.
int i = 0;
while (i < dsSignIn1.Table s["Contacts"].Rows.Count)
{
SignatureContro l.SignatureCont rol sig1 =
new SignatureContro l.SignatureCont rol();
Point p1 = new Point(dgSignIn. GetCellBounds(i ,3).X,dgSignIn. GetCellBounds(i ,3).Y);//,dgSignIn.GetCe llBounds(i,0).Y );
MessageBox.Show (this,p1.ToStri ng());
sig1.Location = p1;
this.Controls.A dd(sig1);
i++;
}

I get the cooulmn of the user controls but they show up on the form
behind the datagrid.

How can i get them on the datagrid?
Nov 16 '05 #1
2 9486
I have not done this before, but I remeber seeing that you can add a control
to a Datagrid cell by addin it to the Controls collection of the cell. You
are adding it to the Controls collection of the form now, just positioning
it at the same place as your cell.

Here is a related link used for updating values in a web datagrid:
http://msdn.microsoft.com/library/de...us/dv_vbcode/h
tml/vbtskcodeupdati ngitemsindatagr idordatalistweb controlvisualba sic.asp

Telmo Sampaio
"Tolga" <to**********@h otmail.com> wrote in message
news:f6******** *************** ***@posting.goo gle.com...
How do insert a user control i have created into a datagrid cell.
Basically i am trying to create a column of my user controls. This is
what i have tried so far.
int i = 0;
while (i < dsSignIn1.Table s["Contacts"].Rows.Count)
{
SignatureContro l.SignatureCont rol sig1 =
new SignatureContro l.SignatureCont rol();
Point p1 = new Point(dgSignIn. GetCellBounds(i ,3).X,dgSignIn. GetCellBounds(i ,3).Y);//,dgSign
In.GetCellBound s(i,0).Y); MessageBox.Show (this,p1.ToStri ng());
sig1.Location = p1;
this.Controls.A dd(sig1);
i++;
}

I get the cooulmn of the user controls but they show up on the form
behind the datagrid.

How can i get them on the datagrid?

Nov 16 '05 #2
Ignore it. It is only for updating web datagrids...
sorry!
"Telmo Sampaio" <ts******@gmail .com> wrote in message
news:uj******** ******@TK2MSFTN GP10.phx.gbl...
I have not done this before, but I remeber seeing that you can add a control to a Datagrid cell by addin it to the Controls collection of the cell. You
are adding it to the Controls collection of the form now, just positioning
it at the same place as your cell.

Here is a related link used for updating values in a web datagrid:
http://msdn.microsoft.com/library/de...us/dv_vbcode/h tml/vbtskcodeupdati ngitemsindatagr idordatalistweb controlvisualba sic.asp

Telmo Sampaio
"Tolga" <to**********@h otmail.com> wrote in message
news:f6******** *************** ***@posting.goo gle.com...
How do insert a user control i have created into a datagrid cell.
Basically i am trying to create a column of my user controls. This is
what i have tried so far.
int i = 0;
while (i < dsSignIn1.Table s["Contacts"].Rows.Count)
{
SignatureContro l.SignatureCont rol sig1 =
new SignatureContro l.SignatureCont rol();
Point p1 = new

Point(dgSignIn. GetCellBounds(i ,3).X,dgSignIn. GetCellBounds(i ,3).Y);//,dgSign In.GetCellBound s(i,0).Y);
MessageBox.Show (this,p1.ToStri ng());
sig1.Location = p1;
this.Controls.A dd(sig1);
i++;
}

I get the cooulmn of the user controls but they show up on the form
behind the datagrid.

How can i get them on the datagrid?


Nov 16 '05 #3

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

Similar topics

3
2040
by: Billy Jacobs | last post by:
I have created a DataGridColumnDatePicker Component so that I can put a datetimepicker control in my datagrid. It almost works. When I put my mouse in the cell it changes to a datetimepicker control. I can then select a date which displays in the cell. When I leave the cell however I get the following error:
1
4645
by: VM | last post by:
Is it possible for the bound data in a web datagrid to be displayed in links? The grid will show the client's first name and last name and, when the user clicks on the first or last name, I want to get the cell the user clicked (thus getting the client he chose), and take the user to another separate page that will show that client's complete information. It doesn't really have to be like that (there could be another extra column - as a...
2
1511
by: moondaddy | last post by:
My default page stays constant in the site and all the content in the body of the page is produced with user controls in a table cell for the body section. The main function of this site is a products catalogue and the products show in a datagrid in one of the user controls. This datagrid has many rows and columns of images and this is what I'm most interested in caching. If I put <%@ OutputCache Duration="500" VaryByParam="MenuID"...
1
1512
by: Don | last post by:
I created a Web User Control in my project and need to use it in a datagrid. The data in this control needs to be updated and the control has several properties that need to be databound. Using the designer I created a a dataGrid with an Edit, Update, Cancel column, and an empty template column. I have overridden ItemDataBound to instantiate my control, set the properties using DataItems, and add this control to the template column...
20
5666
by: Guadala Harry | last post by:
In an ASCX, I have a Literal control into which I inject a at runtime. litInjectedContent.Text = dataClass.GetHTMLSnippetFromDB(someID); This works great as long as the contains just client-side HTML, CSS, etc. What I want to do is somehow insert a *server control* into the , then set the server control's properties at runtime.
0
1528
by: Eustice Scrubb | last post by:
In line coding problem. Here's my code: <script language="VB" runat="server"> Dim myConnection As SqlConnection Sub Page_Load(Src As Object, e As EventArgs) ' Create a connection to the SQL Server myConnection = New SqlConnection("Data Source=SERVER;" _ & "Initial Catalog=database;User Id=user;Password=password;")
1
1422
by: conckrish | last post by:
Hi all.. Can anyone tell me how to load a web user control into a DataGrid cell at runtime?? And also i need to load different user controls at each Datagrid cell??? Thanx in advance. Krishnan.
13
2463
by: shookim | last post by:
I don't care how one suggests I do it, but I've been searching for days on how to implement this concept. I'm trying to use some kind of grid control (doesn't have to be a grid control, whatever works best) to display a dropdown menu of fields populated from table tblInvoiceData. This control also includes a textbox which the user can input a value. These two columns are side by side and not in a vertical layout. The user then clicks on...
2
2226
by: jock1up | last post by:
I am working with editing within a DataGrid control cell and am confused about which events occur after the editing is completed. I see that 5 events can occur total, including the ones below and AfterColEdit, AfterUpdate. 1. BeforeColUpdate/ 2. AfterColUpdate/ 3. BeforeUpdate or all of these occur? 1. BeforeColUpdate says after editing is completed in a cell, but before dates is moved from the cell to the DataGrid control's copy...
0
9595
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10603
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
10353
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10099
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...
1
7643
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
6869
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
5675
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4314
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
3003
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.