DataGrid: selection of multiple rows possible

Started by zdjapjas, April 11, 2012, 06:41:41 AM

Previous topic - Next topic

zdjapjas

Hello everyone,

after some fiddling around with this nice tool I got used to it a bit more and wrote my first ACAD dialog based command with it which allows to look into the nesting structure of blocks. It was fairly easy.

Now I am thinking of another application which would allow me to edit the attributes (80 per block) of hundrets of blocks within one drawing. I would like to use the DataGrid for that as it allows me to set
individual cells to be just Text-input boxes while others can be drop-down lists where the user can select one of many entries. The grid would show all the attributes in the columns, one row per block.

I want to be able to distribute data in the following manner because it is sometimes used in ACAD itself, e.g. the publish dialog:

- the user selects multiple rows
- then he can select an entry of a list box within the selection (in the publish command that would be the page setup)
- that would put the selected value into the column of all the selected rows

There are other ways to solve this but I like the elegant and easy way this would offer.

Is that somehow possible?

Also it would be necessary to keep multiple rows selected while the user selects on entry in a cell's pulldown list.

However, I don't see that the first step would be possible...? I have seen that there are values for the selected row/column but not for multiple rows + 1 column.
(It would be nice, if the list of selected rows was a simple lisp list of row index numbers)

Or do I have missed something in the documentation?

Thank you for your help
Zoltan


Fred Tomke

Hi, Zoltan,

no, you've missed nothing. You can only select a single row in a data grid.
When I read you post the first time, I thought you want to show all the block attributes in each row of the first and second column (key-value-pair). But then I've read you want to select multiple rows. Do you want to show attributes of different attribut blocks in the grid at the same time?
Then I recommend you to use a listview: there you can select multiple rows and you can detect which column the user has clicked to make a textbox or a dropdown (or a combobox) visible to edit the attribut value(s).
Or you draw a listview with the selected blocks you want to edit, and beside it you draw a grid. The grid contains all the available attributes and their valid values. But you can still modify a single attribute value.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

zdjapjas

Thank you very much, Fred, these are very valuable ideas!

Do I understand that correctly? You are able to change the type of each box in a list-view in runtime? Such as the user would click into a row which also would select it (via code) and then a dropdown list would appear in that box from which the user could choose his value. This would be actually exactly like the publish dialog works.

You don't have to dig into the details, just tell me if that is possible.

Fred Tomke

Hi, Zoltan,

you can display a textbox or a dropdown at the current mouseposition or at an area beside the listview.

Regards, Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]