Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
605
Select a Cell in CodeBehind
posted

Hi,

I would like to select a Cell in xamDataGrid in CodeBehind just like if i would click on it.

I tried the following commands:

dg_Kunden.Records[0].IsSelected = true;
dg_Kunden.ActiveRecord = dg_Kunden.Records[0];
dg_Kunden.ExecuteCommand(DataPresenterCommands.RecordFirstDisplayed);

but no command achieves the behavior I would like to have.

1. I have a triggerd the SelectionChanged Event of the Grid. If I Select a Cell in the GUI the Event triggers. With the commands, the Event doesn't triger.

2. I have WPF-Labels with a Binding on the ActiveRecord of the Grid. But with the Commands the Value doesn't change.

Content="{Binding ElementName=dg_Kunden, Path=ActiveRecord.Cells[KU_Name3].Value}"

Can you immagine what I am doing wrong?