Question : After updating still in update mode

Hi,

I am using inline editing in radgrid. Once the rows or columns are updated i am still getting that rows or columns in edit mode. How to resolve this issue.

Another issue is Pageindexchaned event. when i click on the next page button i am not getting anything(when viewstate is false).  But when viewstate is set to true. Its working fine. Is there anyway to solve this issue.  When I am trying to use onneeddatasource event I am unable update the columns or rows. so i cant use onneeddatasource.

Please help me. Here is my code.


1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
protected void Page_Load(object sender, EventArgs e) 
    { 
        try 
        { 
            if (!IsPostBack) 
            { 
                Session["SearchRes"] = null; 
                if (Session["TaskName"] != null) 
                    lblTskName.Text = Session["TaskName"].ToString(); 
                Session["FilColms"] = null; 
                Session["SortExp"] = null; 
                Session["FilExp"] = null; 
                Session["ViewAll"] = null; 
                BindGrid(); 
            } 
        } 
        catch (Exception ex) 
        { 
            throw ex; 
        } 
    } 
 
    private void BindGrid() 
    { 
        try 
        { 
            DataSet dsResult = new DataSet(); 
 
            clsSearch_BL clsObj = new clsSearch_BL(); 
            clsObj.TaskID = (string)Session["TaskID"]; 
            clsObj.CustName = (string)Session["CustName"]; 
            clsObj.MarketName = (string)Session["MarketName"]; 
            clsObj.HeadendName = (string)Session["HeadendName"]; 
            clsObj.SiteName = (string)Session["SiteName"]; 
            clsObj.TaskStatus = (string)Session["TaskStatus"]; 
            clsObj.OrdType = (string)Session["OrdType"]; 
            clsObj.OrdStatus = (string)Session["OrdStatus"]; 
            clsObj.ProName = (string)Session["ProName"]; 
            clsObj.LOC = (string)Session["LOC"]; 
            clsObj.QuoteID = (string)Session["QuoteID"]; 
            clsObj.CMNumber = (string)Session["CMNumber"]; 
 
            if (Session["SearchRes"] == null) 
            { 
                dsResult = clsObj.getSearchResults_BL(clsObj); 
                Session["SearchRes"] = dsResult; 
            } 
            else 
                dsResult = (DataSet)Session["SearchRes"]; 
 
            DataView dataView = dsResult.Tables[0].DefaultView; 
            rg200.DataSource = dsResult; 
            rg200.DataBind(); 
        } 
        catch (Exception ex) 
        { 
            throw ex; 
        } 
    } 
 
    protected void rg200_PreRender(object sender, EventArgs e) 
    { 
        rg200.MasterTableView.GetColumnSafe("RowIndicator").Display = false; 
 
        if (rg200.EditIndexes.Count > 0 || rg200.MasterTableView.IsItemInserted) 
        { 
            GridColumn col1 = rg200.MasterTableView.GetColumn("EditCommandColumn") as GridColumn; 
            col1.Visible = true; 
        } 
        else 
        { 
            GridColumn col2 = rg200.MasterTableView.GetColumn("EditCommandColumn") as GridColumn; 
            col2.Visible = false; 
        }  
 
    } 
 
    protected void RadMenu1_ItemClick(object sender, RadMenuEventArgs e) 
    { 
        int radGridClickedRowIndex; 
 
        radGridClickedRowIndex = Convert.ToInt32(Request.Form["radGridClickedRowIndex"]); 
 
        switch (e.Item.Text) 
        { 
            case "Edit Task": 
                rg200.Items[radGridClickedRowIndex].Edit = true; 
                BindGrid(); 
               // rg200.Rebind(); 
                break; 
            case "Complete Task": 
                //rg200.MasterTableView.PerformDelete(rg200.Items[radGridClickedRowIndex]); 
                break; 
        } 
    } 
 
    protected void rg200_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridPagerItem) 
        { 
            RadComboBox combo = (e.Item as GridPagerItem).FindControl("PageSizeComboBox") as RadComboBox; 
 
            // The number of items shown when all is selected  
            int allRowsCount = int.MaxValue; 
 
            // Remove duplicates  
            RadComboBoxItem duplicate = combo.Items.FindItemByValue(allRowsCount.ToString()); 
            if (duplicate != null) 
            { 
                duplicate.Remove(); 
            } 
 
            // Create a new item for showing all  
            RadComboBoxItem item = new RadComboBoxItem("All", allRowsCount.ToString()); 
            item.Attributes.Add("ownerTableViewId", e.Item.OwnerTableView.ClientID); 
            combo.Items.Add(item); 
 
            // Set the current pagesize as the selected value  
            combo.Items.FindItemByValue(rg200.PageSize.ToString()).Selected = true; 
        } 
    } 
 
    protected void rg200_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e) 
    { 
 
        if (Session["TaskID"] != null) 
        { 
            string strTaskID = (string)Session["TaskID"]; 
            if (strTaskID != string.Empty) 
            { 
                clsTaskUpdates_BL objBL = new clsTaskUpdates_BL(); 
 
                GridEditableItem eeditedItem = e.Item as GridEditableItem; 
                //Get the primary key value using the DataKeyValue.       
                string OrdID = editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["orderId"].ToString(); 
                //Access the textbox from the edit form template and store the values in string variables. 
 
                string ClarifyAccountNbr = ((GridTextBoxColumnEditor)editedItem.EditManager.GetColumnEditor("Clarify Account Nbr")).TextBoxControl.Text; 
 
                string SiteID = ((GridTextBoxColumnEditor)editedItem.EditManager.GetColumnEditor("Site ID")).TextBoxControl.Text; 
 
                string QuoteID = ((GridTextBoxColumnEditor)editedItem.EditManager.GetColumnEditor("Quote ID")).TextBoxControl.Text; 
 
                CheckBox chkEDP = ((GridCheckBoxColumnEditor)editedItem.EditManager.GetColumnEditor("EDP Created?")).CheckBoxControl; 
 
                //string ClarifyAccountNbr = (editedItem["Clarify Account Nbr"].Controls[0] as TextBox).Text; 
                //string SiteID = (editedItem["Site ID"].Controls[0] as TextBox).Text; 
                //string QuoteID = (editedItem["Quote ID"].Controls[0] as TextBox).Text; 
                //CheckBox chkEDP = (editedItem["EDP Created?"].Controls[0] as CheckBox); 
                try 
                { 
                    objBL.setTask200_Bl(OrdID, ClarifyAccountNbr, SiteID, QuoteID, chkEDP.Checked); 
                    Session["SearchRes"] = null; 
                    
                    BindGrid(); 
 
                } 
                catch (Exception ex) 
                { 
                    rg200.Controls.Add(new LiteralControl("Unable to update Employee. Reason: " + ex.Message)); 
                    e.Canceled = true; 
                } 
            } 
        } 
    } 
 
    protected void rg200_PageIndexChanged(object source, GridPageChangedEventArgs e) 
    { 
        try 
        { 
            rg200.CurrentPageIndex = e.NewPageIndex; 
            BindGrid(); 
        } 
        catch (Exception ex) 
        { 
            throw ex; 
        } 
    } 


1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
<telerik:RadScriptManager ID="RadScriptManager1" runat="server"> 
                    </telerik:RadScriptManager> 
                    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> 
                        <ClientEvents OnRequestStart="onRequestStart" /> 
                        <AjaxSettings> 
                            <telerik:AjaxSetting AjaxControlID="rg200"> 
                                <UpdatedControls> 
                                    <telerik:AjaxUpdatedControl ControlID="rg200" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                                    <telerik:AjaxUpdatedControl ControlID="RadMenu1" /> 
                                </UpdatedControls> 
                            </telerik:AjaxSetting> 
                            <telerik:AjaxSetting AjaxControlID="RadMenu1"> 
                                <UpdatedControls> 
                                    <telerik:AjaxUpdatedControl ControlID="rg200" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                                    <telerik:AjaxUpdatedControl ControlID="RadMenu1" /> 
                                </UpdatedControls> 
                            </telerik:AjaxSetting> 
                        </AjaxSettings> 
                    </telerik:RadAjaxManager> 
                    <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Default"> 
                    </telerik:RadAjaxLoadingPanel> 
                    <input type="hidden" id="radGridClickedRowIndex" name="radGridClickedRowIndex" /> 
                    <telerik:RadGrid ID="rg200" runat="server" AutoGenerateColumns="False" PageSize="30" 
                        Height="550px" Width="100%" AllowPaging="True" AllowSorting="True" AllowMultiRowSelection="True" 
                        EnableHeaderContextMenu="True" GridLines="None" EnableHeaderContextFilterMenu="True" 
                        AllowMultiRowEdit="true" AllowFilteringByColumn="True" OnPreRender="rg200_PreRender" 
                        OnItemCreated="rg200_ItemCreated" EnableViewState="True" OnUpdateCommand="rg200_UpdateCommand" 
                        AllowAutomaticDeletes="true" AllowAutomaticInserts="true" AllowAutomaticUpdates="true" 
                        OnPageIndexChanged="rg200_PageIndexChanged" OnCancelCommand="rg200_CancelCommand"> 
                        <HeaderStyle Height="20px" BackColor="#004000" Font-Size="8pt" Font-Bold="True" ForeColor="White" 
                            HorizontalAlign="Center" BorderColor="White" BorderWidth="1px" /> 
                        <ExportSettings IgnorePaging="true" ExportOnlyData="true"> 
                            <Pdf AllowModify="false" AllowPrinting="true" PageBottomMargin="" PageFooterMargin="" 
                                PageHeaderMargin="" PageHeight="11in" PageLeftMargin="" PageRightMargin="" PageTopMargin="" 
                                PageWidth="14in" /> 
                        </ExportSettings> 
                        <MasterTableView GridLines="None" DataKeyNames="orderId" CommandItemDisplay="Top" 
                            EditMode="InPlace"> 
                            <CommandItemSettings AddNewRecordText="Add New" ShowExportToWordButton="true" ShowExportToExcelButton="true" 
                                ShowExportToCsvButton="true" ShowExportToPdfButton="true" /> 
                            <Columns> 
                                <telerik:GridClientSelectColumn UniqueName="ClientSelectColumn" HeaderStyle-Width="3%" 
                                    ItemStyle-Width="3%"> 
                                    <HeaderStyle Width="3%"></HeaderStyle> 
                                    <ItemStyle Width="3%"></ItemStyle> 
                                </telerik:GridClientSelectColumn> 
                                <telerik:GridBoundColumn UniqueName="sId" HeaderText="sId" DataField="sId" ReadOnly="true" 
                                    Visible="false"> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="orderId" HeaderText="orderId" Visible="false" 
                                    DataField="orderId"> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="Customer Name" HeaderText="Customer Name" DataField="Customer Name" 
                                    ReadOnly="true"> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="Market Name" HeaderText="Market Name" DataField="Market Name" 
                                    ReadOnly="true"> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="LOB" HeaderText="LOB" DataField="LOB" ReadOnly="true"> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="Headend Name" HeaderText="Headend Name" DataField="Headend Name" 
                                    ReadOnly="true"> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="Project Name" HeaderText="Project Name" DataField="Project Name" 
                                    ReadOnly="true"> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="Site Name" HeaderText="Site Name" DataField="Site Name" 
                                    ReadOnly="true"> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="Task Status" HeaderText="Task Status" DataField="Task Status" 
                                    ReadOnly="true"> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="Clarify Account Nbr" HeaderText="Clarify Account Nbr" 
                                    DataField="Clarify Account Nbr"> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="Site ID" HeaderText="Site ID" DataField="Site ID"> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridBoundColumn UniqueName="Quote ID" HeaderText="Quote ID" DataField="Quote ID"> 
                                </telerik:GridBoundColumn> 
                                <telerik:GridCheckBoxColumn UniqueName="EDP Created?" HeaderText="EDP Created?" DataField="EDP Created?"> 
                                </telerik:GridCheckBoxColumn> 
                                <telerik:GridEditCommandColumn UniqueName="EditCommandColumn" Visible="false"> 
                                </telerik:GridEditCommandColumn> 
                            </Columns> 
                        </MasterTableView> 
                        <ClientSettings EnableRowHoverStyle="true" ReorderColumnsOnClient="false" AllowDragToGroup="false" 
                            AllowColumnsReorder="True"> 
                            <Scrolling AllowScroll="true" EnableVirtualScrollPaging="false" UseStaticHeaders="true" /> 
                            <Selecting AllowRowSelect="True"></Selecting> 
                            <Resizing AllowRowResize="true" AllowColumnResize="True" EnableRealTimeResize="True" 
                                ResizeGridOnColumnResize="False"></Resizing> 
                            <ClientEvents OnRowContextMenu="RowContextMenu" OnRowDblClick="RowDblClick"></ClientEvents> 
                        </ClientSettings> 
                        <PagerStyle Mode="NextPrevAndNumeric" AlwaysVisible="true"></PagerStyle> 
                    </telerik:RadGrid> 

Answer : After updating still in update mode

Hi,

I suggest you install munin. You will monitor everything 5 minutes after the installation :)
It monitors CPU, disks, apache, mysql, postfix, whatever :)
Random Solutions  
 
programming4us programming4us