Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0GridView - AJAX(GridView - AJAX('Atlas') - ObjectDataSource - can anybody can help?
Previous
 
Next
New Post
12/7/2006 11:02 AM
 

Everyexample on the http://ajax.asp.net site points to using an objectdatasource or something like it to be able to have a gridview page,edit,sort etc. inside an update panel - now I can not find any examples where a GridView is wired up to something like a DAL so I wondered if it would be possible to wire up a ObjectDataSource in code to the DAL or better the DAL+ in DNN.

Now I would like to not have to add this extra control but I dont seem to be smart enough to figure out how to do it anyother way (maybe a webservice?) not sure here so could someone present some great ideas - or even bad ones

 

I have tried to do something like this

HTML-----------------

<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
    <ContentTemplate>
<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" AutoGenerateEditButton="True" DataSourceID="ObjectDataSource1">
    <Columns>
        <asp:BoundField DataField="CategoryName" HeaderText="Category" SortExpression="CategoryName" />
    </Columns>
   
</asp:GridView>
        &nbsp; &nbsp;
        &nbsp; &nbsp;
    </ContentTemplate>
    <Triggers>
<asp:AsyncPostBackTrigger ControlID="GridView1" EventName="RowCommand" />
</Triggers>

</asp:UpdatePanel>
        <asp:ObjectDataSource ID="ObjectDataSource1" runat="server"></asp:ObjectDataSource>

CODEBEHIND

 Dim colCodegalaxy_Classifiedss As List(Of Codegalaxy_Classifieds_Category_Info)
            ' get the content from the Codegalaxy_Classifieds table
            colCodegalaxy_Classifiedss = Codegalaxy_Classifieds_Admin_Controller.Codegalaxy_Classifieds_Admin_CategoryList(PortalId)

 

 

 

 

 

Me.ObjectDataSource1.DataBind()

Me.ObjectDataSource1.DeleteMethod = "" ---WHATEVER METHODS HERE

Dylan Barber http://www.braindice.com - Dotnetnuke development classes - skins and modules
 
New Post
12/17/2006 2:30 PM
 
Take a look at the ASP.NET AJAX website. There are great video tuturials on how to do this. Also binding to a grid view with editing etc.
 
New Post
12/17/2006 4:10 PM
 
famdylan wrote

I can not find any examples where a GridView is wired up to something like a DAL so I wondered if it would be possible to wire up a ObjectDataSource in code to the DAL or better the DAL+ in DNN.

 

I have an ObjectDataSource control wired to the DAL+ in my tutorial here:

Super-Fast Super-Easy Module (DAL+)

You will want to look at the tutorial because it explains how to insert the current ModuleId.

<asp:ObjectDataSource ID="ObjectDataSource_ThingsForSale" runat="server" DataObjectTypeName="YourCompany.Modules.ThingsForSale.ThingsForSaleInfo"
DeleteMethod
="ThingsForSale_Delete" InsertMethod="ThingsForSale_Insert" OldValuesParameterFormatString="original_{0}"
OnInit
="Page_Load" SelectMethod="ThingsForSale_SelectAll" TypeName="YourCompany.Modules.ThingsForSale.ThingsForSaleController"
UpdateMethod
="ThingsForSale_Update">
<
SelectParameters>
<
asp:Parameter DefaultValue="00" Name="ModuleId" Type="Int32" />
</
SelectParameters>
</
asp:ObjectDataSource>


<
asp:GridView ID="GridView1" runat="server" AllowPaging="True" AutoGenerateColumns="False"
DataSourceID="ObjectDataSource_ThingsForSale" DataKeyNames="ID,UserID,ModuleId" CellPadding="4" CellSpacing="1" EnableViewState="False">
<Columns>
<asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
<asp:BoundField DataField="UserID" HeaderText="UserID" SortExpression="UserID" Visible="False" />
<asp:BoundField DataField="ModuleId" HeaderText="ModuleId" SortExpression="ModuleId" Visible="False" />
<asp:BoundField DataField="ID" HeaderText="ID" SortExpression="ID" Visible="False" />
<asp:BoundField DataField="Category" HeaderText="Category" SortExpression="Category" />
<asp:BoundField DataField="Price" HeaderText="Price" SortExpression="Price" DataFormatString="{0:c}" HtmlEncode="False" />
<asp:BoundField DataField="Description" HeaderText="Description" SortExpression="Description" />
</Columns>
<EmptyDataTemplate>
There are no Things 4 Sale
</EmptyDataTemplate>
</
asp:GridView>



Michael Washington
http://ADefWebserver.com
www.ADefHelpDesk.com
A Free Open Source DotNetNuke Help Desk Module
 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0GridView - AJAX(GridView - AJAX('Atlas') - ObjectDataSource - can anybody can help?


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out