You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: components/form/columns.md
+14-12Lines changed: 14 additions & 12 deletions
Original file line number
Diff line number
Diff line change
@@ -15,27 +15,29 @@ The Form component for Blazor allows you to add multiple columns by using the `C
15
15
16
16
>caption Add columns to a Form with Automatically generated fields
17
17
18
-
You can set the `Columns` parameter when the Form component automatically generates the editors. The form will spread the editors evenly across the columns. It will calculate it using this formula: `propertiesInModelCount / Columns`.
18
+
You can set the `Columns` parameter when [`<FormItemsTemplate>`](slug:form-formitems-formitemstemplate) is not used and the Form manages its layout. The Form will spread the editors evenly across the columns.
19
19
20
-
````RAZOR
21
-
@* Add colums to the Form component *@
20
+
When using `Columns`, you can also define arbitrary space between the rows with the `RowSpacing` parameter.
22
21
23
-
<TelerikForm Model="@person"
24
-
Columns="2" ColumnSpacing="25px">
22
+
````RAZOR
23
+
<TelerikForm Model="@Employee"
24
+
Columns="2"
25
+
ColumnSpacing="24px"
26
+
RowSpacing="24px">
25
27
</TelerikForm>
26
28
27
29
@code {
28
-
public Person person = new Person();
30
+
private Person Employee { get; set; } = new();
29
31
30
32
public class Person
31
33
{
32
34
public int Id { get; set; }
33
-
public string FirstName { get; set; }
34
-
public string LastName { get; set; }
35
-
public DateTime DOB { get; set; } = DateTime.Today.AddYears(-20);
36
-
public string CompanyName { get; set; }
37
-
public DateTime HireDate { get; set; }
38
-
public bool IsOnVacation { get; set; } = true;
35
+
public string FirstName { get; set; } = string.Empty;
36
+
public string LastName { get; set; } = string.Empty;
37
+
public DateTime DOB { get; set; } = DateTime.Today.AddYears(-18);
38
+
public string CompanyName { get; set; } = string.Empty;
39
+
public DateTime HireDate { get; set; } = DateTime.Today;
*`Columns` - `int` - defines the number of columns in the group.
27
-
28
-
*`ColumnSpacing` - `string` - defines the horizontal space between the editors in the group.
26
+
| Parameter | Type and Default Value| Description |
27
+
| --- | --- | --- |
28
+
|`LabelText`|`string`| The label for the entire group rendered as a `<legend>` element in a `<fieldset>`. |
29
+
|`Columns`|`int`| The number of columns in the group. |
30
+
|`ColumnSpacing`|`string` (`"16px"`) | The horizontal space between the columns in the group. |
31
+
|`RowSpacing`|`string`| The vertical space between the fields in the group. The default value is zero, but there is a default top margin for Form items. This parameter has effect only when `Columns` is set. |
29
32
30
33
## Example - Organize FormItems into Groups
31
34
@@ -36,56 +39,42 @@ You can organize some FormItems into logical groups. You can configure the label
Copy file name to clipboardExpand all lines: components/form/overview.md
+7-6Lines changed: 7 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -203,12 +203,13 @@ You can customize the editors further through the [form items](slug:form-formite
203
203
204
204
The [Blazor Form](https://demos.telerik.com/blazor-ui/form/overview) exposes multiple parameters that allow you to customize its layout. Besides the parameters below, the Form component also allows you to [define a completely custom layout with HTML markup and Razor components](slug:form-formitems-formitemstemplate).
205
205
206
-
| Parameter | Type and Default value | Description |
|`ButtonsLayout`|`FormButtonsLayout` enum <br /> (`Start`) | Determines the position and width of all Form buttons. See [Form Buttons](slug:form-formitems-buttons). |
209
-
|`Columns`|`int`| Defines the number of columns in the Form. See the [Columns](slug:form-columns) article for more information |
210
-
|`ColumnSpacing`|`string`| Defines the amout of horizontal space between the Columns. See the [Columns](slug:form-columns) article for more information. |
211
-
|`Orientation`|`FormOrientation` enum <br /> (`Vertical`) | Determines the position of each label with regard to its editor. See [Orientation](slug:form-orientation) for more information. |
206
+
| Parameter | Type and Default value | Description |
207
+
| --- | --- | --- |
208
+
|`ButtonsLayout`|`FormButtonsLayout` enum <br /> (`Start`) | The position and width of all Form buttons. See [Form Buttons](slug:form-formitems-buttons). |
209
+
|`Columns`|`int`| The number of columns in the Form. See the [Columns](slug:form-columns) article for more information |
210
+
|`ColumnSpacing`|`string` (`"32px"`) | The amout of horizontal space between the columns. See the [Columns](slug:form-columns) article for more information. |
211
+
|`Orientation`|`FormOrientation` enum <br /> (`Vertical`) | The position of each label with regard to its editor. See [Orientation](slug:form-orientation) for more information. |
212
+
|`RowSpacing`|`string`| The amout of vertical space between the rows. The default value is zero, but there is a default top margin for Form items. This parameter has effect only when `Columns` is set. |
0 commit comments