Coding With Fun
Home Docker Django Node.js Articles Python pip guide FAQ Policy

Which is the gridview component in blazor syntax?


Asked by Miranda Case on Dec 04, 2021 FAQ



The GridView component is meant to emulate the asp:GridView control in markup and is defined in the System.Web.UI.WebControls.GridView class Currently, not every syntax element of Web Forms GridView is supported. In the meantime, the following GridView in Blazor syntax will only include the implemented ones.
Besides,
As you can see there are 2 components: Grid and GridColumn. The Grid component is responsible for the rendering of the table. The GridColumn defines a column to be rendered by the Grid and the cell content using an expression or a template. Blazor cannot infer the type of GridColumn generic type, so you must specify it using TRowData.
Similarly, It uses the combination of Razor, HTML and C# code as a component. A component is the base element of the Blazor application, i.e., every page is considered as a component in Blazor. Blazor use the Razor template engine that generate HTML and served to web browsers.
Keeping this in consideration,
The syntax for using a component in Razor is similar to using a user control in an ASP.NET Web Forms app. Components are specified using an element tag that matches the type name of the component. For example, you can add a Counter component like this: Unlike ASP.NET Web Forms, components in Blazor: Don't use an element prefix (for example, asp: ).
Thereof,
The RenderFragment is a part of UI which is rendered by the component. It may have parameters that are used during the rendering of the component or while the RenderFragment is invoked. A ListView component allows us to define a template for rendering each item of the list.