Currently my RadzenDataGrid will not auto-resize as the window resizes and I'm not sure how to get it to. I'd like the data grid to have scroll columns instead of the whole window.
<RadzenDataGrid
class="StandingsDataGrid"
@ref="GameDataGridObject"
FilterCaseSensitivity="FilterCaseSensitivity.CaseInsensitive"
AllowSorting="true"
Data="@CurrentWeekPicks"
TItem="SpreadWeekPick"
AllowColumnResize="true"
AllowPaging="true">
<Columns>
<RadzenDataGridColumn TItem="SpreadWeekPick" Frozen="true">
<HeaderTemplate>
<RadzenText TextStyle="TextStyle.H6">User</RadzenText>
</HeaderTemplate>
<Template Context="data">
<div class="CurrentUser">
@this.GetUsernameFromUserId(data.UserId)
</div>
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="SpreadWeekPick" Frozen="@weekScoreFrozen">
<HeaderTemplate>
<RadzenCheckBox @bind-Value="weekScoreFrozen" title="Pin/Unpin this column" />
<div class="CurrentUserScore">
Pts / Max
</div>
</HeaderTemplate>
<Template Context="data">
<div class="CurrentUserScore">
@this.GetScoreDescription(data)
</div>
</Template>
</RadzenDataGridColumn>
<RadzenDataGridColumn TItem="SpreadWeekPick" Frozen="@seasonScoreFrozen">
<HeaderTemplate>
<RadzenCheckBox @bind-Value="seasonScoreFrozen" title="Pin/Unpin this column" />
<div class="CurrentLeaguePoints">
Season Points
</div>
</HeaderTemplate>
<Template Context="data">
<div class="CurrentUserScore">
@this.GetPointsInLeague(CurrentLeague, data.UserId)
</div>
</Template>
</RadzenDataGridColumn>
@foreach (var game in CurrentActiveGames)
{
<RadzenDataGridColumn TItem="SpreadWeekPick">
<HeaderTemplate>
<div class="GameHeader @GetGameHeaderClass(game)">
<div class="AwayTeam">
@game.AwayTeam.Abbreviation
<div class="AwayScore">
@game.Result.AwayScore
</div>
<div class="TeamIcon">
<img src="@game.AwayTeam.GetTeamIconPath()" alt="@game.AwayTeam.Name Helmet" />
</div>
</div>
<div class="HomeTeam">
@game.HomeTeam.Abbreviation
<div class="HomeScore">
@game.Result.HomeScore
</div>
<div class="TeamIcon">
<img src="@game.HomeTeam.GetTeamIconPath()" alt="@game.HomeTeam.Name Helmet" />
</div>
</div>
<div class="Spread">
@game.CurrentSpread.HomeTeamSpread()
</div>
<div class="GameStatus">
@game.Result.Status
</div>
</div>
</HeaderTemplate>
<Template Context="data">
<div class="UserPick">
@GetPickDescription(game, data)
</div>
</Template>
</RadzenDataGridColumn>
}
</Columns>
</RadzenDataGrid>
<style>
.StandingsDataGrid {
width: 100%;
}
.HomeTeam,
.AwayTeam {
margin-left: 1px;
margin-right: auto;
margin-top: 1px;
text-align: left;
padding: 0px 5px;
width: 6em !important;
}
.HomeScore,
.AwayScore {
float: right;
margin-right: 1px;
width: 15px;
}
.HomeTeam {
border-bottom: solid;
}
.CurrentUserScore {
font-weight: 700;
}
.CurrentUserScore,
.UserPick {
text-align: left;
}
.Spread,
.GameStatus {
text-align: center;
}
.PickSuccess {
color: green;
font-weight: 700;
}
.PickFailure {
color: red;
font-weight: 700;
}
.GameHeader {
font-weight: 700;
}
.GameFinal {
background-color: #474747;
color: white;
}
.rz-grid-table {
width:auto;
}
.superscript {
vertical-align: super;
position: relative;
top: -0.5em;
font-size: 60%;
display: inline;
}
</style>