I have Blazor razor page with a TelerikForm. The form has a variety of form items in various groups.
Q How can I forrmat the group headings; specifically set them to bold and to set the color?
I guess that something needs to be added to:
<FormGroup LabelText="Form Heading"
Columns="2"
ColumnSpacing="15px">
or something in
<TelerikForm EditContext="@EditContext" Orientation="@FormOrientation"
OnValidSubmit="@HandleValidSubmit"
OnInvalidSubmit="@HandleInvalidSubmit">
I'm trying to define pre-set groupings for my data on known columns in my dataset. But whenever I try and set the @ref property on the TelerikGrid I get the following build error.
I've defined the TelerikGrid object in the @code section
TelerikGrid<List<ExpandoObject>>? Grid { get; set; }
I've declared the Data property on the TelerikGrid as being bound to List<ExpandoObject>
@if (model is not null && model.DegradeTableRows is not null && model.DegradeTableRows.Any())
{
<TelerikGrid
Data="@model.DegradeTableRows"
Width="100%"
Height="100%"
Groupable="true"
Pageable="false"
Sortable="true"
FilterMode="@GridFilterMode.FilterMenu">
<GridAggregates>
<GridAggregate Field="Total Pieces" FieldType="@typeof(decimal)" Aggregate="@GridAggregateType.Sum"/>
<GridAggregate Field="Total % Total" FieldType="@typeof(decimal)" Aggregate="@GridAggregateType.Sum"/>
</GridAggregates>
<GridColumns>
<GridColumn Field="category" Width="110px" FieldType="@typeof(string)" Title="Category"/>
<GridColumn Field="month" Width="100px" Title="Month" FieldType="@typeof(DateTime)" DisplayFormat="{0:d}"/>
<GridColumn Field="rank" Width="80px" FieldType="@typeof(int)" Title="Rank"/>
<GridColumn Field="reason" FieldType="@typeof(string)" Title="Reason"/>
@if (LengthColumnNames is not null && LengthColumnNames.Any())
{
foreach (var lengthColumnName in LengthColumnNames)
{
<GridColumn Width="75px" Field="@lengthColumnName" FieldType="@typeof(decimal)" Title="@lengthColumnName"/>
}
}
<GridColumn Field="Total Pieces" FieldType="@typeof(decimal)" Title="Total Pieces"/>
<GridColumn Field="Total % Total" FieldType="@typeof(decimal)" Title="Total % Total"/>
</GridColumns>
</TelerikGrid>
}
So I don't know why I'm getting the errors when I try to build.
I'd need to group the data when the grid comes up
var desiredState = new GridState<List<ExpandoObject>>()
{
GroupDescriptors = new List<GroupDescriptor>()
{
new GroupDescriptor()
{
Member = "month",
MemberType = typeof(DateTime)
}
} // end new list of group descriptors
}; // end new grid state
if (Grid is not null)
{
await Grid.SetState(desiredState);
}
If I add the @ref="@Grid" property to the Grid definition, I get the build error. I can comment out the code to set the group state and I still get the build error.
Is there a way around this?
Hi
If I have a column header ina grid which is sortable, and in the header template I place a button, then clicking said button will perform whatever the button's onclick is as well as changing the sort of the column. I don't see a way to mark the click as handled, prevent it bubbling up and being handled a second time by the grid header. Is there a way to achieve this currently?
Hi,
I'm trying to understand if there is any difference between using TreeList.GetState() and TreeList.State? I want to examine the state of the tree list in the most efficient manner possible, and TreeList.State seems like the obvious choice, but the docs all use the GetState() method.
Thanks.
Hi,
I've bound a TreeList to flat data. How can I determine if the TreeList has determined that a given row can be expanded/collapsed based upon the flat data, (i.e., how can I determine whether or not an expend/collapse arrow has been placed on the row)? This has an additional complexity in that the list cannot expand/collapse a row if it does not have children.
A use case for this would be to react to a double-click in a row and expand or collapse the row if the row is allowed to do that.
I am trying to use the File Select component in a Blazor WASM app to upload a file. However, when I try to read the stream in the FileSelectEventArgs object, it's coming out empty. I do get a value for the stream length but reading it into a byte array is producing an array of 0's. Here's my code:
@code {
List<string> CpmAllowedExtensions { get; set; } = new List<string> { ".pdf" };
async Task HandleFiles(FileSelectEventArgs args)
{
foreach (var file in args.Files)
{
if (!file.InvalidExtension)
{
var b = new byte[file.Stream.Length];
await file.Stream.ReadAsync(b, 0, b.Length);
//b is blank here
}
}
}
}
<TelerikFileSelect OnSelect=@HandleFiles AllowedExtensions="@CpmAllowedExtensions"></TelerikFileSelect>
How do I get to the byte array in the file so that I can upload it? The example I see in the Docs doesn't seem to be for uploading a file and trying to use a filestream as it does is producing the same result as my code above.
Also, I tried uploading the file.Stream using a SteamContent object but nothing is getting sent in the request payload.
Hi,
I am following below demo for adding custom filter menu with checboxes.
https://demos.telerik.com/blazor-ui/grid/custom-filter-menu
But it doesn't come with SelectAll checkbox option, please let me know how can add that option.
regards,
nitesh
The DialogFactory.Dialogs methods are really convenient but the prompt is missing some functionality:
- how can u distinguish pressing Cancel from pressing Ok without entering a value (both return null)
- there should be a way to make it mandatory (solves the above)
- what about setting a default value?
or am I missing something?
Hello,
I think I'm missing something in the (sparse) documentation of the Upload part of the Filemanager component, specifically this page:
https://docs.telerik.com/blazor-ui/components/filemanager/upload
The sample provided on this page places uploaded files in the FlatFileEntry list before clicking on the button OK or Cancel on the Upload dialog. I don't want that, I want to update the FlatFileEntry list after clicking OK or doing nothing (or discarding the uploaded file still at its temporary location where the api did put it) after clicking Cancel.
Which events are fired after clicking on these buttons? Does anyone have some sample code that is a bit more verbose than the almost identical sample that is pasted on every documentation page?
Kind regards,
Kees Alderliesten