Token导航 LogoToken导航TokenDH.com
研究检索只读github未标认证来源可访问许可证需确认审计通过

syncfusion-blazor-dataform同步融合 Blazor 数据形式

Agent Skill

用于辅助数据整理、表格处理、CSV/Excel 分析、指标计算和图表准备。它适合让 Agent 清洗字段、汇总数据、发现异常、生成统计口径或把分析结果转成可读说明。使用时需要确认数据来源、字段含义和时间范围,避免把样本数据当全量事实;涉及敏感数据、导出文件或批量写回时,应先确认权限和脱敏边界。

总安装

964

周安装

41

GitHub Stars

公开资料未说明

下载量

338
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:syncfusion-blazor-dataform(同步融合 Blazor 数据形式)
来源仓库:https://github.com/syncfusion/blazor-ui-components-skills
仓库路径:skills/syncfusion-blazor-dataform
安装命令:
npx skills add https://github.com/syncfusion/blazor-ui-components-skills --skill syncfusion-blazor-dataform
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/syncfusion/blazor-ui-components-skills --skill syncfusion-blazor-dataform

简介

数据表单组件,简化实体属性的编辑和验证流程。syncfusion-blazor-dataform 属于研究检索类 Skill,可作为该场景下的辅助能力补充。

  • 适用于 CRUD 操作界面,自动生成标签、输入框和提交按钮。
  • 支持双向数据绑定,变更后自动同步到后端模型对象。
  • 字段级验证规则需在服务端复验,防止客户端绕过导致数据异常。
  • 批量编辑时建议采用差异比对算法,减少不必要的网络请求。

SKILL.md

Implementing Syncfusion Blazor DataForm Component

A comprehensive skill for implementing the Syncfusion Blazor DataForm component. This skill covers installation, configuration, data binding, validation, event handling, templating, and customization of forms in Blazor applications.

Component Overview

The Syncfusion Blazor DataForm (SfDataForm) is a powerful form component that streamlines the creation of dynamic, data-driven forms with automatic validation, field binding, and event handling. It supports:

  • Automatic field generation from model properties
  • Built-in validation with data annotations and custom rules
  • Multiple binding approaches (model, EditContext)
  • Customizable layouts with columns, grouping, and sections
  • Template-based rendering for custom field designs
  • Event-driven architecture for form and field-level reactions
  • Localization support for validation messages and UI text
  • Accessible form rendering with proper labels and ARIA attributes

Documentation and Navigation Guide

Getting Started

📄 Read: references/getting-started.md

Start here for installation, NuGet package setup, namespace imports, service registration, theme configuration, and a basic DataForm example.

  • Installation & NuGet packages
  • Blazor project setup (Server/WebAssembly/Web App)
  • Namespace imports & service registration
  • Theme setup & configuration
  • Basic DataForm creation
  • Running your first form

Form Items and Field Configuration

📄 Read: references/form-items.md

Learn how to define form items, configure labels, placeholders, hints, editor types, and customize individual field behavior.

  • FormItem element configuration
  • Label, placeholder configurations
  • Editor type selection
  • Disabling and hiding fields
  • Custom attributes (required, pattern, data annotations)
  • Form grouping and column organization

Auto-Generation of Form Fields

📄 Read: references/autogeneration.md

Discover how to automatically generate form fields from model properties using FormAutoGenerateItems, including type mapping and combining auto-generated with custom fields.

  • FormAutoGenerateItems overview
  • Type-to-component mapping (int, string, DateTime, bool, enum, etc.)
  • Auto-generating fields for primitive types
  • Combining auto-generated and custom fields
  • Canceling auto-generation for specific fields
  • Configuration options

Data Binding

📄 Read: references/data-binding.md

Understand model binding, EditContext binding, two-way data binding, and binding to complex data structures.

  • Model binding basics
  • EditContext binding approach
  • Form-level and field-level binding
  • Two-way binding with nested objects
  • Binding to complex models
  • Data initialization and default values
  • Form name and ID configuration

Form Validation

📄 Read: references/validation.md

Master form validation with data annotations, custom validation rules, Fluent Validation integration, and error message display.

  • Data annotation validation (Required, Range, EmailAddress, etc.)
  • DataAnnotationsValidator setup
  • Custom validation attributes and rules
  • Fluent Validation framework integration
  • Complex model validation scenarios
  • Displaying validation messages
  • IsValid() method and validation state
  • Conditional validation

Form and Field Events

📄 Read: references/events.md

Learn about form submission events and field-level events for handling user interactions and form state changes.

  • OnSubmit event (fires on every submit attempt)
  • OnValidSubmit event (fires only on valid submission)
  • OnInvalidSubmit event (fires only on validation failure)
  • OnUpdate event (fires on field value changes)
  • Event arguments and EditContext access
  • Asynchronous event handlers
  • Common event patterns

Layout Customization

📄 Read: references/layout-customization.md

Customize form layout with columns, column spans, label positioning, floating labels, and custom button placement.

  • Column layout configuration
  • Column span and row span
  • Columns count and responsiveness
  • Label positioning (top, left, floating)
  • Floating label styling
  • Button alignment and positioning
  • Custom submit/reset buttons
  • Form grouping with FormGroup

Templates and Custom Rendering

📄 Read: references/templates.md

Create custom form layouts and field renderings using FormTemplate and FormItemTemplate with render fragments.

  • FormTemplate for overall form layout customization
  • FormItemTemplate for individual field rendering
  • Template context and variables
  • Custom editor rendering
  • Render fragments and composition
  • Advanced template patterns
  • Template reusability

Localization

📄 Read: references/localization.md

Set up localization for validation messages, form labels, and error messages in multiple languages.

  • Built-in localization resources
  • Localizing error messages
  • Custom localization setup
  • Culture and language configuration
  • RTL (right-to-left) support

Quick Start Example

Here's a minimal working example to get started:

@page "/dataform-example"
@using System.ComponentModel.DataAnnotations
@using Syncfusion.Blazor.DataForm

<SfDataForm ID="MyDataForm"
            Model="@employeeModel">
    <FormValidator>
        <DataAnnotationsValidator></DataAnnotationsValidator>
    </FormValidator>
    <FormItems>
        <FormAutoGenerateItems></FormAutoGenerateItems>
    </FormItems>
</SfDataForm>

@code {
    public class EmployeeModel
    {
        [Required(ErrorMessage = "First Name is required")]
        [Display(Name = "First Name")]
        public string FirstName { get; set; }

        [Required(ErrorMessage = "Email is required")]
        [EmailAddress(ErrorMessage = "Invalid email address")]
        [Display(Name = "Email")]
        public string Email { get; set; }

        [Range(18, 65, ErrorMessage = "Age must be between 18 and 65")]
        [Display(Name = "Age")]
        public int Age { get; set; }

        [Display(Name = "Date of Birth")]
        public DateTime? DateOfBirth { get; set; }
    }

    private EmployeeModel employeeModel = new EmployeeModel();
}

Common Patterns

Pattern 1: Form with Validation and Submission

<SfDataForm ID="ContactForm" Model="@contact" OnValidSubmit="HandleValidSubmit">
    <FormValidator>
        <DataAnnotationsValidator></DataAnnotationsValidator>
    </FormValidator>
    <FormItems>
        <FormItem Field="@nameof(contact.Name)" LabelText="Full Name"></FormItem>
        <FormItem Field="@nameof(contact.Email)" LabelText="Email Address"></FormItem>
        <FormItem Field="@nameof(contact.Message)" EditorType="FormEditorType.TextArea"></FormItem>
    </FormItems>
</SfDataForm>

@code {
    private Contact contact = new();

    private async Task HandleValidSubmit(EditContext context)
    {
        // Save contact to database
        await SaveContactAsync(contact);
    }
}

Pattern 2: Auto-Generated Form with Custom Fields

<SfDataForm Model="@product">
    <FormItems>
        <FormItem Field="@nameof(product.Name)" LabelText="Product Name"></FormItem>
        <FormAutoGenerateItems></FormAutoGenerateItems>
        <FormItem Field="@nameof(product.Category)" EditorType="FormEditorType.DropDownList"></FormItem>
    </FormItems>
</SfDataForm>

@code {
    private Product product = new();
}

Pattern 3: Form with Cascading Fields

<SfDataForm Model="@order" OnUpdate="HandleFieldUpdate">
    <FormItems>
        <FormItem Field="@nameof(order.Country)" LabelText="Country"></FormItem>
        <FormItem Field="@nameof(order.City)" LabelText="City"></FormItem>
        <FormAutoGenerateItems></FormAutoGenerateItems>
    </FormItems>
</SfDataForm>

@code {
    private Order order = new();

    private async Task HandleFieldUpdate(FormUpdateEventArgs args)
    {
        if (args.FieldName == nameof(Order.Country))
        {
            // Update cities based on selected country
            order.City = await GetCitiesForCountryAsync(order.Country);
        }
    }
}

Pattern 4: Custom Layout with Columns

<SfDataForm Model="@employee" ColumnCount="2">
    <FormItems>
        <FormItem Field="@nameof(employee.FirstName)" LabelText="First Name" ColumnSpan="1"></FormItem>
        <FormItem Field="@nameof(employee.LastName)" LabelText="Last Name" ColumnSpan="1"></FormItem>
        <FormItem Field="@nameof(employee.Email)" LabelText="Email" ColumnSpan="2"></FormItem>
        <FormItem Field="@nameof(employee.Department)" LabelText="Department" ColumnSpan="1"></FormItem>
        <FormItem Field="@nameof(employee.Salary)" LabelText="Salary" ColumnSpan="1"></FormItem>
    </FormItems>
</SfDataForm>

@code {
    private Employee employee = new();
}

Key Properties and Methods

Common Properties

PropertyTypePurpose
ModelobjectThe data model bound to the form
EditContextEditContextBlazor EditContext for advanced binding scenarios
ColumnCountintNumber of columns for form layout
OnValidSubmitEventCallbackFires when form is submitted with valid data
OnInvalidSubmitEventCallbackFires when form is submitted with invalid data
OnSubmitEventCallbackFires on every submit attempt
OnUpdateEventCallbackFires when a field value changes

Available FormEditorType Values

Important: In most cases, you don't need to specify EditorType as the DataForm automatically selects the appropriate editor based on your model property type. Use these values only when you need to override the default behavior.

FormEditorTypeUse CaseWhen to Use
TextBoxSingle-line text inputOverride for string fields (default), not needed for numeric types
TextAreaMulti-line text inputWhen you need multi-line text entry for string properties
DatePickerDate selection onlyOverride for DateTime (default for DateTime)
DateTimePickerDate and time selectionWhen you need both date and time for DateTime properties
TimePickerTime selection onlyWhen you need only time selection for TimeSpan or DateTime
DropDownListDropdown selection from listFor enum or custom list selection
ComboBoxEditable dropdown with filteringWhen you need searchable dropdown
AutoCompleteAuto-complete with suggestionsWhen you need auto-suggest functionality
CheckboxBoolean toggle (note: lowercase 'b')Override for bool (default), NOT CheckBox
SwitchToggle switch for booleanAlternative to checkbox for bool properties
PasswordPassword input with maskingFor password string fields

Critical Notes:

  • ⚠️ Automatic Type Mapping: The DataForm intelligently maps C# types to appropriate editors automatically:

- int, long, decimal, double, float → Numeric textbox (no EditorType needed) - string → Textbox (no EditorType needed) - bool → Checkbox (no EditorType needed) - DateTime → DatePicker (no EditorType needed) - enum → DropDownList (no EditorType needed)

  • ⚠️ Use Checkbox (lowercase 'b'), NOT CheckBox (capital B)
  • ⚠️ There is NO NumericTextBox editor type - numeric behavior is automatic based on property type
  • ⚠️ Only specify EditorType when you want to override the default behavior

Common Methods

MethodPurpose
Refresh()Refresh form and re-render fields
Submit()Programmatically submit the form
Reset()Clear form and reset to initial values
IsValid()Check if form is valid
Validate()Trigger validation without submitting

Important EditorType Guidelines

When configuring FormItem elements with EditorType, keep these critical points in mind:

  1. Automatic Editor Selection: The DataForm automatically selects the appropriate editor based on your model property type. You typically don't need to specify EditorType unless you want to override the default behavior.

- Numeric properties (int, long, float, decimal, double) → Automatically render as numeric textbox - String properties → Automatically render as textbox - Boolean properties → Automatically render as checkbox - DateTime properties → Automatically render as date picker - Enum properties → Automatically render as dropdown

  1. When to Specify EditorType: Only specify EditorType when you want to override the default:

- Use FormEditorType.TextArea for multi-line string input - Use FormEditorType.Switch instead of checkbox for boolean - Use FormEditorType.DateTimePicker instead of DatePicker for DateTime with time - Use FormEditorType.Password for password strings - Use FormEditorType.DropDownList or ComboBox for custom lists

  1. Checkbox Casing: When explicitly specifying checkbox, use FormEditorType.Checkbox with lowercase 'b', not FormEditorType.CheckBox.
  2. No NumericTextBox Type: There is no FormEditorType.NumericTextBox. Numeric behavior is automatic based on property type.

Example:

<!-- Numeric field - EditorType not needed, automatically renders numeric textbox -->
<FormItem Field="@nameof(model.Quantity)"
          LabelText="Quantity">
</FormItem>

<!-- Boolean field - EditorType not needed, automatically renders checkbox -->
<FormItem Field="@nameof(model.IsActive)"
          LabelText="Is Active">
</FormItem>

<!-- String field with TextArea override -->
<FormItem Field="@nameof(model.Description)"
          LabelText="Description"
          EditorType="FormEditorType.TextArea">
</FormItem>

<!-- Boolean field with Switch override -->
<FormItem Field="@nameof(model.IsEnabled)"
          LabelText="Enabled"
          EditorType="FormEditorType.Switch">
</FormItem>

Related Skills

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

36.05%
按下载量换算122

Claude

30.13%
按下载量换算102

Cursor

19.73%
按下载量换算67

Gemini CLI

10.15%
按下载量换算34

安全审计

Gen Agent Trust Hub

通过

Socket

通过

Snyk

通过

权限和风险

只读

该 Skill 主要提供规则、说明或参考内容,本身偏只读;真正读写文件、联网或执行命令仍取决于宿主 Agent 的任务。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills