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!
|
|
How to focus on a row in datagrid?
Posted: 16 Jan 09 3:00 PM
|
Hi , Is there any way to focus on a particular row in the datagrid of SalesLogix? Suppose, I have 10 rows and i am editing row# 4. I want this row selected after refreshing the grid.
Appreciate any help.
Thanks, Harendra |
|
|
|
Re: How to focus on a row in datagrid?
Posted: 16 Jan 09 3:58 PM
|
I have tried to set the 'Selected' property = True as follows.. datagrid1.Nodes(3).Selected = True 'row#4
BUT,it is not working
|
|
|
|
Re: How to focus on a row in datagrid?
Posted: 03 Feb 09 6:53 AM
|
You can select row with following code: DataGrid1.Selection.Clear DataGrid1.Selection.Add(KeyFieldValue)
But this works only if DataGrid's Sortable property set on True.
And you may use this code for select row by it's number:
Dim WScript, i, NumberOfRow If Not Datagrid1.Focused Then DataGrid1.SetFocus Set WScript = Application.CreateObject("WScript.Shell") For i=0 To NumberOfRow-1 WScript.SendKeys "{DOWN}" Next Set WScript = Nothing |
|
|
|
Re: How to focus on a row in datagrid?
Posted: 04 Feb 09 8:44 AM
|
Originally posted by Stainless Steel Snake
You can select row with following code: DataGrid1.Selection.Clear DataGrid1.Selection.Add(KeyFieldValue)
But this works only if DataGrid's Sortable property set on True.
And you may use this code for select row by it's number:
Dim WScript, i, NumberOfRow If Not Datagrid1.Focused Then DataGrid1.SetFocus Set WScript = Application.CreateObject("WScript.Shell") For i=0 To NumberOfRow-1 WScript.SendKeys "{DOWN}" Next Set WScript = Nothing |
|
Is there a property/reference to a gridname.Selection.Item(I) Node/Field/Column?
Thanks!
|
|
|
|
Re: How to focus on a row in datagrid?
Posted: 04 Feb 09 8:45 AM
|
Originally posted by Stainless Steel Snake
You can select row with following code: DataGrid1.Selection.Clear DataGrid1.Selection.Add(KeyFieldValue)
But this works only if DataGrid's Sortable property set on True.
And you may use this code for select row by it's number:
Dim WScript, i, NumberOfRow If Not Datagrid1.Focused Then DataGrid1.SetFocus Set WScript = Application.CreateObject("WScript.Shell") For i=0 To NumberOfRow-1 WScript.SendKeys "{DOWN}" Next Set WScript = Nothing |
|
Is there a property/reference to a gridname.Selection.Item(I) Node/Field/Column?
Thanks!
|
|
|
|
Re: How to focus on a row in datagrid?
Posted: 04 Feb 09 10:14 AM
|
Originally posted by RJ Samp
property/reference to a gridname.Selection.Item(I) Node/Field/Column? Thanks!
|
|
I'm not sure what you mean...
GridName.Selection.Item(i) contains value of DataGrid's Key Field for selected row. If you wanna access to selected node, you should use GridName.SelectedNodes.Item(i) . If you wanna get value for any field in selected row, then use GridName.GetFieldValue(GridName.Selection.Item(i), FieldName) . |
|
|
|
Re: How to focus on a row in datagrid?
Posted: 04 Feb 09 12:31 PM
|
Originally posted by Stainless Steel Snake
If you wanna get value for any field in selected row, then use GridName.GetFieldValue(GridName.Selection.Item(i), FieldName) . |
|
And that would be the answer!
THANKS!!!! |
|
|
|
Re: How to focus on a row in datagrid?
Posted: 05 Feb 09 5:06 PM
|
GridName.GetFieldValue(GridName.Selection.Item(i), FieldName) I needed to do this today and here was my answer in my inbox - Thanks! I did need to add the key field to the layout before mine worked though.
Cheers, Leon
|
|
|
|
Re: How to focus on a row in datagrid?
Posted: 21 Jul 09 11:29 AM
|
I am using Saleslogix 7.2.2 and...
grdCat.Refresh grdCat.Selection.Clear grdCat.Selection.Add strID
Does not highlight any rows, even with the "Sortable" property checked.
When the grid refreshes it seems to highlight the first row in the grid by default and then does nothing. Any clues? Pressing an imaginary down key using the shell object works, but is far from ideal.
Has anyone had any more luck with this? |
|
|
|
Re: How to focus on a row in datagrid?
Posted: 09 Sep 10 2:27 PM
|
Check out the post above and make sure you got ur id field in the layout. You can go into the columns and hide it again, but it wont work if you do not have it in there. That was my issue when I went through the post anyways... |
|
|
|