Jump to content
Xtreme .Net Talk

Recommended Posts

Posted (edited)

Hi

 

I have a dynamic datagrid CTL embedded in a multi page view aspx page. When i run the web app and click on a button in the dg the item command event wont fire up.

 

 

Here is my CTL HTML Code

 

<%@ Control Language="vb" EnableViewState="true" AutoEventWireup="True" Inherits="MyositisPresentation.ImagingListCTL" CodeFile="ImagingListCTL.ascx.vb" %>

<%@ Register TagPrefix="iewc" Namespace="Microsoft.Web.UI.WebControls" Assembly="Microsoft.Web.UI.WebControls" %>

<LINK href="../NUTH_main.css" type="text/css" rel="stylesheet">

<TABLE height="100%" cellSpacing="5" cellPadding="0" width="100%" border="0">

<tr vAlign="bottom">

<td vAlign="top" align="left" width="70%" colSpan="1">

<table height="100%" cellSpacing="0" cellPadding="0" width="100%" border="0">

<tr>

<td align="center" width="100%"><asp:textbox id="fMessage" CssClass="fMessageNormal" runat="server" height="25" ReadOnly="True"

Width="100%"></asp:textbox></td>

</tr>

</table>

</td>

</tr>

<tr>

<TD class="menulabels" align="center" width="70%">Patient Images<BR>

<TABLE class="NUTHTable" cellSpacing="2" cellPadding="0" width="100%" border="0">

<TR vAlign="top">

<TD align="center" width="100%">

<asp:datagrid id="dgImaging" runat="server" AutoGenerateColumns="False" AllowPaging="True" OnItemCreated="dgImaging_ItemCreated"

pagesize="8" OnEditCommand ="MaintainImaging_Click" PagerStyle-Visible="False">

<Columns>

<asp:BoundColumn Visible="False" HeaderText="anchor"></asp:BoundColumn>

<asp:TemplateColumn ItemStyle-Wrap="False">

<HeaderStyle CssClass="menulabels"></HeaderStyle>

<ItemStyle Wrap="False" CssClass="menulabels" VerticalAlign="Top"></ItemStyle>

<ItemTemplate>

<asp:imagebutton toolTip="View Imaging Details" runat="server" imageurl="../images/icon_view.gif"

ID="fBTNViewImagingDetails" CommandName="ViewImagingDetails"></asp:imagebutton>

</ItemTemplate>

</asp:TemplateColumn>

<asp:TemplateColumn>

<HeaderStyle CssClass="menulabels"></HeaderStyle>

<ItemStyle Wrap="False" CssClass="menulabels" VerticalAlign="Top"></ItemStyle>

<HeaderTemplate>

<asp:imagebutton toolTip="Add Patient Image" runat="server" imageurl="../images/icon_add.gif" ID="fBTNAddPatientImage"

CommandName="AddPatientImage" />

</HeaderTemplate>

<ItemTemplate>

<asp:imagebutton toolTip="Delete Patient Image" runat="server" imageurl="../images/icon_delete.gif"

ID="fBTNDeletePatientImage" CommandName="DeletePatientImage"></asp:imagebutton>

<asp:imagebutton toolTip="Edit Patient Image" runat="server" imageurl="../images/icon_edit.gif" ID="fBTNEditPatientImage"

CommandName ="EditPatientImage"></asp:imagebutton>

</ItemTemplate>

</asp:TemplateColumn>

<asp:TemplateColumn ItemStyle-Wrap="False">

<HeaderStyle CssClass="menulabels"></HeaderStyle>

<ItemStyle Wrap="False" CssClass="menulabels" VerticalAlign="Top"></ItemStyle>

<ItemTemplate>

<asp:imagebutton toolTip="View Imaging Presentation" runat="server" imageurl="../images/icon_screen2.gif"

ID="fBTNViewImagingPresentation" CommandName="ViewImagingPresentation" ></asp:imagebutton>

</ItemTemplate>

</asp:TemplateColumn>

</Columns>

<PagerStyle Visible="False"></PagerStyle>

</asp:datagrid>

</TD>

</TR>

</TABLE>

</TD>

</tr>

</TABLE>

 

This is the method that wont fire up after a button click

 

Public Sub MaintainImaging_Click(ByVal sender As System.Object, ByVal e As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles dgImaging.ItemCommand

lcommandname = e.CommandName

 

If Trim(lcommandname) = "AddPatientImage" Then

ElseIf Trim(lcommandname) = "DeletePatientImage" Then

ElseIf Trim(lcommandname) = "EditPatientImage" Then

ElseIf Trim(lcommandname) = "ViewPatientImage" Then

End If

 

End Sub

Edited by Bill Humphrey

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...