FritzAndFriends / BlazorWebFormsComponents

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

Pass through ItemTypes to childcomponents #163

Open csharpfritz opened 4 years ago

csharpfritz commented 4 years ago

Example: For a GridView, need to pass the ItemType of the Grid through to the column child components so that we don't have to repeat the ItemType on each of the child components

grleachman commented 4 years ago

DEVNOTES

I've tried to think a little differently about this, and compared ListView and GridView

ListView GridView
Asp.Net 3.5. Asp.Net 2.0.
Template driven. Rendered as Table.
Built-in supports for Data grouping. Need to write custom code.
Built-in supports for Insert operation. Need to write custom code.
Provides flexible layout to your data. Need to write custom code.
Performance is fast is compared to GridView. Performance is slow as compared to ListView.

Which implies that a GridView is really a ListView short a few useful features. Read as : Specialisation of a ListView where we specialize down.

Even though an AspNet gridView and listView might have an intersect, but one isn't wholly a subclass of the other, we do not need that to be the case for BlazorWebComponents.

Remembering the objective that we should be able to paste the markup into our page, and the page should render. It doesn't really matter if there are extra features available for the GridView that weren't avaiable in webforms, but any extra GridView properties still need to be added.

Reviewing our current implementation, we see that the output is much the same: a table with head, body, tr and td.

committed this as an example if anyone wants to review and ponder. First test is working : src/BlazorWebFormsComponents.Test/GridView/AutogenerateColumns.razor nothing else works yet.. but I think this is an interesting POC and might be a useful approach for other components.

egil commented 4 years ago

I like the general idea of implementing the GridView through the ListView. Users should not see a difference on the surface.

csharpfritz commented 4 years ago

Very interesting approach... I like the simplicity of the approach and re-use of other components we've already completed

Jeff

On Fri, Apr 17, 2020 at 3:45 AM Egil Hansen notifications@github.com wrote:

I like the general idea of implementing the GridView through the ListView. Users should not see a difference on the surface.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/FritzAndFriends/BlazorWebFormsComponents/issues/163#issuecomment-615097200, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAATF4PFCAHELMMHXTXJNF3RNACK7ANCNFSM4MHWZITA .