How can I set the selecteditem based on a known value for a cell? Also, make sure that that the record is visible.
Thanks,Rod
Hello,
You can select a record by getting its ID (index) from another cell by handling the EditModeEnded event for example :
int value = int.Parse(e.Cell.Value.ToString());
and set the record to Active :
xamDataGrid1.Records[value].IsActive = true;
Regarding the ActiveRecord, you can use RecordManager in the XamDataGrid to get reference to the adding record and all other records as a whole.
Hope this helps.
Alex.
I have same require, too!
I have a "Add Function" , do this over ,I want ActiveRecord can focus on the Add Record, Thanks.
XamDatagrid.GetRecordFromDataItem(object dataItem, bool recursive);
will return the DataRecord for a given underlying data item. If you pass false for 'recursive' then only root level records will be searched. Passing true causes a recursive search through all child records.
Joe
Say I know a specific id for a record. I know I can do a select on the dataview and get the datarow, but what I need is, to get the reference to the specific datarecord so that I can set it to be the one and only selectedItem.
Rod
Hi Rod -
Can you be more specific about what you are trying to achieve?