FritzAndFriends / BlazorWebFormsComponents

A collection of Blazor components that emulate the ASP.NET Web Forms controls of the same name
MIT License
428 stars 72 forks source link

Add DataGrid Componant #272

Open gack2009 opened 1 year ago

gack2009 commented 1 year ago

Would be great if you can add a DataGrid support as we were using it heavily in our system or if there is an easy swappable already implemented component.

Sample ASPX code:

<asp:DataGrid ID="dgCountries" CellSpacing="2" CellPadding="1" runat="server" EnableViewState="true" CssClass="table" BorderWidth="0px" BorderStyle="None" DataKeyField="COUNTRY_ID" OnDeleteCommand="deleteCountry" AllowSorting="false" AutoGenerateColumns="false">

<ItemStyle CssClass="tableRow"></ItemStyle>
<HeaderStyle CssClass="tableHeader"></HeaderStyle>
<Columns>
    <asp:TemplateColumn HeaderText="Country">
        <HeaderStyle Width="100px"></HeaderStyle>
        <ItemTemplate>
            <asp:Label runat="server" Text='<%# htmlEncode(Container.DataItem, "COUNTRY_NAME")%>' ID="lblCountry">
            </asp:Label>
        </ItemTemplate>
    </asp:TemplateColumn>
    <asp:ButtonColumn HeaderStyle-Width="30" ItemStyle-CssClass="iconCell" Text="&lt;i class='deleteIcon' alt='Delete' title='Delete'&gt; &lt;/i&gt;"
        CommandName="Delete"></asp:ButtonColumn>
</Columns>

</asp:DataGrid>

hishamco commented 1 year ago

We already have a GridView component

FYI DataGrid was an ASP.NET 1.1 control, while GridView arrived in 2.0