in

C1 Community

ComponentOne Community is a free source for developers and help authors to collaborate and communicate.

Edit Mode Not Working

Last post 02-20-2008 3:38 AM by C1_SergeiS. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 02-08-2008 4:07 PM

    Edit Mode Not Working

    I have a number of grids on a page that utilize the editing features of C1WebGrid.  They all worked perfectly fine, until recently.  All of a sudden, for no apparent reason,  when I click on the edit hyperlink, the default spinner starts spinning but the row never enters edit mode.  This is the case for all the grids on my page that utilize editing.  The grids all populate fine from the DB. I did not mess with anything related to these grids and thay just stopped working??????? I'm using V 2.1.20073.112. 

    Filed under:
  • 02-08-2008 5:22 PM In reply to

    Re: Edit Mode Not Working

    Hi David,
     
    Could you please post a sample that replicates this issue?
     
    Regards,
    Patrick

    I have a number of grids on a page that utilize the editing features of C1WebGrid.  They all worked perfectly fine, until recently.  All of a sudden, for no apparent reason,  when I click on the edit hyperlink, the default spinner starts spinning but the row never enters edit mode.  This is the case for all the grids on my page that utilize editing.  The grids all populate fine from the DB. I did not mess with anything related to these grids and thay just stopped working??????? I'm using V 2.1.20073.112. 



    http://helpcentral.componentone.com/cs/forums/p/74257/201782.aspx#201782

  • 02-11-2008 8:40 AM In reply to

    Re: Edit Mode Not Working

    Patrick:

    Here is what I have for one of the grids.  All the grids on my page fail to enter edit mode.  This worked perfectly fine just a little while ago, and from what I can tell, I did not mess with any of the grid-specific code.  In debug, the code never reaches the "EditingCommand" handler, even though CallbackOptions is set to "Editing".  Thanks in advance.

    ASPX:

               <asp:Panel ID="SearchSenderPanel" runat="server" Height="50px" Visible="False" Width="125px">
                    <table>
                        <tr>
                            <td style="width: 100px">
                                <asp:Label ID="Label58" runat="server" CssClass="HeaderFont1" Font-Italic="True"
                                    Text="Sender Search Results" Width="311px"></asp:Label></td>
                        </tr>
                        <tr>
                            <td style="width: 100px" valign="middle">
                                <C1WebGrid:C1WebGrid ID="SearchSenderGrid" runat="server" AllowAutoSize="True" AllowColSizing="True"
                                    AutoGenerateColumns="False" Font-Names="Trebuchet MS"
                                    Font-Size="9pt" HScrollBarStyle="Always" VScrollBarStyle="Always" Width="550px" Height="300px" CallbackOptions="Editing" CellPadding="1" ShowFooter="True" DefaultRowHeight="23px"><FooterStyle Height="21px" BackColor="#E0E0E0" VerticalAlign="Middle" Wrap="False" />
                                    <Columns>
                                        <C1WebGrid:C1EditCommandColumn>
                                        </C1WebGrid:C1EditCommandColumn>
                                        <C1WebGrid:C1TemplateColumn HeaderText="ID">
                                            <ItemStyle Width="35px" />
                                            <ItemTemplate>
                                                <asp:Label ID="senderIDLbl" runat="server" Text='<%# Eval("ID") %>'></asp:Label>
                                            </ItemTemplate>
                                        </C1WebGrid:C1TemplateColumn>
                                        <C1WebGrid:C1TemplateColumn HeaderText="Name">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="SenderNameTB" runat="server" Text='<%# Bind("NAME") %>' Width="120px" BackColor="#FFFFC0"></asp:TextBox>
                                            </EditItemTemplate>
                                            <FooterTemplate>
                                                <asp:TextBox ID="FootSenderNameTB" runat="server" Width="120px" BackColor="#FFFFC0"></asp:TextBox>
                                            </FooterTemplate>
                                            <ItemStyle Width="125px" />
                                            <ItemTemplate>
                                                <asp:Label ID="senderNameLbl" runat="server" Text='<%# Eval("NAME") %>'></asp:Label>
                                            </ItemTemplate>
                                        </C1WebGrid:C1TemplateColumn>
                                        <C1WebGrid:C1TemplateColumn HeaderText="Initials">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="SenderInitialsTB" runat="server" Text='<%# Bind("INITIALS") %>'
                                                    Width="50px" BackColor="#FFFFC0"></asp:TextBox>
                                            </EditItemTemplate>
                                            <FooterTemplate>
                                                <asp:TextBox ID="FootSenderInitialsTB" runat="server" Width="50px" BackColor="#FFFFC0"></asp:TextBox>
                                            </FooterTemplate>
                                            <ItemStyle Width="60px" />
                                            <ItemTemplate>
                                                <asp:Label ID="senderInitialsLbl" runat="server" Text='<%# Eval("INITIALS") %>'></asp:Label>
                                            </ItemTemplate>
                                        </C1WebGrid:C1TemplateColumn>
                                        <C1WebGrid:C1TemplateColumn HeaderText="Phone">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="SenderPhoneTB" runat="server" onchange="BLOCKED SCRIPTEditTemplatePhoneOnChange(this);" onkeypress="BLOCKED SCRIPTEditTemplatePhoneKeyPress(event);" Text='<%# Bind("PHONE") %>' Width="100px" BackColor="#FFFFC0"></asp:TextBox>
                                            </EditItemTemplate>
                                            <FooterTemplate>
                                                <c1i:C1WebMaskEdit ID="FootSenderPhoneWME" runat="server" Height="22px" Mask="000-000-0000" Width="100px" BackColor="#FFFFC0">
                                                </c1i:C1WebMaskEdit>
                                            </FooterTemplate>
                                            <ItemStyle Width="115px" />
                                            <ItemTemplate>
                                                <asp:Label ID="senderPhoneLbl" runat="server" Text='<%# Eval("PHONE") %>' Width="100px"></asp:Label>
                                            </ItemTemplate>
                                        </C1WebGrid:C1TemplateColumn>
                                    </Columns>
                                    <ItemStyle BackColor="Honeydew" Wrap="False" VerticalAlign="Middle" Font-Names="Trebuchet MS" Font-Size="9pt" />
                                    <HeaderStyle BackColor="Silver" ForeColor="MediumBlue" HorizontalAlign="Left" Height="18px" />
                                    <EditItemStyle Font-Names="Trebuchet MS" Font-Size="9pt" />
                                </C1WebGrid:C1WebGrid>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" style="width: 475px">
                                <asp:Label ID="Label59" runat="server" Font-Names="Trebuchet MS" Font-Size="9pt"
                                    Text="Scroll down and use the text fields at bottom of grid to create a new SENDER, then press 'Add New Sender' to add it to the database"
                                    Width="545px"></asp:Label></td>
                        </tr>
                    </table>
                </asp:Panel>

    Code behind:

        Protected Sub SearchSenderGrid_EditingCommand(ByVal sender As Object, ByVal e As C1.Web.C1WebGrid.C1CancelCommandEventArgs) Handles SearchSenderGrid.EditingCommand
            Me.SearchSenderGrid.EditItemIndex = e.Item.ItemIndex
            GetSenders() 'populates grid from DB
        End Sub

        Protected Sub SearchSenderGrid_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles SearchSenderGrid.PreRender
            If Not CheckAdministrator() Then
                Me.SearchSenderGrid.Columns.Item(0).Visible = False
            End If
        End Sub

        Protected Sub SearchSenderGrid_CancelingCommand(ByVal sender As Object, ByVal e As C1.Web.C1WebGrid.C1CancelCommandEventArgs) Handles SearchSenderGrid.CancelingCommand
            Me.SearchSenderGrid.EditItemIndex = -1
            GetSenders()  'populates grid from DB

        End Sub

        Protected Sub SearchSenderGrid_UpdatingCommand(ByVal sender As Object, ByVal e As C1.Web.C1WebGrid.C1UpdatingEventArgs) Handles SearchSenderGrid.UpdatingCommand
            If CheckAdministrator() Then
                'validate and update
                        ........
                        e.Cancel = True
                        Me.SearchSenderGrid.EditItemIndex = -1
                        GetSenders()
                    Else
                        e.Cancel = False
                    End If
                Else
                    'not valid
                    e.Cancel = False
                End If
            Else
                e.Cancel = False
                Me.SearchSenderGrid.EditItemIndex = -1
                GetSenders()
            End If
        End Sub

        Protected Sub SearchSenderGrid_ItemCreated(ByVal sender As Object, ByVal e As C1.Web.C1WebGrid.C1ItemEventArgs) Handles SearchSenderGrid.ItemCreated
            If e.Item.ItemType = C1.Web.C1WebGrid.C1ListItemType.Footer Then
                Dim lb As New LinkButton
                lb.Text = "Add New Sender"
                lb.CommandName = "AddSender"
                lb.ID = "NewSenderButton"
                e.Item.Cells(0).Controls.Add(lb)
            ElseIf e.Item.ItemType = C1.Web.C1WebGrid.C1ListItemType.EditItem Then
                Dim hl As HyperLink = CType(e.Item.Cells(0).Controls(0), HyperLink)
                Dim index As String = e.Item.ItemIndex.ToString
                Dim s As String = "ValidateSender(SearchSenderGrid_cntxt," & index & ");"
                hl.Attributes.Add("onclick", s)
            End If
        End Sub

        Protected Sub SearchSenderGrid_ItemCommand(ByVal sender As Object, ByVal e As C1.Web.C1WebGrid.C1CommandEventArgs) Handles SearchSenderGrid.ItemCommand
            If e.CommandName.Equals("AddSender") Then
                'validate new entry

                 .......
                AddNewSenderRow(values)
            End If
        End Sub

        Public Sub AddNewSenderRow(ByVal values() As String)
            If ValidateSender(values) Then
                AddNewSender(values)
                GetSenders()
            Else
            End If
        End Sub

     

    Filed under:
  • 02-11-2008 12:49 PM In reply to

    Re: Edit Mode Not Working

    Patrick: 

    In addition, here is the message I recieve everytime I click on the "Edit" hyperlink in any of my grids.  This was not the case a couple of days ago when everything worked :

    Event Type: Warning
    Event Source: ASP.NET 2.0.50727.0
    Event Category: Web Event
    Event ID: 1309
    Date:  02/11/2008
    Time:  12:26:32 PM
    User:  N/A
    Computer: ComputerName
    Description:
    Event code: 3005
    Event message: An unhandled exception has occurred.
    Event time: 02/11/2008 12:26:32 PM
    Event time (UTC): 02/11/2008 5:26:32 PM
    Event ID: cbd05768f9db49b7be05c2328474ab78
    Event sequence: 1874
    Event occurrence: 5
    Event detail code: 0
     
    Application information:
        Application domain: 232fbf67-4-128472201775855900
        Trust level: Full
        Application Virtual Path: /CTSampleTransfer2
        Application Path: E:\.........\CTSampleTransfer2\
        Machine name: ComputerName
     
    Process information:
        Process ID: 1172
        Process name: WebDev.WebServer.EXE
        Account name: ...... 
    Exception information:
        Exception type: HttpException
        Exception message: The HTTP verb POST used to access path '/CTSampleTransfer2/[object]' is not allowed.
     
    Request information:
        Request URL: http://localhost:4568/CTSampleTransfer2/[object]
        Request path: /CTSampleTransfer2/[object]
        User host address: 127.0.0.1
        User: .....
        Is authenticated: True
        Authentication Type: NTLM
        Thread account name: .....
     
    Thread information:
        Thread ID: 11
        Thread account name: .....
        Is impersonating: False
        Stack trace:    at System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
     

  • 02-20-2008 3:38 AM In reply to

    Re: Edit Mode Not Working

    Hi David,
     
    on my side grid made of the code pieces you provided edits fine. Could you send me a small working sample replicating the issue and let me know C1WebGrid version number?
     
    Regards,
    Sergey.
    <DavidSt> wrote in message news:201811@10.0.1.98...

    Patrick: 

    In addition, here is the message I recieve everytime I click on the "Edit" hyperlink in any of my grids.  This was not the case a couple of days ago when everything worked :

    Event Type: Warning
    Event Source: ASP.NET 2.0.50727.0
    Event Category: Web Event
    Event ID: 1309
    Date:  02/11/2008
    Time:  12:26:32 PM
    User:  N/A
    Computer: ComputerName
    Description:
    Event code: 3005
    Event message: An unhandled exception has occurred.
    Event time: 02/11/2008 12:26:32 PM
    Event time (UTC): 02/11/2008 5:26:32 PM
    Event ID: cbd05768f9db49b7be05c2328474ab78
    Event sequence: 1874
    Event occurrence: 5
    Event detail code: 0
     
    Application information:
        Application domain: 232fbf67-4-128472201775855900
        Trust level: Full
        Application Virtual Path: /CTSampleTransfer2
        Application Path: E:\.........\CTSampleTransfer2\
        Machine name: ComputerName
     
    Process information:
        Process ID: 1172
        Process name: WebDev.WebServer.EXE
        Account name: ...... 
    Exception information:
        Exception type: HttpException
        Exception message: The HTTP verb POST used to access path '/CTSampleTransfer2/[object]' is not allowed.
     
    Request information:
        Request URL: http://localhost:4568/CTSampleTransfer2/[object]
        Request path: /CTSampleTransfer2/[object]
        User host address: 127.0.0.1
        User: .....
        Is authenticated: True
        Authentication Type: NTLM
        Thread account name: .....
     
    Thread information:
        Thread ID: 11
        Thread account name: .....
        Is impersonating: False
        Stack trace:    at System.Web.DefaultHttpHandler.BeginProcessRequest(HttpContext context, AsyncCallback callback, Object state)
       at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
       at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
     



    http://helpcentral.componentone.com/cs/forums/p/74257/201811.aspx#201811

Page 1 of 1 (5 items)
Contact ComponentOne: 1.800.858.2739 ©1987-2008 ComponentOne LLC All Rights Reserved.