Grid Widget

Author: kevin_darbin@hargreaveslansdown.co.uk (kevindarbin)

Dropdown list: Can this be dynamic, so when clicked, dropdown widget is displayed and when not focused, editbox is displayed Columns: It would be good if you could hide columns, and also change the order in which the columns are displayed at runtime Command buttons: Can images be displayed on buttons in the grid Hyperlink: Can the hyperlink widget be used in the grid, or could an editbox have a single click extended trigger Row depth: Can the row depth be set in code, so that you can have rows greater than one line in depth Column width: If this is modified, could there be a way to save the width the user has changes it to Column buttons: Could it be possible to include images in the column buttons. This would be really useful to show ascending and descending images for sorting Row Selection: Could it be possible for multiple record selection to be availiable with the mouse or keyboard whilst using the Shift and/or Ctrl keys

5 Comments

  1. You can make a new widget class in the .ini file. (I think this may be somewhere else in V 9). NoEditRep=udropdownlist(font=editfont;forcefit=on;dynamic=on;3d=off) This will give you a class of box where the dropdown function only shows when the field has focus. You can hide columns in the grid widget by using the (still) undocumented feature VISIBLE. In widget properties->more properties (or $fieldproperties) set VISIBLE=FIELDNAME=T+;FIELDNAME2=F Fieldnames must be caps. Command buttons, I'm not sure, try setting the button type to uniface instead of windows, this allows glyphs. Hyperlink : You can't set single click, but you can set the detail trigger to fire on double click. Row Depth: According to the manual "Height?The default height of each row is adjusted to accommodate the largest font used in the row, which you can change at runtime by resizing the row headings. If the grid widget property Show Row Headings is set to False, rows cannot be resized. " - maybe you can set a field font to huge, and hide the field. Not tried it personally. Column Widths will save if the component is always called with the same instance name. Column Buttons : I don't think so. Row Selection:- Since the use of the grid widget does not affect the bahaviour behind the scenes, (it's effectively the same as a multi occ painted entity) then there is no code for handling multiple selected occurrences. However, using the extended triggers, you can trap a shifted click on the row header, and build your own multi row behaviour.


    Author: Iain Sharp (i.sharp@pcisystems.co.uk)
  2. Tnanks for the suggestions you gave, I have tried them out, and come up with the following:- Dropdown List: Your suggestion doesn't work with the grid widget. I think it must be something specific to the grid Columns: The "VISIBLE" property does work quite well. The only slight issue is that you only appear to be able to set a field to be hidden in code before the form is actually displayed. Therefore, if you wanted to allow users to select the columns to view, they would then have to exit the form and go back in again for the grid to refresh itself Command buttons: Pictures don't appear with uniface buttons either. You can have pictures, and "Detail" on form gets focus, but this could get a bit messy Hyperlink: You can change the font to one with an underline, and set the mouse pointer to be a hand, but that generally means a single click should activate the control. A double click isn't really intuitive for users used to other applications Row Selection: Yes it can be done with some quite messy code (especially if you want all options of Ctrl and Shift to work), but would be nice to have "out of the box". Also, doesn't work with the keyboard


    Author: kevindarbin (kevin_darbin@hargreaveslansdown.co.uk)
  3. I managed to miss a couple out.... Row Depth: This suggection does work, so is not bad as a workaround. It would be nice to be able to set a maximum row depth for the grid (eg. 4 rows), and then set an editbox to auto expand. That would be in an ideal world though ! Column Widths: They do get saved in the registry, but only once you leave the application. So not actually within your session.


    Author: kevindarbin (kevin_darbin@hargreaveslansdown.co.uk)
  4. Hi, I noticed your message on the forum and maybe I have a solution for you. The Dynamic property does not work with the grid's dropdownlist. However, the grid does have another very nice feature that might help you get around this problem. With the grid widget it is possible to change the widget type of a field dynamically, so using Proc. (DO you see where this is going?). You can use this to change the widget based on field focus. So, when the field does not have focus, make it an editbox, when it does have focus change it into a dropdownlist. Here is the Proc that I used to try it: There is a field (FLD), which is part of GRID. Its widgettype is EDITBOX. Its Field Gets Focus trigger contains the following Proc: $fieldproperties("FLD") = "WIDGETTYPE=DROPDOWNLIST" Its Leave Field trigger contains the following Proc: $fieldproperties("PAGES") = "WIDGETTYPE=EDITBOX" And additionally, its format trigger contains the following Proc (this handles the valrep on the editbox): if ($fieldproperties("PAGES") != "WIDGETTYPE=DROPDOWNLIST") $format = $item($format, $valrep(<$fieldname>)) endif Hope this helps.


    Author: Gerton Leijdekker (gerton.leijdekker@uniface.com)
  5. Add a button to export all datas of grid widget to cal or Microsoft Excel


    Author: apicaud (antoine.picaud@free.fr)