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

Unable to come out of Edit mode after execution on Insert Command.

1 Answer 89 Views
Grid
This is a migrated thread and some comments may be shown as answers.
saravanakumar subramaniam
Top achievements
Rank 1
saravanakumar subramaniam asked on 06 Jul 2011, 04:21 PM
Hi,

I am using hierarchy grid to display data and also added Add new record option to insert an new row. I have set the Editmode-"In Place". After entering an new record and when i clicked the Update button. it is redirecting to server side InserCommand and i have return logic to insert this new record to database. But in the UI screen it still remains in the Edit mode, it is not coming into normal mode after execution.

Please find the below code.
 <telerik:RadGrid ID="radGridEngMemberAccess" runat="server" ShowStatusBar="true" AutoGenerateColumns="false" GridLines="None"  AllowMultiRowEdit="false"  >
               <MasterTableView DataKeyNames="JobID" AllowMultiColumnSorting="True"  Width="100%" CommandItemDisplay="None" AllowAutomaticDeletes="false" Name="CloseOutDetails"  >
               <CommandItemSettings ShowRefreshButton="false" />
                <DetailTables>
                    <telerik:GridTableView  Width="100%" runat="server" CommandItemDisplay="Bottom" Name="EngMemberDetails"  DataKeyNames="ID" EditMode="InPlace" >
                        <PagerStyle Mode="NextPrevAndNumeric" />
                        <CommandItemSettings AddNewRecordText="Add new user"   />
                        <Columns>
                         <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn1" >
                         <HeaderStyle Width="30px" />
                                       <ItemStyle CssClass="MyImageButton" />
                         </telerik:GridEditCommandColumn>
                            <telerik:GridBoundColumn SortExpression="Name" HeaderText="User Name" HeaderButtonType="TextButton"
                                DataField="Name" UniqueName="colName">
                            </telerik:GridBoundColumn>
                              <telerik:GridDropDownColumn SortExpression="Role" HeaderText="Role" DataSourceID="XmlDataSource1"  HeaderButtonType="TextButton" ListTextField="Name" ListValueField="ID" DataField="Role" UniqueName="colRole" />
                             <telerik:GridCheckBoxColumn DataField="IsActive" HeaderText="IsActive" UniqueName="colIsActive"  HeaderStyle-Width="10%" />
                             <telerik:GridBoundColumn SortExpression="ID" HeaderText="ID" HeaderButtonType="TextButton" DataField="ID" UniqueName="ID" ReadOnly="true" Visible="false"/>
                             <telerik:GridButtonColumn ConfirmText="Do you wand to delete the user?" ButtonType="ImageButton"
                                CommandName="Delete" Text="Delete" UniqueName="DeleteColumn2">
                                <HeaderStyle Width="20px" />
                                <ItemStyle HorizontalAlign="Center" CssClass="MyImageButton" />
                            </telerik:GridButtonColumn>
                        </Columns>
                        <SortExpressions>
                            <telerik:GridSortExpression FieldName="Name"></telerik:GridSortExpression>
                        </SortExpressions>
                    </telerik:GridTableView>
                </DetailTables>
                <Columns >
                     <telerik:GridBoundColumn SortExpression="CloseOutName" HeaderText="CloseOut Name" HeaderButtonType="TextButton"
                        DataField="CloseOutName" >
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="CloseOutType" HeaderText="CloseOut Type" HeaderButtonType="TextButton"
                        DataField="CloseOutType" ReadOnly="true">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="JobID" HeaderText="JobID" HeaderButtonType="TextButton"
                        DataField="JobID" UniqueName="JobID" ReadOnly="true">
                    </telerik:GridBoundColumn>
                    <telerik:GridDateTimeColumn SortExpression="PeriodEndDate" HeaderText="PeriodEndDate" HeaderButtonType="TextButton"
                        DataField="PeriodEndDate" UniqueName="PeriodEndDate" DataFormatString="{0: MM/dd/yyyy}" ReadOnly="true">
                    </telerik:GridDateTimeColumn>
                  </Columns>
                  <HeaderStyle  BorderColor="Blue"  BackColor="Red"/>
                                 </MasterTableView>
        </telerik:RadGrid>

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 07 Jul 2011, 05:46 AM
Hello Saravanakumar,

I am not quite sure how you are inserting the new record. If its manually can you debug your code to see whether the insert operation is executed successfully or something fails during the process which cancels the default behavior and the insert form is not closed?

Additionally,  verify that you set the AllowAutomaticInsert property of the grid to false (as it is meaningful with automatic data editing operations only).
Please elaborate your scenario if it doesn't help.

Thnaks,
Shinu.
Tags
Grid
Asked by
saravanakumar subramaniam
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or