Clearing EditIndexes in RadGrid

4 posts, 0 answers
  1. Suresh Mishra
    Suresh Mishra avatar
    25 posts
    Member since:
    Jul 2009

    Posted 23 Feb 2010 Link to this post

    I need to refresh a radgrid after updates to the database from a popup window.  However, when there is a row in the radgrid in the parent window which is in edit mode, the radgrid does not refresh.  I tried this so there will not be any rows in edit mode in the radgrid so it can refresh:


    While RadGridEmpData.EditIndexes.Count > 0





    End While


    but the EditIndexes.count is always zero.  Can I refresh the radgrid even if there is a row in edit mode?  If not, then how can I clear any rows in edit mode in the rad grid?


  2. Veli
    Veli avatar
    2002 posts

    Posted 25 Feb 2010 Link to this post

    Hi Suresh,

    You should be able to both clear any edited rows with the approach you have been using, as well as rebind the grid no matter if there are any edited rows or not. Posting any more details along with some sample code may help us identify what's wrong.

    All the best,
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. raghu
    raghu avatar
    5 posts
    Member since:
    Feb 2016

    Posted 27 Apr 2016 in reply to Veli Link to this post

    After insert values Edit mode not hiding


     <telerik:RadGrid ID="grdOnboardComments" GridLines="Both" AutoGenerateColumns="false" OnItemCreated ="grdOnboardComments_ItemCreated"
                                            OnItemDataBound="grdOnboardComments_ItemDataBound" OnNeedDataSource="grdOnboard_NeedDataSource"
                                            OnItemCommand="grdOnboardComments_ItemCommand" runat="server" Height="170px">
                                            <HeaderStyle CssClass="RadGridHeader"></HeaderStyle>
                                            <MasterTableView TableLayout="Fixed" Width="100%" CommandItemDisplay="Bottom" EditMode="InPlace"
                                                NoMasterRecordsText="No records found.">
                                                <CommandItemSettings AddNewRecordText="Add Comments" />
                                                    <telerik:GridTemplateColumn UniqueName="Task" HeaderText="Task" HeaderStyle-Width="100px">
                                                            <asp:Label ID="lblCommentsTask" runat="server" Text='<%# Bind("TASK_NAME") %>'></asp:Label>
                                                            <telerik:RadComboBox ID="rcbTask" runat="server" CssClass="clsEditField" AllowCustomText="false"
                                                                MarkFirstMatch="true" Width="195px" Height="150px">
                                                    <telerik:GridTemplateColumn UniqueName="Status" HeaderText="Status" HeaderStyle-Width="40px">
                                                            <asp:Label ID="lblCommentsStatus" runat="server" Text='<%# Bind("status_text") %>'></asp:Label>
                                                            <telerik:RadComboBox ID="rcbCommentsStatus" runat="server" RenderMode="Lightweight"
                                                                CssClass="clsEditField" AllowCustomText="false" MarkFirstMatch="true" Width="100px"
                                                                    <telerik:RadComboBoxItem runat="server" Text="Completed" Value="1" />
                                                                    <telerik:RadComboBoxItem runat="server" Text="In Progress" Value="2" />
                                                    <telerik:GridTemplateColumn UniqueName="Date_Added" HeaderText="Date Added" HeaderStyle-Width="40px">
                                                            <asp:Label ID="lblDateAdded" runat="server" Text='<%# Bind("Date_Added") %>'></asp:Label>
                                                         <telerik:RadDatePicker Width="100px" ID="txtDate_Added" runat="server">
                                                    <telerik:GridTemplateColumn UniqueName="Commented_By" HeaderText="Comments By" HeaderStyle-Width="40px">
                                                            <asp:Label ID="lblUserName" runat="server" Text='<%# Bind("User_Name") %>'></asp:Label>
                                                            <telerik:RadTextBox ID="txtUserName" Width="100px"   runat="server">
                                                    <telerik:GridTemplateColumn UniqueName="Comments" HeaderText="Comments" HeaderStyle-Width="100px">
                                                            <asp:Label ID="lblComments" runat="server" Text='<%# Bind("Comments") %>'></asp:Label>
                                                            <telerik:RadTextBox ID="txtComments" Width="100px"  Text='<%# Bind("Date_Added") %>' runat="server">
                                                    <telerik:GridTemplateColumn HeaderStyle-Width="40px" UniqueName="Actions" HeaderText="Actions"
                                                            <telerik:RadButton ID="btnCommentSave" runat="server" Text="Save" CommandName="SaveComments">
                                            <ClientSettings Resizing-AllowColumnResize="true" Scrolling-AllowScroll="true" >




    protected void grdOnboardComments_ItemCommand(object sender, GridCommandEventArgs e)
                    if ((e.CommandName == "SaveComments"))

                        CaseOnboardCommentsVO caseComments = new CaseOnboardCommentsVO();
                        GridDataItem item = (GridDataItem)e.Item;
                        Decimal _task_id = 0;
                        caseComments.Case_Master_Id = case_id;
                        _task_id = Convert.ToDecimal((item.FindControl("rcbTask") as RadComboBox).SelectedValue);
                        caseComments.TASK_ID = _task_id;
                        caseComments.Status = Convert.ToInt32((item.FindControl("rcbCommentsStatus") as RadComboBox).SelectedValue);
                        caseComments.Date_Added = (item.FindControl("txtDate_Added") as RadDatePicker).SelectedDate;
                        caseComments.User_Name = (item.FindControl("txtUserName") as RadTextBox).Text; // modify this hard code to GetCurrentUser().login_id;
                        caseComments.Comments = (item.FindControl("txtComments") as RadTextBox).Text;

                        caseOnboardList = new CaseOnboardVO();

                        e.Canceled = true;

    Please hele me on this


    Best Regards

    Raghu Kiran



  4. Eyup
    Eyup avatar
    4081 posts

    Posted 02 May 2016 Link to this post

    Hello Raghu,

    Please try removing the e.Canceled = true; line from the code-behind logic.
    This should resolve the issue.

    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top