This is a migrated thread and some comments may be shown as answers.

Rad grid Command Events not firing

3 Answers 88 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ramakrishna Gopishetty
Top achievements
Rank 1
Ramakrishna Gopishetty asked on 17 Aug 2009, 08:40 PM
I have this strange problem. I have been using telerik controls for about 1 year now. i used extensively Rad Grid, never had problems.
I am migrating a project from .net 1.1 to 3.5 version. I created a new usercontrol which contains Rad Grid. on hitting Commnad Item "Add new record" which is automatically created. it is hitting initInsert Command, but when i enter the data and press insert or change the data and press update its not hitting item command. I have checked it many times.

 

 

 

 

 

<asp:Panel ID="panel1" runat="server">  
 
<table><tr><td> 
    <telerik:RadGrid ID="RadRelief" runat="server" AllowPaging="True" 
        AllowSorting="True" AutoGenerateColumns="False" GridLines="None"   
        Skin="Outlook" Width="794px" OnItemCommand="RadRelief_ItemCommand" OnInsertCommand="RadRelief_InsertCommand" OnUpdateCommand="RadRelief_UpdateCommand">  
        <PagerStyle NextPageText="&amp;gt;" PrevPageText="&amp;lt;" Mode="NextPrevAndNumeric">  
                </PagerStyle> 
        <MasterTableView CommandItemDisplay="Top" EditMode="InPlace">  
        <NoRecordsTemplate><div>No Records Found.</div></NoRecordsTemplate>  
        <Columns> 
        <telerik:GridTemplateColumn> 
        <EditItemTemplate> 
            <asp:ImageButton ID="ibUpdate" OnClick="ibUpdate_Click" runat="server" CommandName='<%# IIf( DataBinder.Eval(Container, "OwnerTableView.IsItemInserted"), "PerformInsert", "Update")  %>' ImageUrl="~/App_Themes/Operations/images/Icons/accept.gif" /> 
            <asp:ImageButton ID="ibCancel" runat="server" CausesValidation="false" CommandName="Cancel" ImageUrl="~/App_Themes/Operations/images/Icons/cancel.gif" /> 
            </EditItemTemplate> 
            <ItemTemplate> 
            <asp:HiddenField ID="hidvalue" runat="server" Visible="false" Value='<%# Eval("equipmentId") %>' /> 
            <asp:ImageButton ID="ibEdit" runat="server" CommandName="Edit" CausesValidation="false" ImageUrl="~/App_Themes/Operations/images/pencil.gif" /> 
            <asp:ImageButton ID="ibDelete" runat="server" OnClientClick="return PromptDelete();" CausesValidation="false" CommandName="Delete" ImageUrl="~/App_Themes/Operations/images/Icons/delete.gif" /> 
            </ItemTemplate> 
            <HeaderStyle Width="40px" /> 
        </telerik:GridTemplateColumn> 
        <telerik:GridBoundColumn DataField="reliefValveSequence" SortExpression="reliefValveSequence" ReadOnly="true" HeaderText="#">          
        <HeaderStyle Width="10px"></HeaderStyle></telerik:GridBoundColumn> 
        <telerik:GridBoundColumn DataField="reliefValveRunNumber" SortExpression="reliefValveRunNumber" ReadOnly="true" HeaderText="F">  
        <HeaderStyle Width="10px"></HeaderStyle></telerik:GridBoundColumn> 
        <telerik:GridTemplateColumn HeaderText="Set Point PSIG">  
        <ItemTemplate> 
        <asp:Literal ID="lit1" runat="server" Text='<%# Eval("reliefValveSetPointPressure") %>'></asp:Literal> 
        </ItemTemplate> 
        <EditItemTemplate> 
            <asp:TextBox ID="txtReliefValveSetPointPressure" runat="server" Text='<%# Eval("reliefValveSetPointPressure") %>'></asp:TextBox> 
            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" ControlToValidate="txtReliefValveSetPointPressure" runat="server" ErrorMessage="*Required">*</asp:RequiredFieldValidator> 
        </EditItemTemplate> 
        </telerik:GridTemplateColumn> 
          <telerik:GridTemplateColumn HeaderText="Conn. Pipe I.D.">  
       <ItemTemplate> 
        <asp:Literal ID="lit2" runat="server" Text='<%# Eval("connectingPipeInternalDiameter") %>'></asp:Literal> 
        </ItemTemplate> 
        <EditItemTemplate> 
            <asp:TextBox ID="txtConnectingPipeInternalDiameter" runat="server" Text='<%# Eval("connectingPipeInternalDiameter") %>'></asp:TextBox> 
            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" ControlToValidate="txtConnectingPipeInternalDiameter" runat="server" ErrorMessage="*Required">*</asp:RequiredFieldValidator> 
        </EditItemTemplate> 
        </telerik:GridTemplateColumn> 
          <telerik:GridTemplateColumn HeaderText="Type">  
         <ItemTemplate> 
        <asp:Literal ID="lit3" runat="server" Text='<%# Eval("coeffTypeCode") %>'></asp:Literal> 
        </ItemTemplate> 
        <EditItemTemplate> 
            <asp:TextBox ID="txtCoeffTypeCode" Width="65px" runat="server" Text='<%# Eval("coeffTypeCode") %>'></asp:TextBox> 
            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" ControlToValidate="txtCoeffTypeCode" runat="server" ErrorMessage="*Required">*</asp:RequiredFieldValidator> 
        </EditItemTemplate> 
        <HeaderStyle Width="70px" /> 
        </telerik:GridTemplateColumn> 
          <telerik:GridTemplateColumn HeaderText="Size">  
        <ItemTemplate> 
        <asp:Literal ID="lit4" runat="server" Text='<%# Eval("coeffSize") %>'></asp:Literal> 
        </ItemTemplate> 
        <EditItemTemplate> 
            <asp:TextBox ID="txtCoeffSize" Width="65px" runat="server" Text='<%# Eval("coeffSize") %>'></asp:TextBox> 
            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" ControlToValidate="txtCoeffSize" runat="server" ErrorMessage="*Required">*</asp:RequiredFieldValidator> 
        </EditItemTemplate> 
        <HeaderStyle Width="70px" /> 
        </telerik:GridTemplateColumn> 
          <telerik:GridTemplateColumn HeaderText="Description">  
       <ItemTemplate> 
        <asp:Literal ID="lit5" runat="server" Text='<%# Eval("coeffDesc") %>'></asp:Literal> 
        </ItemTemplate> 
        <EditItemTemplate> 
            <asp:TextBox ID="txtCoeffDesc" runat="server" Text='<%# Eval("coeffDesc") %>'></asp:TextBox> 
        </EditItemTemplate> 
        </telerik:GridTemplateColumn> 
        <telerik:GridTemplateColumn HeaderText="Additional Info.">  
       <ItemTemplate> 
            <asp:Literal ID="lit6" runat="server" Text='<%# Eval("reliefValveDesc") %>'></asp:Literal> 
        </ItemTemplate> 
        <EditItemTemplate> 
            <asp:TextBox ID="txtreliefValveDesc" runat="server" Text='<%# Eval("reliefValveDesc") %>'></asp:TextBox> 
        </EditItemTemplate> 
        </telerik:GridTemplateColumn> 
        </Columns> 
            <RowIndicatorColumn> 
                <HeaderStyle Width="20px" /> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="20px" /> 
            </ExpandCollapseColumn> 
        </MasterTableView> 
    </telerik:RadGrid> 
</td></tr></table> 
    <asp:ValidationSummary ID="ValidationSummary1" runat="server" /> 
</asp:Panel> 

 VB

Partial Public Class ReliefValueDE  
    Inherits System.Web.UI.UserControl  
    Protected WithEvents DataSet11 As MARRS.DataSet1  
    Private intCut As Int16 = 1  
    Protected WithEvents ibSelect As ImageButton  
 
    Protected Sub Page_Load(ByVal sender As ObjectByVal e As System.EventArgs) Handles Me.Load  
        DataSet11 = Session("DataSet11")  
    End Sub 
 
    Protected Sub FillGrid()  
        If intCut = 1 Then 
            FillReliefData("U")  
        Else 
            FillReliefData("D")  
        End If 
        RadRelief.DataSource = DataSet11.Tables("dbo.up_GetReliefValveByAssemblyId")  
    End Sub 
 
    Protected Sub FillReliefData(ByVal positionCode As String)  
        Dim myConnection As SqlConnection = New SqlConnection(MarrsDb.ConnectionString)  
        Dim myCommand As SqlCommand = New SqlCommand("up_GetReliefValveByAssemblyId", myConnection)  
        myCommand.CommandType = CommandType.StoredProcedure  
        Dim workParam As SqlParameter  
        workParam = New SqlParameter("@assemblyId", SqlDbType.Int)  
        workParam.Direction = ParameterDirection.Input  
        workParam.Value = DataSet11.GeneralInfo(0).AssemblyId  
        myCommand.Parameters.Clear()  
        myCommand.Parameters.Add(workParam)  
 
        workParam = New SqlParameter("@positionCode", SqlDbType.Text)  
        workParam.Direction = ParameterDirection.Input  
        workParam.Value = positionCode  
        myCommand.Parameters.Add(workParam)  
        myConnection.Open()  
 
        Dim DA As SqlDataAdapter = New SqlDataAdapter(myCommand)  
        DA.Fill(DataSet11)  
    End Sub 
 
    Protected Sub RadRelief_NeedDataSource(ByVal source As ObjectByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles RadRelief.NeedDataSource  
        FillGrid()  
    End Sub 
 
    Protected Sub RadRelief_ItemCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadRelief.ItemCommand  
        If (e.CommandName = "Edit"Then 
 
        End If 
    End Sub 
    Public Property _CutNumber() As Int16  
        Get 
            Return intCut  
        End Get 
        Set(ByVal Value As Int16)  
            intCut = Value  
        End Set 
    End Property 
    Public Sub _SetDataSet(ByRef Value As DataSet1)  
        Me.DataSet11 = Value  
    End Sub 
 
    Protected Sub RadRelief_InsertCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadRelief.InsertCommand  
 
    End Sub 
 
    Protected Sub RadRelief_UpdateCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadRelief.UpdateCommand  
 
    End Sub 
 
    Protected Sub ibUpdate_Click(ByVal sender As ObjectByVal e As EventArgs)  
 
    End Sub 
End Class 

 

 

 

 

 

 

 

 

There is no code as of now. but i am not able to hit the break points on command events to go forward.
Any help would be appreciated. 
Thanks

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 18 Aug 2009, 10:42 AM
Hi,

Could you make sure that you haven't set the AllowAutomaticOperations properties
AllowAutomaticInserts,AllowAutomaticDeletes, AllowAutomaticUpdates 
to true in you aspx . If so please disable them.

Thanks,
Princy
0
Ramakrishna Gopishetty
Top achievements
Rank 1
answered on 18 Aug 2009, 01:41 PM
Firstly, Thanks for reply.
I made sure about the automatic operations, none of them were true. Secondly, i removed Validators thinking if validators fire at same time that of any command event nothing will happen both events will die. I am really frustrated about this issue. None of the solutions mentioned in my research on this issue was successful. I am out of ideas here, Please help

0
Vlad
Telerik team
answered on 18 Aug 2009, 02:53 PM
Hello,

Please open support ticket with runnable example where this problem can be reproduced. We will review your implementation and we will get back to you with more info.

All the best,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
Tags
Grid
Asked by
Ramakrishna Gopishetty
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Ramakrishna Gopishetty
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or