Hi
I want to have the ability to selected x number of cells then edit the value in the first cell and update the other cells with that value.
I have seen it done but with the winforms, Please Help
/Thomas
Hello Thomas,
I have been looking into the provided code.
According to our support policy when a sample is provided it has to be runnable, isolated in order to represent only the described behavior. All additional logic and external dependencies (such as data bases) has to be removed or replaced with a local ones for testing purposes.
Following the guidelines mentioned above, I tried to remove the parts that are not directly related to the issue, however I was not able to run the project and debug it because important parts of the code are missing and the logic cannot be applied.
As a suggestion, from what I was able to see, you try modifing the SelectedItemsChanged in the following way:
private void MediePlaner_SelectedItemsChanged(object sender, Infragistics.Windows.DataPresenter.Events.SelectedItemsChangedEventArgs e) { if (e.Type == typeof(Cell) && this.mediePlaner.SelectedItems.Cells.Count > 0 && this.mediePlaner.ActiveCell != null) { _cells.Clear(); foreach (var cell in this.mediePlaner.SelectedItems.Cells) { _cells.Add(cell); // change Cells to _cells } //.... } }
Additionally, in the provided same I was not able to see a logic for the Ctrl button in the PreviewMouseLeftButtonDown handler.
private void grid_PreviewMouseLeftButtonDown(object sender, MouseButtonEventArgs e) { HitTestResult result = VisualTreeHelper.HitTest(this.grid, e.GetPosition(this.grid)); if(Keyboard.IsKeyDown(Key.LeftCtrl) || Keyboard.IsKeyDown(Key.RightCtrl)) { } else if (result != null && result.VisualHit != null) { //... } }
Could you please let me know whether you were able to test the previously attached sample on your side and if this is what you are looking for? If this is not an accurate demonstration of what you are trying to achieve please feel free to modify it and send it back to me along with steps to reproduce. Alternatively, if the behavior cannot be replicated please feel free to provide your own sample. Remove any external dependencies and code that is not directly related to the issue, zip your application and attach it in this case.
Having a working sample on my side, which I can debug, is going to be very helpful in finding the root cause of this behavior.
Thank you for your cooperation.
Looking forward to hearing from you.
Sincerely,Teodosia HristodorovaAssociate Software Developer