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

HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...GridView RowCommand Event not firingGridView RowCommand Event not firing
Previous
 
Next
New Post
1/23/2012 1:57 PM
 

Hello All,

I am developing modules to extend the functioanlity of my DNN application.

I am using a GridView and am not able to get the Delete functionality working fine.

I have got Edit to work fine but Delete Does not.

I am trying to raise the RowCommand method of the GridView but it does not work well with DNN.

 

Any known issues or is it just that I am doing something wrong here. Please suggest.

Here is what the Grid looks like.

 <asp:GridView ID="grdVaccineChart" runat="server" GridLines="None" AutoGenerateColumns="false"
        Visible="true" EnableViewState="False" CssClass="dnnGrid"
        OnRowDataBound="OnVaccineChartRowDataBound"
        OnRowCommand="OnVaccineChartRowCommand">
        <HeaderStyle CssClass="dnnGridHeader" VerticalAlign="Top" />
        <RowStyle CssClass="dnnGridItem" HorizontalAlign="Left" />
        <AlternatingRowStyle CssClass="dnnGridAltItem" />
        <FooterStyle CssClass="dnnGridFooter" />
        <PagerStyle CssClass="dnnGridPager" />
        <Columns>
            <asp:TemplateField HeaderText="Delete">
                <ItemTemplate>
                    <asp:HyperLink ID="editButton" Text="Edit" runat="server" CssClass="SkinObject" />
                    <asp:LinkButton ID="deleteButton" runat="server" CssClass="SkinObject" CommandName="DeleteVaccine" CausesValidation="false"
                        Text="Delete" OnClientClick="return confirm('Are you sure you want to delete this user?');" />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="VaccineName" HeaderText="Vaccine" ItemStyle-HorizontalAlign="Center"
                SortExpression="VaccineName" ItemStyle-Width="14%">
                <ItemStyle HorizontalAlign="Center" Width="14%"></ItemStyle>
            </asp:BoundField>
            <asp:BoundField DataField="Period" HeaderText="Vaccine Period" ItemStyle-HorizontalAlign="Center"
                SortExpression="Period" ItemStyle-Width="14%">
                <ItemStyle HorizontalAlign="Center" Width="14%"></ItemStyle>
            </asp:BoundField>
            <asp:BoundField DataField="Duration" HeaderText="Vaccine Duration" ItemStyle-HorizontalAlign="Center"
                SortExpression="Duration" ItemStyle-Width="14%">
                <ItemStyle HorizontalAlign="Center" Width="14%"></ItemStyle>
            </asp:BoundField>
            <asp:BoundField DataField="Period2" HeaderText="Vaccine Period 2" ItemStyle-HorizontalAlign="Center"
                SortExpression="Period2" ItemStyle-Width="14%">
                <ItemStyle HorizontalAlign="Center" Width="14%"></ItemStyle>
            </asp:BoundField>
            <asp:BoundField DataField="Duration2" HeaderText="Vaccine Duration 2" ItemStyle-HorizontalAlign="Center"
                SortExpression="Duration2" ItemStyle-Width="14%">
                <ItemStyle HorizontalAlign="Center" Width="14%"></ItemStyle>
            </asp:BoundField>
            <asp:BoundField DataField="VaccinePurpose" HeaderText="Purpose" SortExpression="VaccinePurpose"
                ItemStyle-HorizontalAlign="Center">
                <ItemStyle HorizontalAlign="Center" />
            </asp:BoundField>
        </Columns>
        <EmptyDataTemplate>
            <div class="dnnFormMessage dnnFormWarning">
                <%= NoVaccineChart %></div>
        </EmptyDataTemplate>
    </asp:GridView> 

 

And the code behind looks like below:

 

protected void OnVaccineChartRowCommand(object sender, GridViewCommandEventArgs e)
        {

            if (e.CommandName == "DeleteVaccine")
            {
                Int32 vaccineId = Convert.ToInt32(e.CommandArgument);
                AddEditVaccineController objAddEditVaccines = new AddEditVaccineController();
                objAddEditVaccines.DeleteAddEditVaccine(vaccineId);
            }
        }

 

 Thanks a lot ..

Ashutosh

 
New Post
1/23/2012 2:00 PM
 

Greetings Ashutosh ~

May I suggest that you also post this question in a new area that we have recently launched, called the Community Exchange?  It's specifically geared toward helping folks get answers to specific questions like yours.

Cheers!


Scott Willhite, Co-Founder DNN

"It is only with the heart that one can see rightly... what is essential is invisible to the eye. "
~ Antoine de Saint-Exupéry

 
New Post
1/23/2012 3:31 PM
 

Thanks Scott for pointing me to the right direction.


I have posted the question there. Hoping to see a solution soon.


Thanks Again !

 
Previous
 
Next
HomeHomeUsing DNN Platf...Using DNN Platf...Using Modules a...Using Modules a...GridView RowCommand Event not firingGridView RowCommand Event not firing


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