## UiFormgrid UiFormgrid — Widget embedding both a form and a grid to display a GdaDataModel's contents |

## Stability Level

Stable, unless otherwise indicated

## Functions

GtkWidget * | ui_formgrid_new ()
void | ui_formgrid_handle_user_prefs ()
GArray * | ui_formgrid_get_selection ()
GdaDataModelIter * | ui_formgrid_get_form_data_set ()
GdaDataModelIter * | ui_formgrid_get_grid_data_set ()
void | ui_formgrid_set_sample_size ()
GdauiRawGrid * | ui_formgrid_get_grid_widget ()
void | ui_formgrid_set_connection ()

## Properties

gboolean | compute-mod-statements | Write / Construct
GdauiRawGrid * | raw-form | Read
GdauiRawGrid * | raw-grid | Read
gboolean | scroll-form | Write / Construct Only
GdauiDataProxyInfo * | widget-info | Read

## Signals

void | data-set-changed | Run First

## Types and Values

struct | UiFormGrid

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBox
                        ╰── UiFormGrid

## Implemented Interfaces

UiFormGrid implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Description

## Functions

### ui_formgrid_new ()

    GtkWidget *
    ui_formgrid_new (GdaDataModel *model,
                     gboolean scroll_form,
                     GdauiDataProxyInfoFlag flags);

Creates a new UiFormGrid widget suitable to display the data in `model`

#### Parameters

model | a GdaDataModel |
scroll_form | set to `TRUE` to wrap the embedded form in a scrolled window |
flags | the GdauiDataProxyInfoFlag, specifying what to display in the new widget |

#### Returns

the new widget

### ui_formgrid_handle_user_prefs ()

    void
    ui_formgrid_handle_user_prefs (UiFormGrid *formgrid,
                                   BrowserConnection *bcnc,
                                   GdaStatement *stmt);

Takes into account the UI preferences of the user

#### Parameters

formgrid | a UiFormGrid widget |
bcnc | a BrowserConnection, or `NULL` to let `formgrid` determine it itself. | [allow-none]
stmt | the GdaStatement which has been executed to produce the GdaDataModel displayed in `formgrid` |

### ui_formgrid_get_selection ()

    GArray *
    ui_formgrid_get_selection (UiFormGrid *formgrid);

Returns the list of the currently selected rows in a UiFormGrid widget. The returned value is a list of integers, which represent each of the selected rows.

If new rows have been inserted, then those new rows will have a row number equal to -1. This function is a wrapper around the `gdaui_raw_grid_get_selection()` function.

#### Parameters

formgrid | a UiFormGrid widget |

#### Returns

a new array, should be freed (by calling `g_array_free()` and passing `TRUE` as last argument) when no longer needed.

### ui_formgrid_get_form_data_set ()

    GdaDataModelIter *
    ui_formgrid_get_form_data_set (UiFormGrid *formgrid);

### ui_formgrid_get_grid_data_set ()

    GdaDataModelIter *
    ui_formgrid_get_grid_data_set (UiFormGrid *formgrid);

### ui_formgrid_set_sample_size ()

    void
    ui_formgrid_set_sample_size (UiFormGrid *formgrid,
                                 gint sample_size);

Set the size of the sample displayed in `formgrid` , see `gdaui_raw_grid_set_sample_size()`

#### Parameters

formgrid | a UiFormGrid widget |
sample_size | the sample size |

### ui_formgrid_get_grid_widget ()

    GdauiRawGrid *
    ui_formgrid_get_grid_widget (UiFormGrid *formgrid);

#### Parameters

formgrid | a UiFormGrid widget |

#### Returns

the GdauiRawGrid embedded in `formgrid`

### ui_formgrid_set_connection ()

    void
    ui_formgrid_set_connection (UiFormGrid *formgrid,
                                BrowserConnection *bcnc);

Tells `formgrid` to use `bcnc` as connection when actions have to be executed

#### Parameters

formgrid | a UiFormGrid widget |
bcnc | a BrowserConnection, or `NULL`. | [allow-none]

## Types and Values

### struct UiFormGrid

    struct UiFormGrid;

## Property Details

### The `“compute-mod-statements”` property

      “compute-mod-statements”   gboolean

Owner: UiFormGrid

Flags: Write / Construct

Default value: FALSE

### The `“raw-form”` property

      “raw-form”                 GdauiRawGrid *

Owner: UiFormGrid

Flags: Read

### The `“raw-grid”` property

      “raw-grid”                 GdauiRawGrid *

Owner: UiFormGrid

Flags: Read

### The `“scroll-form”` property

      “scroll-form”              gboolean

Owner: UiFormGrid

Flags: Write / Construct Only

Default value: FALSE

### The `“widget-info”` property

      “widget-info”              GdauiDataProxyInfo *

Owner: UiFormGrid

Flags: Read

## Signal Details

### The `“data-set-changed”` signal

    void
    user_function (UiFormGrid *uiformgrid,
                   gpointer    user_data)

Flags: Run First