Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 06-29-2005, 11:27 AM
DJK DJK is offline
Senior Member
 
Join Date: Aug 2002
Posts: 1,379
Default Column Click

I asked this before but never got a fully working answer

How can I determine what column I click in a grid when I use rowselect ?
Reply With Quote
  #2  
Old 06-29-2005, 11:35 AM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: Column Click

What are you using for a control, that has an OnRowSelect Event?



If this helps, please accept as answer!

UnSysApps
Reply With Quote
  #3  
Old 06-29-2005, 11:55 AM
DJK DJK is offline
Senior Member
 
Join Date: Aug 2002
Posts: 1,379
Default RE: Column Click

a SMDBGrid, but for the purpose of the question, this behaves the same as a DBGrid.

So that when you click a cell it selects the entire row in the grid...
Reply With Quote
  #4  
Old 06-29-2005, 12:01 PM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: Column Click

Right, my concern was whether or not there was a OnRowSelect event in your control, because there is not in a Standard TDBGrid. So, is there, if not, what events are there in that grid?



If this helps, please accept as answer!

UnSysApps
Reply With Quote
  #5  
Old 06-29-2005, 12:05 PM
DJK DJK is offline
Senior Member
 
Join Date: Aug 2002
Posts: 1,379
Default RE: Column Click

Now I understand what you mean Sorry if I mentioned it confusing Its not a event, it's a property, and one which the default grid also has, in the options section: rowselect...

Again sorry if I sounded confusing!

I just meant I use that option as for my problem it makes a world of difference..
Reply With Quote
  #6  
Old 06-29-2005, 12:05 PM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: Column Click

it looks like the OnCellClick event gives you the column



If this helps, please accept as answer!

UnSysApps
Reply With Quote
  #7  
Old 06-29-2005, 12:07 PM
DJK DJK is offline
Senior Member
 
Join Date: Aug 2002
Posts: 1,379
Default RE: Column Click

Hey

Yes it does, IF you do NOT use rowselect
Cause if you do cellclick doesn't register correctly...
Reply With Quote
  #8  
Old 06-29-2005, 01:08 PM
mshkolnik mshkolnik is offline
Senior Member
 
Join Date: Jul 2001
Posts: 4,195
Default RE: Column Click

Use the OnMouseDown (or OnMouseUp) event and convert the X/Y coordinates to cell corrdinates (row/column)

No other way.

With best regards, Mike Shkolnik
http://www.scalabium.com
Reply With Quote
  #9  
Old 06-29-2005, 04:08 PM
jamiguel77 jamiguel77 is offline
Senior Member
 
Join Date: Jan 2002
Posts: 1,171
Send a message via MSN to jamiguel77 Send a message via Yahoo to jamiguel77
Default RE: Column Click

easy...
i use in sometimes

procedure TFasist.stggMouseUp(Sender: TObject; Button: TMouseButton;
Shift: TShiftState; X, Y: Integer);
var
ACol, ARow: Integer;
begin
stgg.MouseToCell(x, y, ACOl, ARow);
if Arow <= stgg.Fixedrows-1 then
begin
// clicked on a fixed column.....
end;
end;



note i recomend you download nextgrid:

www.bergsoft.net no include code but is a powerfull is freeware too have a good forum:
http://forum.bergsoft.net/

thanks

accept if help you
Reply With Quote
  #10  
Old 06-30-2005, 03:10 AM
DJK DJK is offline
Senior Member
 
Join Date: Aug 2002
Posts: 1,379
Default RE: Column Click

That grid looks good, but only the nextgrid is free... the DB aware grid is payment only
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 11:18 AM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2018, vBulletin Solutions, Inc.