The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
|
|
Get Datagrid Rows values
Posted: 13 Jun 11 9:19 AM
|
fiogf49gjkf0d Hi All!
Could someone explain to me how can i get the datagrid row count and the values of the cells?
I remember in Vb6 that is something like
<p>datagrid.row =1 datagrid.cell(0).value
</p>
I tried the datagrid.nodes.items(0).values but dont work..
thanks all! |
|
|
| |
|
Re: Get Datagrid Rows values
Posted: 13 Jun 11 9:42 AM
|
fiogf49gjkf0d Thanks Mike!
And about to get the cell values?
Example:
I want to know the value of the 1 cell of the secont row.... can i do this?
thanks! |
|
|
|
Re: Get Datagrid Rows values
Posted: 13 Jun 11 9:50 AM
|
fiogf49gjkf0d The grid's recordset is simply an ADO recordset. So, you can work through it as normal objRS = dgName.RecordSet and then objRS.Fields("NAME").Value for example.
If you want to know the highlighted value that's easier:
dgName.GetCurrentField("yourFieldNameAlias") |
|
|
|
Re: Get Datagrid Rows values
Posted: 13 Jun 11 9:53 AM
|
fiogf49gjkf0d Thanks Mike,
But my problem is: i have a datagrid that i have to get the values of the 1 and the 3 cells of some rows...
but i cant get these values...
thanks! |
|
|
| |
|
Re: Get Datagrid Rows values
Posted: 13 Jun 11 10:09 AM
|
fiogf49gjkf0d I dont know how...
my difficult is how to get the 2 cell of the 2 row... something like this..
|
|
|
|
Re: Get Datagrid Rows values
Posted: 13 Jun 11 10:20 AM
|
fiogf49gjkf0d Yes, and I can't tell you how with such a loosely defined question. There is no such thing as cell 2 of 2nd row. You need to iterate through the recordset and then, once landed on the right row, get the cell/column data. |
|
|
|
Re: Get Datagrid Rows values
Posted: 13 Jun 11 10:24 AM
|
fiogf49gjkf0d Hi Mike!!
sorry for the noob question....rs...
i found what i need..
datagrid.nodes(1).Values(3)
With this, i get the 3 cell of the 1 row...
and shazam! works!!
thanks Mike!
|
|
|
|
Re: Get Datagrid Rows values
Posted: 13 Jun 11 10:36 AM
|
fiogf49gjkf0d Mike, I think by Cell he means Node, and yes, you can get the value of Node (1) [the 2nd cell of a row].....Node(0) is the left most visible column. We go after Node values often when we use oncustomdraw event handler's for a grid. |
|
|
|
Re: Get Datagrid Rows values
Posted: 16 Mar 13 12:27 AM
|
fiogf49gjkf0d I have 2 data grid in a form. First one shows Master record. Second Grid supposed to populate member of the Master. To add the member of the master, highlight a row in Grid 1 and when I right click on Grid 2, the new window popup and should fillup with Master Number and Name from selected Grid 1 values.
Please help how to get the value of the selected row from Grid 1 to the new form
Thanks
|
|
|
|
Re: Get Datagrid Rows values
Posted: 16 Mar 13 4:08 AM
|
fiogf49gjkf0d
I select a grid, it does something, when I click somewhere else - it does something else - discuss.
Do you see the problem here? You are asking forum members to perform what appears to be a piece of actual work you've been asked to do - using theoretical models of what may/could/should happen.
It's not going to happen (hence why everyone else has ignored your other ramblings thus far).
Be more specific about what you have tried, what code is it that you need and what you actually want. Otherwise, the answer to your question is simply "yes - it can be done - using a variety of methods" depending on the purposes of what it is you are trying to achieve but given the specific background of the nature of what it is you are trying to do.
|
|
|
|
Re: Get Datagrid Rows values
Posted: 16 Mar 13 10:29 PM
|
fiogf49gjkf0d I am new to Saleslogix. All I need to do is capture the ID and name from the highlighted row from the master grid and fill it in second form.How do I do that?
Please help |
|
|
|
Re: Get Datagrid Rows values
Posted: 18 Mar 13 7:23 AM
|
fiogf49gjkf0d El evento se produce en el formulario principal, por lo tanto debes manejar los eventos ahi. Por otra parte, te recomiendo utilices variables globales para ir capturando el valor seleccionado de la grilla y mostrarlo en un segundo formulario. Saludos.
---
The event takes place on the main form, so you must handle the events there. Also, I recommend you use global variables to be capturing the selected value of the grid and display it in a second form. Greetings. |
|
|
|