Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting coulmn titles...

Status
Not open for further replies.

RMG

MIS
Jun 12, 2000
26
MX
I'd like to know the code that can display me a message box telling me the name of the column i just clicked on a dbgrid. For instance, on a dbgrid with 3 columns &quot;First Name&quot;, &quot;Initial&quot;, &quot;Last Name&quot;, if i click on the title for &quot;Initial&quot; i'd like a message box that displays &quot;Initial&quot;, and so on. I managed to find:<br>&quot;dbgrid1.Columns.Grid.SelectedField.FieldName&quot; but it only returns the title of the focused field, not the title of the column i clicked. Thanks in advance.<br><br>
 
<br>Grid.OnTitleClick:= BrwTitleClick;<br><br>procedure TDBBrowser.BrwTitleClick(Column: TColumn);<br>begin<br>&nbsp;&nbsp;MessageDlg(Column.FieldName, mtInformation, [mbOk], 0);<br>end;<br><br>Bye, Otto.<br>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top