-
Notifications
You must be signed in to change notification settings - Fork 1
/
Grid.razor
83 lines (72 loc) · 2.72 KB
/
Grid.razor
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
@namespace DataJuggler.Blazor.Components
@using DataJuggler.UltimateHelper
@using DataJuggler.Excelerate;
@using DataJuggler.Blazor.Components
@using BlazorStyled
<Styled @bind-Classname=@GridStyle>
background-color: @GridBackColor;
height: @HeightStyle;
line-height: 2vh;
font-size: @FontSizeStyle;
width: @WidthStyle;
overflow: hidden;
position: @Position;
left: @LeftStyle;
top: @TopStyle;
</Styled>
@if (ShowHeader)
{
<div class="@HeaderClassName">
@HeaderText
</div>
}
@if ((ShowColumnHeaders) && (HasColumns))
{
<div class="@HeaderClassName">
@foreach (Column column in Columns)
{
<div class="@column.ClassName">@column.Caption</div>
}
</div>
}
<div class="@ClassName @GridStyle">
@if (HasRows)
{
@foreach (Row row in Rows)
{
// if the row has columns
if (row.HasColumns)
{
<div class="@row.ClassName">
@foreach (Column column in row.Columns)
{
if (column.IsImageButton)
{
<ImageButton ClickHandler=@ButtonClickHandler Unit="@column.Unit" ImageUrl="@column.ButtonUrl"
Width="@column.Width" Height="@column.Height" [email protected] Name="Button"
ButtonText="@column.ColumnText" Visible=true Parent="this"></ImageButton>
}
else if ((row.EditMode) && (!column.ReadOnly) && (column.EditMode))
{
<div class="displayinline @column.ClassName">
<TextBoxComponent Name=column.ColumnName Unit="@column.Unit" Width=column.Width
Height=column.Height RowId=row.Id ColumnId=column.Id ZIndex="@column.ZIndex"
SetFocusOnFirstRender=column.SetFocusOnFirstRender ClassName="@column.EditorClassName"
Text="@column.EditorText" Parent=this></TextBoxComponent>
</div>
}
else if (EnableClick)
{
<div class="down0 @column.ClassName" @onclick="() => OnClick(row, column.ColumnNumber)">@column.ColumnText</div>
}
else
{
<div class="down0 @column.ClassName" @ondblclick="() => OnDoubleClick(row, column.ColumnNumber)">@column.ColumnText</div>
}
}
</div>
<br />
}
}
}
</div>