473,399 Members | 4,192 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

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.Tables["Contacts"].Rows.Count)
{
SignatureControl.SignatureControl sig1 =
new SignatureControl.SignatureControl();
Point p1 = new Point(dgSignIn.GetCellBounds(i,3).X,dgSignIn.GetCe llBounds(i,3).Y);//,dgSignIn.GetCellBounds(i,0).Y);
MessageBox.Show(this,p1.ToString());
sig1.Location = p1;
this.Controls.Add(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 9465
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/vbtskcodeupdatingitemsindatagridordatalistwebcontr olvisualbasic.asp

Telmo Sampaio
"Tolga" <to**********@hotmail.com> wrote in message
news:f6**************************@posting.google.c om...
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.Tables["Contacts"].Rows.Count)
{
SignatureControl.SignatureControl sig1 =
new SignatureControl.SignatureControl();
Point p1 = new Point(dgSignIn.GetCellBounds(i,3).X,dgSignIn.GetCe llBounds(i,3).Y);//,dgSign
In.GetCellBounds(i,0).Y); MessageBox.Show(this,p1.ToString());
sig1.Location = p1;
this.Controls.Add(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**************@TK2MSFTNGP10.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/vbtskcodeupdatingitemsindatagridordatalistwebcontr olvisualbasic.asp

Telmo Sampaio
"Tolga" <to**********@hotmail.com> wrote in message
news:f6**************************@posting.google.c om...
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.Tables["Contacts"].Rows.Count)
{
SignatureControl.SignatureControl sig1 =
new SignatureControl.SignatureControl();
Point p1 = new

Point(dgSignIn.GetCellBounds(i,3).X,dgSignIn.GetCe llBounds(i,3).Y);//,dgSign In.GetCellBounds(i,0).Y);
MessageBox.Show(this,p1.ToString());
sig1.Location = p1;
this.Controls.Add(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
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...
1
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...
2
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...
1
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...
20
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...
0
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...
1
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. ...
13
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...
2
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
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...
0
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...
0
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...

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.