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

Break point not hit on update or insert command

2 Answers 81 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Benjamin
Top achievements
Rank 1
Benjamin asked on 04 Mar 2011, 03:52 AM
Hello,

I am using the radgrid with a web user control for the modal popup. I switched the save buttons from regular asp.net buttons to the radbuttons and now my break points won't get hit and I believe the method isn't even being hit when the save button is pressed. My markup is below. The methods do have the handles statement. Is there something I am missing?

<telerik:RadButton ID="updateButton" runat="server" Text="Save" Width="75px" CommandName="Update"
    Visible='<%# Not (TypeOf DataItem Is Telerik.Web.UI.GridInsertionObject) %>'
    Skin="Outlook" CausesValidation="false">
</telerik:RadButton>
<telerik:RadButton ID="insertButton" runat="server" Text="Save" Width="75px" CommandName="PerformInsert"
    Visible='<%# (TypeOf DataItem Is Telerik.Web.UI.GridInsertionObject) %>' Skin="Outlook"
    CausesValidation="false">
</telerik:RadButton>

Thank you for your help.

P.S. I should also add that other break points work. The ItemCommand method breaks properly and all the others do too.

Ben

2 Answers, 1 is accepted

Sort by
0
Benjamin
Top achievements
Rank 1
answered on 05 Mar 2011, 10:08 PM
Additional information: The ItemCommand only fires when the popup opens. I tried seeing if it fired on update or insert and the item command does not. Here is the code for the RadGrid.

<telerik:RadGrid ID="clientListRadGrid" runat="server" AllowPaging="True" AllowSorting="True"
                AutoGenerateDeleteColumn="True" GridLines="None" PageSize="25" Skin="Outlook"
                Width="700px">
                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Outlook">
                </HeaderContextMenu>
                <ValidationSettings ValidationGroup="cdEditForm" />
                <MasterTableView AutoGenerateColumns="False" DataKeyNames="clientId" CommandItemDisplay="Top"
                    EditMode="PopUp">
                    <CommandItemSettings ExportToPdfText="Export to Pdf" />
                    <CommandItemSettings AddNewRecordText="Add New Client" />
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px" />
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="20px" />
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton">
                        </telerik:GridEditCommandColumn>
                        <telerik:GridBoundColumn DataField="clientId" DataType="System.Int64" Display="False"
                            HeaderText="clientId" ReadOnly="True" SortExpression="clientId" UniqueName="clientId">
                            <HeaderStyle Width="5%" />
                            <ItemStyle Width="5%" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="marketGroupId" DataType="System.Int64" HeaderText="marketGroupId"
                            SortExpression="marketGroupId" UniqueName="marketGroupId" Display="false">
                            <HeaderStyle Width="0%" />
                            <ItemStyle Width="0%" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="marketGroupName" DataType="System.String" HeaderText="Market Group Name"
                            SortExpression="marketGroupName" UniqueName="marketGroupName">
                            <HeaderStyle Width="40%" />
                            <ItemStyle Width="40%" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="clientName" HeaderText="Name" SortExpression="clientName"
                            UniqueName="clientName">
                            <HeaderStyle Width="35%" />
                            <ItemStyle Width="35%" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="clientWebsite" Display="False" HeaderText="clientWebsite"
                            SortExpression="clientWebsite" UniqueName="clientWebsite">
                            <HeaderStyle Width="0%" />
                            <ItemStyle Width="0%" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="clientDetails" Display="False" HeaderText="clientDetails"
                            SortExpression="clientDetails" UniqueName="clientDetails">
                            <HeaderStyle Width="0%" />
                            <ItemStyle Width="0%" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="clientImage" Display="False" HeaderText="clientImage"
                            SortExpression="clientImage" UniqueName="clientImage">
                            <HeaderStyle Width="0%" />
                            <ItemStyle Width="0%" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="createdDate" DataType="System.DateTime" HeaderText="Created"
                            DataFormatString="{0:MM/dd/yyyy}" SortExpression="createdDate" UniqueName="createdDate">
                            <HeaderStyle Width="10%" />
                            <ItemStyle Width="10%" />
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="createdBy" DataType="System.Guid" Display="False"
                            HeaderText="createdBy" SortExpression="createdBy" UniqueName="createdBy">
                            <HeaderStyle Width="0%" />
                            <ItemStyle Width="0%" />
                        </telerik:GridBoundColumn>
                        <telerik:GridCheckBoxColumn DataField="active" DataType="System.Boolean" HeaderText="Active"
                            SortExpression="active" UniqueName="active" DefaultInsertValue="false">
                            <HeaderStyle Width="10%" />
                            <ItemStyle Width="10%" />
                        </telerik:GridCheckBoxColumn>
                    </Columns>
                    <EditFormSettings UserControlName="~/GroupAdmin/controls/ClientDetailsEditForm/ClientDetailsEditForm.ascx"
                        InsertCaption="Add New Client" EditFormType="WebUserControl" PopUpSettings-Modal="true"
                        CaptionDataField="clientName" CaptionFormatString="Edit Client: {0}">
                        <PopUpSettings Modal="True" Height="600px" Width="750px" ZIndex="9999" 
                            ScrollBars="Auto"></PopUpSettings>
                        <EditColumn UniqueName="EditCommandColumn1">
                        </EditColumn>
                    </EditFormSettings>
                </MasterTableView>
                <ClientSettings>
                    <ClientEvents OnPopUpShowing="PopUpShowing" />
                </ClientSettings>
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
            </telerik:RadGrid>
0
Benjamin
Top achievements
Rank 1
answered on 07 Mar 2011, 01:42 AM
I figured out the problem. I was getting ready to past the whole pages markup in here and noticed something that should not be. The viewstate was turned off. I had turned some off on some pages where they weren't needed. I must have inadvertantly turned it off on this page by accident. It's embarassing, but at least the issue is resolved.

Thank you.

Ben
Tags
Grid
Asked by
Benjamin
Top achievements
Rank 1
Answers by
Benjamin
Top achievements
Rank 1
Share this question
or