Telerik Forums
UI for Blazor Forum
0 answers
217 views

Hello, 

I want to create a grid like this with Telerik Blazor Grid:

Is it possible to do this using Multi Column Header function ? 

here's my code :

@{
	strMonth = string.Empty;
	iWeek = 0;
	<GridColumn Field="@dtGrid.Columns[0].ColumnName" FieldType="@dtGrid.Columns[0].DefaultValue.GetType()" Width="150px"></GridColumn> //Member
	<GridColumn Field="@dtGrid.Columns[1].ColumnName" FieldType="@dtGrid.Columns[1].DefaultValue.GetType()" Width="150px"></GridColumn> //Project

	for (int colMonth = 2; colMonth <= dtGrid.Columns.Count - 1; colMonth++)
	{
		if (DateTime.TryParse(dtGrid.Columns[colMonth].ColumnName, out dt))
		{
			if (strMonth != dt.ToString("MMMM"))
			{
				strMonth = dt.ToString("MMMM");

				<GridColumn Title="@strMonth" FieldType="@dtGrid.Columns[0].DefaultValue.GetType()">
					<Columns>
						@{
							iWeek = Helper.Common.GetWeekOfYear(dt);

							for (int colWeek = colMonth; colWeek <= dtGrid.Columns.Count - 1; colWeek++)
							{
								if (DateTime.TryParse(dtGrid.Columns[colWeek].ColumnName, out dt))
								{
									if (strMonth != dt.ToString("MMMM"))
									{
										colMonth = colWeek;
										break;
									}
									if (iWeek != Helper.Common.GetWeekOfYear(dt))
									{
										colMonth = colWeek;
										break;
									}
									<GridColumn Title="@string.Format("Week {0}", iWeek)" FieldType="@dtGrid.Columns[0].DefaultValue.GetType()">
										<Columns>
											@for (int iDay = colWeek; iDay <= dtGrid.Columns.Count - 1; iDay++)
											{
												if (DateTime.TryParse(dtGrid.Columns[iDay].ColumnName, out dt))
												{
													if (iWeek != RR.BusinessLogicLayer.Helper.Common.GetWeekOfYear(dt))
													{
														colWeek = iDay;
														break;
													}
													<GridColumn Field="@dt.Day.ToString()" FieldType="@dtGrid.Columns[colWeek].DefaultValue.GetType()" Width="150px"></GridColumn>
												}
											}
										</Columns>
									</GridColumn>
								}
							}
						}
					</Columns>
				</GridColumn>
			}
		}
	}
}

Above code only can get me until Month Column, when i debug it iWeek only fires after all column rendered ? so , it can't create the Child Column of Months Column.

How can i fix it so it can show Multi Header of Months, Week and Day

 

Mozart
Top achievements
Rank 1
Iron
Veteran
 updated question on 19 Sep 2023
1 answer
155 views

How can I add dropdowlist for changing theme in my project like for demos Blazor UI components.

Thanks

Peter

Dimo
Telerik team
 answered on 18 Sep 2023
1 answer
227 views

Hello,

We are using a TelerikWizard with WizardStepperSettings Linear="false" and would like to move the labels inline with the step indicators. See this example picture:

 

Is dat possible?

Regards,

 

  -Edo

Hristian Stefanov
Telerik team
 answered on 18 Sep 2023
1 answer
777 views

I'm encountering an issue with the Telerik Notification component in my Blazor Server. The problem arises when I attempt to display a notification from a function that is not on the same thread as the component. In such cases, the notification item doesn't render in the UI.

To address this, I've made a modification to my component by replacing StateHasChanged with InvokeAsync(StateHasChanged) to ensure thread safety during invocation.

I'd like to seek input to determine whether this is a bug in the Telerik component or if there's a better approach to solving this issue. Any advice or suggestions would be greatly appreciated. Thank you!

 

USE:::


BEFORE:::




AFTER FIX::::

Nadezhda Tacheva
Telerik team
 answered on 18 Sep 2023
3 answers
1.0K+ views

I'm using the Telerik Blazor components in a Blazor Hybrid app and until now they've worked perfectly. Unfortunately with the latest release I get a parse error that prevents the entire library from loading. Has anyone else seen this?

"Uncaught TypeError: t.split(...).at is not a function", source: https://0.0.0.0/_content/Telerik.UI.for.Blazor/js/telerik-blazor.js (28)"

Johan
Top achievements
Rank 2
Iron
Iron
 updated answer on 18 Sep 2023
1 answer
212 views

Hi, 

When is the Spreadsheet Blazor planned to release? There are conflicting answers across your forums and roadmap. We also need to plan appropriately for our customers. 

R3 2023:

https://www.telerik.com/support/whats-new/blazor-ui/roadmap?_ga=2.86876376.1908345897.1694788768-1711350647.1686141934&_gl=1*3hdhro*_ga*MTcxMTM1MDY0Ny4xNjg2MTQxOTM0*_ga_9JSNBCSF54*MTY5NDc4ODc2OC42MC4xLjE2OTQ3ODkwMDQuNTEuMC4w

R1 2024:

https://feedback.telerik.com/blazor/1442151-spreadsheet-component?_ga=2.145065076.1908345897.1694788768-1711350647.1686141934&_gl=1*iwgmye*_ga*MTcxMTM1MDY0Ny4xNjg2MTQxOTM0*_ga_9JSNBCSF54*MTY5NDc4ODc2OC42MC4xLjE2OTQ3ODg5MDQuNTIuMC4w

Dimo
Telerik team
 answered on 15 Sep 2023
0 answers
138 views

Hey,

I'm using the TelerikDatePicker in a grid edited row and I want to stop changing values when I click the keyboard arrows. Is there any solution to stop this ?

Thanks.

Ben
Top achievements
Rank 1
 asked on 14 Sep 2023
2 answers
529 views

I set 

Expanded="true"

but after I select the second item in the drawer it collapses. Here is my code for the drawer:

<TelerikDrawer Data="@pageData"
               SelectedItem="selectedItem"
               Mode="@DrawerMode.Push"
               Expanded="true"
               MiniMode=true
               SelectedItemChanged="((DrawerItem item) => SelectedItemChangedHandler(item))">
    <DrawerContent>
        @{
            if (selectedItem is not null)
            {
                <AdAccount AdAccountDisplayItem="@adAccountDI" />
            }
        }
    </DrawerContent>
</TelerikDrawer>

Víctor
Top achievements
Rank 1
Iron
Iron
Iron
 answered on 14 Sep 2023
1 answer
503 views

I have a TelerikDialog who host a component, when some logic occurs on component i would like to hide the dialog buttons, now i can do this for each button inside DialogButtons element, but this cause the dialog to show some empty space with a separation line.

I would like to hide entirely the DialogButtons element to prevent showing empty space, i tried with hidden html attribute or @if statement but it's not supported.

There is a workaround?

It woud be glad to have a Visible property on DialogButtons component in future releases.

Tsvetomir
Telerik team
 updated answer on 14 Sep 2023
0 answers
226 views

I am trying to create something I've seen a lot on other websites. I want to create a tooltip that shows "Copy to clipboard" when I hover over a <span> element, but when I click on the <span> I want the text to change to "Copied!"

This is what I am doing now

    <TelerikTooltip TargetSelector="#propvalue>span[title]" Position="@TooltipPosition.Top" ShowOn="@TooltipShowEvent.Hover" @ref="@tooltipHover">
        <Template>
            @{
                <div>
                    @copyToolTip
                </div>
            }
        </Template>
    </TelerikTooltip>

<span id="myCoolSpan"
            style="cursor:pointer;"
            onclick="@(()=>_copyButtonHandler(value as string))"            
            title="this is the title">
  Text of my span
</span>

    private async Task _copyButtonHandler(string value)
    {            
       copyToolTip = "Copied!";
       await _clipboardService.WriteTextAsync(value); 
    }


David
Top achievements
Rank 3
Iron
Iron
Veteran
 asked on 13 Sep 2023
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?