asp.net - DotNetNuke: GridView incompatible with Data Access Layer? -
i'm working on dotnetnuke module in c#, , in order cut down on amount of complexity have elected try , keep configuration of module in 1 page (other standard settings module). wonder how wise of idea is.
my module simple image gallery, 1 or many images. each image has title, image source (url) , destination (another url). therefore, figured admin interface, have simple 'grid' of data can edit of existing entries or add new one, on same page, sort of this:
title image url anchor href [a picture! ] [http://www.example.com/image.jpg ] [http://www.example.com] [another picture!] [http://www.example.com/image2.jpg] [http://www.example.net] [ ] [ ] [ ]
looking through webcontrols, found gridview, @ first blush seemed sort of thing looking for. however, taking closer gander @ it, found needed bound directly data source, while seems dotnetnuke standard of doing things in data access layer create collection of data objects so:
// editdiscovery.ascx.cs discoverycontroller objdiscoverys = new discoverycontroller(); list<discoveryinfo> lstdiscoveries = objdiscoverys.getdiscoverys(moduleid); // discoverycontroller.cs public list<discoveryinfo> getdiscoverys(int moduleid) { return cbo.fillcollection<discoveryinfo>(dataprovider.instance().getdiscoverys(moduleid)); }
is there i'm missing gridview, or should changing getdiscoverys function return dataset opposed list of discoveryinfo objects? or there better approach things align better dotnetnuke's dal?
you should able set list of discoveryinfo
objects grid.
mygrid.datasource = lstdiscoveries; mygrid.databind();
Comments
Post a Comment