Results 1 to 2 of 2

Thread: Getting DataGrid Column Name

  1. #1

    Thread Starter
    Fanatic Member VBCrazyCoder's Avatar
    Join Date
    Apr 2003
    Posts
    681

    Getting DataGrid Column Name

    How can I get the Column Name from a datagrid when a cell is selected. I have the column number of the selected cell and I have been trying to do something like:
    VB Code:
    1. myGrid.Column(selectedCell.ColumnNumber).Name
    I know this code is invalid, but it illustrates what I am trying to do. Anyone do this before?

  2. #2
    Frenzied Member
    Join Date
    Oct 2002
    Location
    Gammapolis
    Posts
    1,474
    I can think of two ways.
    First refering to the datagrid datasource and second in case of using tablestyles refering to DatagridColumnStyle of GirdColumnStyles collection.
    Last edited by Lunatic3; Jul 17th, 2003 at 05:05 PM.
    'Heading for the automatic overload'
    Marillion, Brave, The Great Escape, 1994

    'How will WE stand the FIRE TOMORROW?'
    Eloy, Silent Cries and Mighty Echoes, The Vision - Burning, 1979

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width