Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » [SOLVED] GridCtrl: how to get row and column of the clicked cell
[SOLVED] GridCtrl: how to get row and column of the clicked cell [message #60617] Mon, 03 June 2024 19:03 Go to next message
forlano is currently offline  forlano
Messages: 1207
Registered: March 2006
Location: Italy
Senior Contributor
Hello,

it should be easy but I cannot find the correct way. After grid.WhenLeftClick I do

void TournamentTiebreakDlg::SetTB()
{  int row = grid.GetCurrentRow();
   if (row<0) return;
   int col = grid.GetColumn(row).GetNumber();
   Exclamation( AsString(row) + " " + AsString(col));
}


but the program does not show the clicked column. What it the right method?
Thanks,
Luigi

[Updated on: Tue, 04 June 2024 06:50]

Report message to a moderator

Re: [SOLVED] GridCtrl: how to get row and column of the clicked cell [message #60618 is a reply to message #60617] Tue, 04 June 2024 06:51 Go to previous message
forlano is currently offline  forlano
Messages: 1207
Registered: March 2006
Location: Italy
Senior Contributor
This is how to to get the column

int col = grid.GetColumn().GetNumber();

Luigi
Previous Topic: How can I set an image in GridCtrl cell ?
Next Topic: GridCtrl: how to center Option?
Goto Forum:
  


Current Time: Sun Jun 15 19:25:36 CEST 2025

Total time taken to generate the page: 0.04967 seconds