get the value of a cell in the selected row in a grid?

How to get the value of a cell in the selected row in a grid?

Ex: Say i have some customer details in the grid and say i select the 3rd row.I want to retrieve customer account number of the selected row.How can this be done?I want to do this at the form level and not on the datasource level.

Please advice.

in which form do yo want to copy the grid from?

Hi Prashob,

On what action u need to retrieve it??

u can write a simple select query accordingly.

Hi Prashob,

If you have DS.

You can get value in

DS-> Active() method.


try this you can get it…


I need the account number on the Form level on clicked method of a button.I tried the datasource method mentioned by sunil but it doesnt quite suite the requirement as active event fires everytime i select a new row.

i want to select a row->click a button on the button group ->it should give me the customerAccount number.

Please advice.

Hi Prashob,

If it is the button control,to capture selected record ,

Add check box over there,then mark the checkbox when you click the button override the clicked method and write the select query basing on the marked check box…you get the table buffer…so can get the accountnum

If using the menuitembutton,then need to added the menuitemtype(display),menuitemname(Ex: CustomerAccountForm),datasource(i.e the custtable) for the menuitembutton properties…

In the CustomerAccountForm – init method…you will get the record of the cusotmer so it can be displayed…

Naresh Kolli

Hi ,

You can directly use the code CustTable.AccountNum to retrieve the customer account number of selected record ,anywhere on the form .


Hii Sunil

Can you Please tell me how to get the Selected Records Field Value through Button Click.

Thank You