Click here to Skip to main content
15,922,325 members
Home / Discussions / C#
   

C#

 
GeneralRe: How to create a line shapefile Pin
v17.poornima31-Mar-10 3:24
v17.poornima31-Mar-10 3:24 
GeneralRe: How to create a line shapefile Pin
Richard MacCutchan31-Mar-10 3:37
mveRichard MacCutchan31-Mar-10 3:37 
QuestionTo draw on map control Pin
v17.poornima30-Mar-10 6:37
v17.poornima30-Mar-10 6:37 
AnswerRe: To draw on map control Pin
OriginalGriff30-Mar-10 8:22
mveOriginalGriff30-Mar-10 8:22 
GeneralRe: To draw on map control Pin
v17.poornima31-Mar-10 3:23
v17.poornima31-Mar-10 3:23 
QuestionDatagridview cell position (.Net 2008). Pin
priyamtheone30-Mar-10 6:15
priyamtheone30-Mar-10 6:15 
AnswerRe: Datagridview cell position (.Net 2008). Pin
dan!sh 30-Mar-10 6:50
professional dan!sh 30-Mar-10 6:50 
AnswerRe: Datagridview cell position (.Net 2008). Pin
priyamtheone15-Apr-10 6:39
priyamtheone15-Apr-10 6:39 
Here's a solution I came up to.
I am opening a dialog form above the datagridview form. In Form1 I have a datagridview containing few columns among which is 'TransDate' column having index 8. When I click on it, frmDate opens up exactly on it. My revised code follows:

Private Sub DataGridView1_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DataGridview1.CellClick
    If DataGridview1.CurrentCell.OwningColumn.Name = "TransDate" Then
        Dim objPoint As Point

        'Getting the exact location of the cell with respect to Form1.
        'Note- Me.Location is added here alongwith DataGridView1.Location and
        'DataGridView1.GetDisplayRectangle().Location.
        'This is done because the form frmDate we are calling is external to Form1 and if we don't add
        'Me.Location
        'here, frmDate won't open exactly at the desired point if we move or resize Form1. Instead of
        'frmDate if we use any control inside Form1 to place over 'TransDate' column then remove
        'Me.Location here and the next two lines.
        objPoint = (Me.Location + DataGridview1.Location + DataGridview1.GetCellDisplayRectangle(8,
        DataGridview1.CurrentCellAddress.Y, True).Location)

        'Setting the exact location where frmDate will be opened. The last digits may vary according to
        'your requirement.
        objPoint.X = objPoint.X - 158
        objPoint.Y = objPoint.Y + 28
            
        objFrmDate = New frmDate()
        objFrmDate.Location = objPoint
        objFrmDate.ShowDialog(Me)
        objFrmDate = Nothing
    End If
End Sub


Regards.
AnswerRe: Datagridview cell position (.Net 2008). [modified] Pin
Wajid.k20-May-10 5:22
Wajid.k20-May-10 5:22 
QuestionAuto scaling of controls in a form (.Net 2008). Pin
priyamtheone30-Mar-10 6:14
priyamtheone30-Mar-10 6:14 
AnswerRe: Auto scaling of controls in a form (.Net 2008). Pin
Luc Pattyn30-Mar-10 6:48
sitebuilderLuc Pattyn30-Mar-10 6:48 
AnswerRe: Auto scaling of controls in a form (.Net 2008). Pin
priyamtheone15-Apr-10 6:41
priyamtheone15-Apr-10 6:41 
QuestionEntity Framework Pin
NETLearning30-Mar-10 6:04
NETLearning30-Mar-10 6:04 
AnswerRe: Entity Framework Pin
Not Active30-Mar-10 6:13
mentorNot Active30-Mar-10 6:13 
GeneralRe: Entity Framework Pin
NETLearning30-Mar-10 6:21
NETLearning30-Mar-10 6:21 
GeneralRe: Entity Framework Pin
Not Active30-Mar-10 6:49
mentorNot Active30-Mar-10 6:49 
GeneralRe: Entity Framework Pin
NETLearning30-Mar-10 6:59
NETLearning30-Mar-10 6:59 
AnswerRe: Entity Framework Pin
Luc Pattyn30-Mar-10 7:55
sitebuilderLuc Pattyn30-Mar-10 7:55 
QuestionCrystal Reports WinForms Problem. Pin
Kevin Marois30-Mar-10 5:41
professionalKevin Marois30-Mar-10 5:41 
AnswerRe: Crystal Reports WinForms Problem. Pin
Abhinav S30-Mar-10 5:44
Abhinav S30-Mar-10 5:44 
GeneralRe: Crystal Reports WinForms Problem. Pin
Kevin Marois30-Mar-10 6:25
professionalKevin Marois30-Mar-10 6:25 
Questionc# code required Pin
nachiket dave30-Mar-10 5:35
nachiket dave30-Mar-10 5:35 
AnswerRe: c# code required Pin
Kevin Marois30-Mar-10 5:40
professionalKevin Marois30-Mar-10 5:40 
GeneralRe: c# code required Pin
Rob Philpott30-Mar-10 5:49
Rob Philpott30-Mar-10 5:49 
GeneralRe: c# code required Pin
Kevin Marois30-Mar-10 6:24
professionalKevin Marois30-Mar-10 6:24 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.