Showing results for 
Search instead for 
Do you mean 
Reply

How to programmatically select a row in a grid?

After adding a new part to a connection contained in an RS grid control, I want to programmatically select that new row. How can I do this?

 

The SelectedRowIndex propery on the grid seems to only read from the grid, but doesn't allow setting the selected row.

 

Thanks,

Gene

Gene Libardi
Principal Solutions Architect
Engineering Intent Corporation
www.EngineeringIntent.com


3 REPLIES

Re: How to programmatically select a row in a grid?

Gene, I've set the SelectedRowIndex property successfully, but I had to add a refresh views call to WhenChanged to get the UI to reflect the updated value. 

Re: How to programmatically select a row in a grid?

Thanks, Chris. Was the WhenChanged with the refresh views on the property
bound to the SelectedRowIndex or some other property/place?



Gene



*Gene Libardi*

*Principal Solutions Architect*

*Engineering Intent Corporation*

www.EngineeringIntent.com

GeneLibardi@EngineeringIntent.com

*Direct: +1.413.214.4710*

*Skype: gene.libardi*



[image: EI Logo with Banner Text - Black on Transparent - Medium]
Gene Libardi
Principal Solutions Architect
Engineering Intent Corporation
www.EngineeringIntent.com


Re: How to programmatically select a row in a grid?

The WhenChanged refresh code was on the property bound to SelectedRowIndex. I had UI elements bound to properties on the the selected part, and that was the only way to get them to update.

 

When setting the value of the property bound to SelectedRowIndex, I was typically doing it with an ActionButtonClick, so I got a refresh out of that event as well.