Hi,
I have some grids where I automatically select the first record after setting the itemssource through code behind. That works fine.
Another application we have (started by another developer) uses DataContext extensively, to the itemssource is just a binding in XAML. We've tried figuring out where to put the code to select the first record when the grid is displayed, but no luck so far. For example: We click on a tab that contains a XamDataGrid with the itemssource bound in XAML. When the tab is activated and the grid shows up on the screen, we'd like the first record to be selected.
We've tried putting the code in a few different events, but for some reason it never works. We must be overlooking something simple, but we've reached that point where we're just running in circles.
Thanks,Michel
Hello Michel,
Which events have you been trying with? For example, Loaded and InitializeRecord events should be working correctly.
Hi Alex,
I don't remember which events we tried, but it wasn't any of these two. We just tried using the "Loaded" event and it worked - thanks!
Michel