More in this section

User Control

6 posts, 0 answered
  1. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    15 Dec 2009
    Link to this post
    hi
    i m using a user control in a page and that user control contains a gridview with a RowCommand event.
    But the rowCommand event don't fire.
    Yesterday it was working fine.But i can't know how it is not working now.
    pease help me.
  2. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    15 Dec 2009
    Link to this post
    Hi asit pani,

     Could you post a sample code? Generally you could take a look at the following sample GridView.RowCommand Event


    Best wishes,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    15 Dec 2009
    Link to this post
    hi
    thanks for ur quick reply.

    below is my html code.

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="ucWaiverSearch.ascx.cs"
        Inherits="QFC_Components_PublicRegister_Search_Waiver_Usercontrols_ucWaiverSearch" %>

    <script type="text/javascript">
        function openpopup(path)
        {
    //    alert("hi");
            window.open(path, 'pdf', 'width=600,height=450,status=yes,toolbar=no,menubar=no,location=no,resizable=yes');
        }
    </script>

    <%--<asp:ScriptManager ID="TheScriptManager" runat="server" EnablePartialRendering="true"
        AsyncPostBackTimeout="600" EnableScriptGlobalization="true">
    </asp:ScriptManager>--%>
    <h1>
        Public Register</h1>
    <h2>
        Waiver Search</h2>
    <div id="dvsearch" runat="server">
        <span class="frmCntLft">Search by any / all of the following</span><span class="frmCntRgt">
            <asp:ImageButton ID="imgbtndisplayall" runat="server" AlternateText="Search.." ImageUrl="/Images/img_DisplayAll.gif" OnClick="imgbtndisplayall_Click" />
        </span>
        <div class="publicReg">
            <div class="CroSearchInput">
                <div class="FieldName">
                    Notice Number:</div>
                <asp:TextBox ID="txtNoticeNumber" Width="200" TabIndex="1" runat="server" CssClass="text dirLtr"
                    MaxLength="100"></asp:TextBox>
            </div>
            <div class="CroSearchInput">
                <div class="FieldName">
                    Firm Name:</div>
                <asp:TextBox ID="txtFirmName" Width="200" TabIndex="1" runat="server" class="text dirLtr"
                    MaxLength="100"></asp:TextBox>
            </div>
            <div class="CroSearchInput">
                <div class="FieldName">
                    QFC Number #:</div>
                <asp:TextBox ID="txtQFCNumber" Width="200" TabIndex="1" runat="server" CssClass="text dirLtr"
                    MaxLength="100"></asp:TextBox>
            </div>
            <div class="CroSearchInput">
                <div class="FieldName">
                    Effective Date:</div>
                <telerik:raddatepicker id="rdpEffectiveDatefrom" runat="server" width="140px" dateinput-emptymessage="Effective Date">
                        <Calendar>
                            <SpecialDays>
                                <telerik:RadCalendarDay Repeatable="Today"/>
                            </SpecialDays>
                        </Calendar>
                    </telerik:raddatepicker>
                to
                <telerik:raddatepicker id="rdpEffectiveDateto" runat="server" width="140px" dateinput-emptymessage="Effective Date">
                        <Calendar>
                            <SpecialDays>
                                <telerik:RadCalendarDay Repeatable="Today"/>
                            </SpecialDays>
                        </Calendar>
                    </telerik:raddatepicker>
            </div>
            <div class="CroSearchInput">
                <div class="FieldName">
                    Status:</div>
                <asp:DropDownList ID="ddlStatus" CssClass="inputFieldText qfcDropdownsPR" runat="server">
                </asp:DropDownList>
            </div>
            <div class="CroSearchInput">
                <div class="FieldName">
                    &nbsp;
                </div>
                <asp:ImageButton ID="imgbtnsearch" runat="server" AlternateText="Search.." ImageUrl="/Images/en_search_media.gif"
                    OnClick="imgbtnsearch_Click" />
                <asp:ImageButton ID="imgbtnclear" runat="server" AlternateText="Clear" ImageUrl="/Images/img_clear.gif" OnClick="imgbtnclear_Click" />
            </div>
            <br class="clear" />
        </div>
    </div>

    <div id="dvGridsearch" runat="server" visible="false">
        
    </div>

    <asp:GridView ID="grdWaiversearch" runat="server" AutoGenerateColumns="False" AllowPaging="True"
            AllowSorting="True" Width="665" CssClass="tablePad" CellPadding="6" PageSize="10"
            OnPageIndexChanging="grdWaiversearch_PageIndexChanging"
            OnRowDeleting="grdWaiversearch_RowDeleting" OnRowEditing="grdWaiversearch_RowEditing"
            OnSorting="grdWaiversearch_Sorting"
           
            OnRowCommand="grdWaiversearch_RowCommand" OnRowDataBound="grdWaiversearch_RowDataBound">
            <Columns>
                <asp:BoundField DataField="QFCNumber" HeaderText="QFC #" SortExpression="QFCNumber"
                    HeaderStyle-CssClass="heading"></asp:BoundField>
                <asp:TemplateField HeaderText="Firm Name">
                    <ItemTemplate>
                        <asp:LinkButton ID="lnkFirmName" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "FirmName") %>'
                            CommandName="detail" CommandArgument='<%# DataBinder.Eval(Container.DataItem, "FirmId") %>'></asp:LinkButton></ItemTemplate>
                    <ItemStyle CssClass="imgMid" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Notice Number" ItemStyle-CssClass="imgMid">
                    <ItemTemplate>
                        <%--<a id="lnkcro" href='<%# DataBinder.Eval(Container.DataItem, "PDF") %>' onclick="openpopup(this.href);return false;">
                            <%# DataBinder.Eval(Container.DataItem, "NoticeNumber")%>
                        </a>--%>
                        <asp:LinkButton ID="lnkbtncro" runat ="server" PostBackUrl='<%# DataBinder.Eval(Container.DataItem, "PDF") %>' Text='<%# DataBinder.Eval(Container.DataItem, "NoticeNumber")%>' ></asp:LinkButton>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:BoundField DataField="Type" HeaderText="Type" SortExpression="Type" HeaderStyle-CssClass="heading">
                </asp:BoundField>
                <asp:BoundField DataField="Legislation" HeaderText="Legislation" SortExpression="Legislation"
                    HeaderStyle-CssClass="heading"></asp:BoundField>
                <asp:BoundField DataField="EffectiveDateFrom" HeaderText="Effective Date" SortExpression="EffectiveDateFrom"
                    HeaderStyle-CssClass="heading"></asp:BoundField>
                <asp:BoundField DataField="WaiverModificationStatusValue" HeaderText="Status" SortExpression="WaiverModificationStatusValue"
                    HeaderStyle-CssClass="heading"></asp:BoundField>
            </Columns>
            <EmptyDataTemplate>
                <asp:Label ID="lblGridCRO" runat="server" Text="No records found"></asp:Label>
            </EmptyDataTemplate>
            <HeaderStyle BorderColor="black" Font-Bold="True" CssClass="headerLink" />
             </asp:GridView>
        <br class="clear" />
        <span class="frmCntRgt">
            <asp:ImageButton ID="Imgbtnsearchwaiver" runat="server" AlternateText="Search.." ImageUrl="~/Images/img_searchWaivers.gif" OnClick="Imgbtnsearchwaiver_Click" />
            <asp:ImageButton ID="imgbtndisplayallgrid" runat="server" AlternateText="Search.."
                ImageUrl="/Images/img_DisplayAll.gif" OnClick="imgbtndisplayallgrid_Click" />
        </span>


    -------------------------------------

    this is my code behind.

    protected void grdWaiversearch_RowCommand(object sender, GridViewCommandEventArgs e)
        {
            if (e.CommandName == "detail")
            {
                Response.Redirect("~/Public-register/firm_details.aspx?id=" + e.CommandArgument.ToString());
                //Response.Redirect("~/QFC_Components/PublicRegister/Search/Firm/firmdetails.aspx?id=" + e.CommandArgument.ToString());
            }
        }
  4. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    15 Dec 2009
    Link to this post
    Hi asit pani,

    As I see it Radoslav sent you  reply earlier today - Gridview RowCommand


    Greetings,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  5. Asit
    Asit avatar
    87 posts
    Registered:
    07 Nov 2009
    16 Dec 2009
    Link to this post
    Hi thanks for ur reply.  I had gone through the code that u mentioned. But still the gridview row command not firing .
    Actually i m taking 2 div. is there any possibility of not firing the event  due to the div?

    because i hav 2 image buttons below the gridview in the same div and the click event of the imagebuttons also not firing.
  6. Ivan Dimitrov
    Ivan Dimitrov avatar
    16072 posts
    Registered:
    12 Sep 2017
    16 Dec 2009
    Link to this post
    Hello asit pani,

    Generally the divs should not be a problem, but it depends on the css you set. You could try removing the divs and see whether the control will work correctly. It works fine for us.


    Regards,
    Ivan Dimitrov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Register for webinar
6 posts, 0 answered