Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

AspDotNetStoreFront
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

telerik
ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  Datagrid Editing or Pop up Window
Previous Previous
 
Next Next
New Post 9/28/2006 11:44 AM
User is offline Tracy Ryan
4 posts
10th Ranked


Datagrid Editing or Pop up Window 
I really need some help.  I'm a novice DNN programmer at best.  I've written a couple of simple modules that hit a webservice and display the data returned in a datagrid with custom columns.  That part I have down.

For my next trick I need to hit a database, display the returned information, then allow the user to select a row, enter an identification number for the row and email the results somewhere.  I don't necessarily need to save the data back to a database (YET!) but I'm having a heck of a time getting this task accomplished.  If I were working in straight ASP I'd have had this done two weeks ago, but since I'm still learning .net and datagrids not to mention integrating in the DNN framework, I'm struggling.  I'm using nested datagrids at this point to display my data.  My dataset has two tables, Customers and Customer Details.  The main grid has the customers displayed and if you click on each customer, the customer details are displayed.  For the Customer grid I'm using HierarGrid control from Denis Bauer (http://www.denisbauer.com/ASPNETControls/HierarGrid.aspx).  For the customer detail grid I'm using the default one that comes with .net Visual Studio 2003.  My editing I need done on the nested grid.

Essentially, I would like to do one of two things...

Either
#1.  Make a link out of one of my columns using "asp:HyperLinkColumn" in the datagrid and then pop up a window that has a form that will allow the user to enter the necessary information.  Once all information is entered, press submit and have that form email the information to a certain person.
--- I'm attempting this route but I can't get the "DataNavigateUrlformatString" set properly to launch my web page correctly within DNN.  I did get it to work by hardcoding a path in but DNN gave me the following error
**************************************
This type of page is not served.
Description: The type of page you have requested is not served because it has been explicitly forbidden. The extension '.ascx' may be incorrect. Please review the URL below and make sure that it is spelled correctly.

**************************************
Not to mention that hardcoding is not a long term solution when wanting to go from a test environment to production.


#2.  Utilize the edit datagrid functionality.  I've seen examples of how to edit datagrids but I can't seem to make it work in the DNN framework.  If someone has a good example of this I'd be very grateful to see it.  Another problem I've had with this approach is that when I'm trying to set up my edit column (example below)

**************************************

<asp:EditCommandColumn ButtonType="LinkButton" UpdateText="&lt;img src='images/update.gif' border=0 align=absmiddle
   alt='Save changes' /&gt;" CancelText="&lt;img src='images/Undo.gif' border=0 align=absmiddle alt='Cancel changes' /&gt;"
   EditText="&lt;img src='images/edit.gif' border=0 align=absmiddle alt='Edit record' /&gt;">
   <ItemStyle Width="7%"></ItemStyle>
</asp:EditCommandColumn>
**************************************
I can't get the path correct on my images, not to mention that when I press the edit button my outer customer grid data disappears, like the visible property was set to false, the grid itself is still there but the data in the grid is gone.


Also, with the edit datagrid approach, I'd still not need to update a dataset as of yet but would still need to take data entered by user and email it to a person.


Any help would be greatly appreciated!  Please let me know if I need to post more details.  

One more thing.  I'm working with Visual Studio 2003 and DNN 3.2.2.  We are trying to prepare to upgrade to 4.3 but that's another story!

Thanks,
Tracy

 
New Post 9/29/2006 12:38 PM
User is offline Tracy Ryan
4 posts
10th Ranked


Re: Datagrid Editing or Pop up Window 
Goodness, no replies.

I'd take pointers on either.  Even a tip on how to make a pop up window work correctly with the HyperLinkColumn.  Surely someone has had the same issue?

cheers.
 
New Post 9/29/2006 2:24 PM
User is offline ech01
628 posts
7th Ranked




Re: Datagrid Editing or Pop up Window 
Modified By ech01  on 9/29/2006 5:26:07 PM)

A couple points that may help you, Tracy.

Your on the right track with option number 1, except instead of popping up a window or using the DataNavigateUrlformatString, you would redirect to an edit control. This is because you can't navigate to an ascx control because it's not a web page, it's just a control.

Here is an example of one of my modules (i stripped alot out, so syntax wise it may not be 100%)

ascx (this is a datalist for categories, and a nested datagrid with associated topics)
<asp:DataList id="dlCats" runat="server" RepeatLayout="Flow">
 <ItemTemplate>
  <table border="1" width="550" ID="Table1">
   <tr>
    <td colspan="2" noWrap bgColor="silver">
     <asp:Label Runat="server" id="lblCatName" visible="true" text='<%# DataBinder.Eval(Container.DataItem,"CatName") %>' >
     </asp:Label>
    </td>
   </tr>
   <tr>
    <td>
     <asp:DataGrid id="grdTopics" DataKeyField="TopicId" AutoGenerateColumns="False" Runat="server" OnItemCommand="grdTopics_ItemCommand" DataSource='<%# BuildSummary(DataBinder.Eval(Container.DataItem,"TopicCatId")) %>' >
      <Columns>
       <asp:BoundColumn Visible="False" DataField="TopicID" HeaderText="TopicID"></asp:BoundColumn>
       <asp:TemplateColumn HeaderText="Topic" ItemStyle-Width="75%">
        <ItemTemplate>
         <asp:LinkButton id="cmdView" CommandArgument='<%# DataBinder.Eval(Container.DataItem,"TopicId") %>' CommandName="Select" Runat="server" CssClass="CommandButton">
          <%# DataBinder.Eval(Container.DataItem,"TopicName") %>
         </asp:LinkButton>
        </ItemTemplate>
       </asp:TemplateColumn>
       <asp:BoundColumn DataField="Cert_Date_d" HeaderText="Date Complete" ItemStyle-Width="25%" ItemStyle-CssClass="Normal"></asp:BoundColumn>
      </Columns>
     </asp:DataGrid>
    </td>
   </tr>
  </table>
 </ItemTemplate>
</asp:DataList>

VB codebehind
'This fills the nested topic grid
Function BuildSummary(ByVal TopicID As Integer) As ArrayList
   Dim objCtrl As New SummaryController
   Dim arr As ArrayList
       arr = objCtrl.GetSummary(TopicID)
   Return arr
End Function

'This is the grid command event
Public Sub grdTopics_ItemCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) 
   Try
     If CType(e.CommandSource, LinkButton).CommandName = "Select" Then
        Dim TopicID As Integer = CType(e.CommandArgument, Int16)
        Response.Redirect(NavigateURL(TabId, "EditTopic", "Mid=" & ModuleId & "&TopicID=" & TopicID))
     End If
   Catch exc As Exception 'Module failed to load
      ProcessModuleLoadException(Me, exc)
   End Try
End Sub

That would go to your edit page, which you load all the editable stuff into text boxes, or whatever, based on the TopicId parameter.

Technically, you don't even have to go to another page, you could do all of it on one page with panels. Stick your grids in one panel that is set to visible, and all your edit fields in a non-visible panel. When the ItemCommand  fired, load the data into your edit controls and switch the visibility on the panels. Rebind the grids after the edit, and set the panel visibility.

I hope these options help. They work well for me.


www.blackhawksurfaces.com | www.nlsales.com | www.midwestfilmandvideo.com
 
New Post 11/6/2007 10:55 PM
User is offline Jari
1 posts
10th Ranked


Re: Datagrid Editing or Pop up Window 

Hello,

I have tryed example based our example code. When Edit link on the row was clicked, it does not fire ItemCommand event. Why?

I have tried to put single commandbutton to my "EditItem.ascx" but same results: It does not fire "Button1_Click" event. What I do wrong? 

 

Thanks for you advices!

Best Regards,

Jari Seppälä

 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  Datagrid Editing or Pop up Window
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, 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 DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


UK - DotNetNuke providers
UK providers of DNN module development and skin package design. Oxford Information Labs provides cost-effective solutions for businesses and organisations specialising in Skin design and bespoke module development.
www.oxil.co.uk
TronixSoft
Hosting for local businesses that want more from their websites.
www.TronixSoft.com
The Forerunner Network
The Forerunner Network consists of a group of Dynamic Website & Interactive Membership Portal hosting services that are managed by Forerunner Communications. Our services span a wide range of markets and enable individuals, organizations and businesses to build and manage dynamic, interactive portals and websites.
The Forerunner Network

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP