UWP DataGrid - Individual Cell Based Selection? - c#

By default, when selecting values in a UWP DataGrid the entire row is selected/highlighted. On top of this, you are unable to click and drag to select multiple cells. Pressing CTRL+LClick or Shift+LClick will add rows to the selection, but even this does not allow for multiple cells to be selected.
Is there a way to allow the user to select individual cells? Furthermore, is there a way to allow for a click and drag to select multiple cells within the created rectangle?

UWP DataGrid - Individual Cell Based Selection?
I have to say currently there is no such SelectionUnit api that use to select multiple individual cell,
UWP DataGrid selection model only contains extended and single. It could only use to select entire row. if you want to this feature, I'd suggest you submit a feedback/feature request about this API/feature in the Feedback Hub. You could find the Feedback Hub in the Start Menu. Please select Developer Platform->API Feedback as the category when you submit your request. The related team will check the request.

Related

Blazor server side table with paging and multirow select feature using bootstrap?

I have a table which display records in a for each loop.Each row has a checkbox to show selected rows.
I want to keep track of the rows selected in the table so that when i navigate back to the pages where I had selected the rows I can see the checkbox checked.
My question.
1.Can I do this somehow without injecting javascript with bootstrap or some logic in the code behind?
If not what other logic can i use to bind the checkbox? (I was thinking keep a list of indices selected and check onrendering the rows but hope there is a nice way to do this)
2.How can I highlight the selected rows when i check the corresponding row checkbox again without injecting javascript.
On further analyzing my requirement and Data I was able to achieve both the above conditions through a collection of indices selected and if conditions while building the UI to render the checkboxes and the styling the rows

Filter a Kendo UI MVC Grid using checked items in a checkbox column

I have a Kendo UI MVC Grid where I'd like to add a special checkbox column.
This column will not be bound to a model but will be used like a sort of filter.
The idea is that users can check some rows and then click a button (for instance the filter icon in the column header). When clicked, the grid should collapse to the selected rows. The way I see it, it is an extra filter, but not the usual way.
The way my users will work with it would be about as follows:
They select a row and play the attached sound file for that row.
If the row holds an interesting sound file, they may check the checkbox and move to a new row -> 1.
After the selection with checkboxes is made, they will click on the checkbox column filter icon.
The selection will then collapse to the rows that were selected.
After this, the collapsed grid may be exported to excel, pdf or whatever…
A multi select grid is not an option as well as a checkboxed column filter because the selection is not instant, but a process over time.
I cannot find how I would make #4 work. Any suggestions? I don't need a complete solution, ideas are welcome.
The best way is to add boolean 'util' property to your model and bind it to a checkbox column. Once your checkbox column will be bound, your button can execute:
dataSource.filter({ field:"Field", operator: "eq", value: true });
As far I know - there is no build kendo way to manage filtering unbounded columns.

How to add textbox inside listview winform?

I'm working in Winform application.
I want to make a listview with multiple columns. In which the first column should contain string, the next column should contain textbox for input and output,the next column should contain button.
The main idea is the user should select the row with description,textbox,button. Once he selects the listview, he click on the button and a packet will be sended to device connected to ma com port and display the response in the textbox provided to that row in the listview.
It is possible to add multiple textboxes and buttons to all column.
Looks like your requirement is asking for DataGridView. Take a look at how to use the control on MSDN or any other place of your choice.

How to drag single row data from one datagrid to another? WPF

I have 2 Datagrids on the same form. One of the Datagrids holds data e.g. Policy Number, name, date etc... and I want to be able to drag a single row of data, including all the cells in that row, on top of a user listed in another Datagrid which will then send all that data and the user to another table in an SQL database. (Basically assigning a Policy to a user).
I know how to create the table in SQL but I am unsure how to make the drag and drop work and how to get the data from both data grids collectively.
Try to imagine your solution based on a series on events. My example is very basic, you will need to flesh it out.
DragLeave DataGridView1
Here you want to grab details of the row which has selected.
Then...
DragEnter DataGridView2
Here you want to use your SQL to perform an INSERT to the actual table, based on what has been dragged. If there are no errors, you probably also want to remove the dragged data from the first view.
Helpful References:
Drag between DataGrids (Adapt From WinForms)
WPF Drag and Drop
Hint: I would change the SelectionMode of the first DataGridView to FullRowSelect.

Inserting new row in gridview using an external Add button and a list as data source

I have a grid with three columns, two of which contain drop-downs, all of them getting filled from a web service result set. Now I want to allow the functionality of adding a new record in the grid by clicking an Add button present outside the gridview.
Whenever the user clicks the Add button, a new record should be created in the grid with value list filled in the drop-downs with the available options.
What is the best possible way to achieve this considering extensibility in mind.
Thanks a lot!
P.S. The data source set for the grid is a list.
Add a blank item to the list, and rebind with this new list and dummy item. That's typically one way to do it, or store the insert form in the footer of the columns. I've used that approach.

Categories