Skip to content

adamfoneil/RadzenBuilder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

I use Radzen Blazor a lot. When building data grids, the markup can get pretty verbose/repetitive. This is a small WPF app to make it easier to create this markup.

You enter text on the left side of the window, and the markup output is on the right. Features:

  • the first line of your text is the grid TItem type name
  • all subsequent lines are columns. With columns you can specify:
    • the Title at minimum
    • optionally followed by the bound property name in square brackets
    • optionally the type name after the type name. The supported types are Text, Number, Date, and Bool.

For example, this input

Customer
First Name[FirstName:Text]
Last Name[LastName]
Phone
Email[Email]
Renewal Date[RenewalDate:Date]
Active[IsActive:Bool]

Generates this output

<RadzenDataGrid TItem="Customer" Data="data">
  <Columns>
    <RadzenDataGridColumn TItem="Customer" Title="First Name">
      <Template>
        <span>@context.FirstName</span>
      </Template>
      <EditTemplate>
        <RadzenTextBox @bind-Value="context.FirstName" />
      </EditTemplate>
    </RadzenDataGridColumn>
    <RadzenDataGridColumn TItem="Customer" Title="Last Name">
      <Template>
        <span>@context.LastName</span>
      </Template>
    </RadzenDataGridColumn>
    <RadzenDataGridColumn TItem="Customer" Title="Phone">
    </RadzenDataGridColumn>
    <RadzenDataGridColumn TItem="Customer" Title="Email">
      <Template>
        <span>@context.Email</span>
      </Template>
    </RadzenDataGridColumn>
    <RadzenDataGridColumn TItem="Customer" Title="Renewal Date">
      <Template>
        <span>@context.RenewalDate</span>
      </Template>
      <EditTemplate>
        <RadzenDatePicker @bind-Value="context.RenewalDate" />
      </EditTemplate>
    </RadzenDataGridColumn>
    <RadzenDataGridColumn TItem="Customer" Title="Active">
      <Template>
        <span>@context.IsActive</span>
      </Template>
      <EditTemplate>
        <RadzenSwitch @bind-Value="context.IsActive" />
      </EditTemplate>
    </RadzenDataGridColumn>
  </Columns>
</RadzenDataGrid>

image

About

Generate RadzenDataGrid markup from text

Topics

Resources

License

Stars

Watchers

Forks

Languages