Skip to content

Cell selection and manipulation #90

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
arthurits opened this issue Jan 3, 2025 · 3 comments
Open

Cell selection and manipulation #90

arthurits opened this issue Jan 3, 2025 · 3 comments
Labels
enhancement New feature or request
Milestone

Comments

@arthurits
Copy link
Contributor

First of all, thanks for this great control. 👍

Describe the solution you'd like
Not sure if there's an actual workaround, but it would be great to be able to:

  • Retrieve the XAML control whenever any cell's value is updated. This would make sense in order to somehow highlight the cell (control border of background) if the value entered is out of bounds.
  • Retrieve the row where the cell's value has been updated. Use-case example: user updates some cell's value and, depending on the value entered, other cells in the same row need to be automatically updated (or recalculated, or disabled)

For instance, take this table as an example:
image
The 1st and 2nd columns are ComboBox columns and all the remaining are Numeric columns.
Depending on the value selected by the user in the 1st column, some data cells are not needed (they are shown with 0 value). It would be nice to be able to provide some event in the TableView to access the row's controls and set the values from the view.
Also, the numeric cells have valid ranges, and after each user input, it would be nice to check the value and mark the cell if the value is out of bounds. IT would be nice to be able to do this from the view.

Describe alternatives you've considered
Some workaround can be achieved by checking the values in the ViewModel.
Also, the LostFocus event makes possible some handling, but the event's function arguments object sender and RoutedEventArgs e don't seem to provide information about the row that has been interacted with.

Just my two cents for your consideration for future versions of the control.

PS: just another two features come to mind: adding row headers and transposing the view (same binding to the list, but the control is drawn with the columns as rows and the rows —cases— as columns).

@arthurits arthurits added the enhancement New feature or request label Jan 3, 2025
@lostluna1
Copy link

I think you can use ViewModel, and instead of relying on UI to calculate them.

@w-ahmad
Copy link
Owner

w-ahmad commented Feb 21, 2025

Thank you, @arthurits! I really appreciate your kind words. 😊

I'll definitely consider these features for v1.4. I plan to implement events like cell start editing, end editing, or commit changes, which should help with your initial request. As for row headers, they are also on my list for v1.4.

Regarding the Transpose View, it’s a more complex feature to implement, so it may be considered in a future release. But I’ll keep it in mind!

@w-ahmad w-ahmad added this to the v1.4.0 milestone Feb 21, 2025
@arthurits
Copy link
Contributor Author

Thank you for your great work @w-ahmad!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants