Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Windows Forms / WinForm General / February 2007

Tip: Looking for answers? Try searching our database.

Help need with cell click on DataGridView and C# 2005?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Saravanan - 08 Feb 2007 06:46 GMT
Hi,

I am using DataGridview in my application. In that i am able to display
images. when i click the any cell of the datagrid i wanted to open a new
Frameless window(which contains some checkboxes and lables) on top of that
cell. but i am not able to display that form on top of that cell. i am using
the code like this

Point aPoint = dataGridview1.GetCellDisplayRectangle(e.ColumnIndex,
e.RowIndex, true).Location;
           aForm = new Form();
          // aForm.Location = new Point(600,200);
           aForm.StartPosition = FormStartPosition.CenterParent;
           aForm.Location = new Point(dataGridview1.Location.X + aPoint.X ,
aPoint.Y);
           aForm.Size = new Size(115, 54);
           aForm.ControlBox = false;
           aForm.FormBorderStyle = FormBorderStyle.None;
           aForm.BackColor = Color.Blue;
           aForm.TopMost = true;
           aForm.Deactivate += new EventHandler(aForm_Deactivate);
           aForm.AutoSizeMode = AutoSizeMode.GrowAndShrink;

Can u please tell me how to display that frameless dialog on top of that
cell, i am not able to display the form on top.. it is displaying some where..

Thanks in advance
ClayB - 08 Feb 2007 09:09 GMT
I think this code will position a form over the currentcell.

       DataGridViewCell cc = this.dataGridView1.CurrentCell;

       Point pt =
this.dataGridView1.GetCellDisplayRectangle(cc.ColumnIndex,
cc.RowIndex, true).Location;
       pt = dataGridView1.PointToScreen(pt);
       Form f = new Form();
       f.StartPosition = FormStartPosition.Manual;
       f.Location = pt;
       f.Size = new Size(cc.OwningColumn.Width, cc.OwningRow.Height);
       f.Show();

======================
Clay Burch
Syncfusion, Inc.

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.