Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How to understand which row clicked with TIWDBGrid?


This question is not answered. Helpful answers available: 2. Correct answers available: 1.


Permlink Replies: 6 - Last Post: Dec 29, 2015 2:54 PM Last Post By: Dan Barclay
Ertan Kucukoglu

Posts: 49
Registered: 7/4/09
How to understand which row clicked with TIWDBGrid?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 20, 2015 12:40 PM
Hope that I can explain in a way that my problem is clear to all readers.

I want like to code a search screen for any given query.

I found that TIWDBGrid lists records as a table. However, we cannot select cells/rows (aka records) like we can in a regular TDBGrid. Normally, I would get selected record and its values from a TDBGrid, is there a way to do that with TIWDBGrid? Or, with some other component?

Thanks.

Regards,
Ertan Küçükoğlu
Eitan Arbel

Posts: 508
Registered: 2/24/13
Re: How to understand which row clicked with TIWDBGrid?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 26, 2015 7:11 PM   in response to: Ertan Kucukoglu in response to: Ertan Kucukoglu
Hi Ertan

The TIWDBGrid is a TMS component, so i think it would be best if you ask that in TMS's forum in this address :
http://www.tmssoftware.com/site/forum/default.asp?C=5&title=intraweb-components

i don't use the TIWDBGrid, so i'm sorry i can't help.

in any case, and for future questions, Embarcadero proved too many times that their forum system is unreliable, so i think it would be best if you would ask your questions in AToZed's news group, in this address :
news.atozed.com

to use the news group, you can use Mozilla Thunderbird :
https://www.mozilla.org/en-US/thunderbird

Have fun :)
Ertan Kucukoglu

Posts: 49
Registered: 7/4/09
Re: How to understand which row clicked with TIWDBGrid?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 27, 2015 12:49 AM   in response to: Eitan Arbel in response to: Eitan Arbel
Eitan Arbel wrote:
The TIWDBGrid is a TMS component,

Actually TIWDBAdvWebGrid and TDbAdvGrid are TMS components. TIWDBGrid is part of Intraweb.
Eitan Arbel

Posts: 508
Registered: 2/24/13
Re: How to understand which row clicked with TIWDBGrid?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 27, 2015 2:04 AM   in response to: Ertan Kucukoglu in response to: Ertan Kucukoglu
Actually TIWDBAdvWebGrid and TDbAdvGrid are TMS components. TIWDBGrid is part of Intraweb.

oops... you're right, sorry :)

i think i would use a hidden field in the grid, and fill it with the Record's ID field.

hope that helps :)
Daniel Fields

Posts: 622
Registered: 11/29/04
Re: How to understand which row clicked with TIWDBGrid?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 28, 2015 12:55 PM   in response to: Ertan Kucukoglu in response to: Ertan Kucukoglu
Did you still need help with this? There are properties that control the grid behavior. You can do exactly what you are seeking with that control.

Set the grid's MouseSelect to msMove. That will advance the underlying dataset to the selected row. You can also set AsyncActiveRowMove to true if you want async performance.
Ertan Kucukoglu

Posts: 49
Registered: 7/4/09
Re: How to understand which row clicked with TIWDBGrid?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 29, 2015 2:12 PM   in response to: Daniel Fields in response to: Daniel Fields
Daniel Fields wrote:
Did you still need help with this? There are properties that control the grid behavior. You can do exactly what you are seeking with that control.

Set the grid's MouseSelect to msMove. That will advance the underlying dataset to the selected row. You can also set AsyncActiveRowMove to true if you want async performance.

Yes, I still need help with this.

I couldn't find these options in Intraweb default grid component. So, I think above apply to TMS grid. Unfortunately, I don't have that package.

Thanks anyway.
Dan Barclay

Posts: 889
Registered: 11/9/03
Re: How to understand which row clicked with TIWDBGrid?  
Click to report abuse...   Click to reply to this thread Reply
  Posted: Dec 29, 2015 2:50 PM   in response to: Ertan Kucukoglu in response to: Ertan Kucukoglu
Ertan Kucukoglu wrote:
Daniel Fields wrote:
Did you still need help with this? There are properties that control the grid behavior. You can do exactly what you are seeking with that control.

Set the grid's MouseSelect to msMove. That will advance the underlying dataset to the selected row. You can also set AsyncActiveRowMove to true if you want async performance.

Yes, I still need help with this.

I couldn't find these options in Intraweb default grid component. So, I think above apply to TMS grid. Unfortunately, I don't have that package.
I needed to do something similar a while back. I don't have code to show, but it involved placing another (clickable/selectable) control on a cell in one of the columns.

In the RenderCell event, add a control to the ACell.Control. Maybe in your case use a button (I was using radio buttons and checkboxes). Assign a value to a .Tag to keep up with the row.

I didn't invent that process, I found it with a search. It went something like this:

if AColumn=0 then
begin 
  ACell.Control:=TIWCheckBox.Create(self)
  with TIWCheckBox(ACell.Control)
     Tag:=something
     OnAsyncSomething:=YourEvent
     SubmitOnQAsyncEvent:=true
     Caption=ACell.text
     ACell.Text=something
  end
end


You'll need to play with that, and fill in the Somethings. Maybe use some other clickable control.

.
Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02