Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
185 views
I have a "RadGrid" for Editing Data.

I have filtering enabled.

I perform validations using the "RadInputManager".

When I try to update the data happens to me what I show in the picture attached.

How I can solve this?

I add the code "aspx" to show the example:

<telerik:RadAjaxManager runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadGrid1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="RadGrid1" UpdatePanelCssClass="" />
                <telerik:AjaxUpdatedControl ControlID="RadInputManager1" UpdatePanelCssClass="" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
    <Scripts>
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js">
        </asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js">
        </asp:ScriptReference>
        <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js">
        </asp:ScriptReference>
    </Scripts>
</telerik:RadScriptManager>
        <telerik:RadInputManager ID="RadInputManager1" runat="server">
    <telerik:TextBoxSetting InitializeOnClient="False" ErrorMessage="Required!" Validation-IsRequired="True" Validation-ValidateOnEvent="Submit">
        <TargetControls>
            <telerik:TargetInput ControlID="RadGrid1" />
        </TargetControls>
    </telerik:TextBoxSetting>
</telerik:RadInputManager>

<telerik:RadGrid ID="RadGrid1" runat="server" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" AutoGenerateEditColumn="True" CellSpacing="0" DataSourceID="LinqDataSource1" EnableHeaderContextFilterMenu="True" EnableHeaderContextMenu="True" GridLines="None">
    <MasterTableView CommandItemDisplay="Top" DataKeyNames="RolId" DataSourceID="LinqDataSource1" EditMode="InPlace">
        <Columns>
            <telerik:GridBoundColumn DataField="Name" HeaderText="Name" SortExpression="Name" UniqueName="Name">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="Description" HeaderText="Description" SortExpression="Description" UniqueName="Description">
            </telerik:GridBoundColumn>
        </Columns>
    </MasterTableView>
</telerik:RadGrid>
<asp:LinqDataSource ID="LinqDataSource1" runat="server" ContextTypeName="WebApplication1.DataClasses1DataContext" EntityTypeName="" TableName="Rol">
</asp:LinqDataSource>
Delvis
Top achievements
Rank 1
 answered on 24 Feb 2015
9 answers
1.6K+ views
Got problem with the delete comand in grid.
Scenario: after page loading push the standard button "Delete" at the GridButtonColumnType(buttonColumn.CommandName = "Delete") of any grid item.
Error description:

Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentOutOfRangeException: Specified argument was out of the range of valid values.
Parameter name: ItemHierarchicalIndex]
Telerik.Web.UI.GridItemCollection.get_Item(String hierarchicalIndex) +103
Telerik.Web.UI.GridDataItemCollection.get_Item(String hierarchicalIndex) +37
Telerik.Web.UI.RadGrid.RaisePostBackEvent(String eventArgument) +4133
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +13
System.Web.UI.Page.RaisePostBackEvent(NameValueCollection postData) +175
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1565

The strange is:
If I comment the defined in OnInit() handler lines
            dataGrid.ClientSettings.ClientEvents.OnGridCreated = "GridCreated"
            dataGrid.ClientSettings.ClientEvents.OnRowClick = "RowClick"
            dataGrid.ClientSettings.ClientEvents.OnCommand = "GridCommand"

No error returned. Everything is fine...
But the current definition of client handlers is:
                    function RowClick(sender, eventArgs) {  
 
                    }  
 
                    function GridCommand(sender, args) {  
 
                    }  
 
                    function GridCreated(sender, eventArgs) {  
 
                    }  
Please, suggest me to the way of solving the problem.


Scott
Top achievements
Rank 1
 answered on 24 Feb 2015
6 answers
536 views

Hi

Some of my users need to export to excel a huge quantity of information, 40.000 records or more.

i have two problems

1) The operation takes a lot of time (6 minutes or even more). How can i develop a timeout?

2) In my production server an exception is being triggered. But i cannot reproduce that exception in my development environment, so i don't know where to catch it. Below is a copy of the error i'm getting in the production server.:

========

Exception of type 'System.OutOfMemoryException' was thrown.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace:

[OutOfMemoryException: Exception of type 'System.OutOfMemoryException' was thrown.]
   System.String.GetStringForStringBuilder(String value, Int32 startIndex, Int32 length, Int32 capacity) +34
   System.Text.StringBuilder.GetNewString(String currentString, Int32 requiredLength) +73
   System.Text.StringBuilder.Append(Char value) +97
   System.IO.StringWriter.Write(Char value) +28
   System.Web.UI.HtmlTextWriter.RenderBeginTag(HtmlTextWriterTag tagKey) +534
   System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +47
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +17
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +7
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   Telerik.Web.UI.GridTable.RenderContents(HtmlTextWriter writer) +1962
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +29
   Telerik.Web.UI.GridTable.Render(HtmlTextWriter writer) +1802
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +130
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +7
   Telerik.Web.UI.GridTableViewBase.Render(HtmlTextWriter writer) +27
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   Telerik.Web.UI.Grid.Export.TableViewExporter.ExcelExportRenderForm(HtmlTextWriter nullWriter, Control form) +1045
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +2065835
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +59
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +68
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +37
   Telerik.Web.UI.Grid.Export.TableViewExporter.ExcelExportRenderPage(HtmlTextWriter nullWriter, Control page) +102
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +2065835
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
   System.Web.UI.Page.Render(HtmlTextWriter writer) +26
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   Telerik.Web.UI.RadAjaxControl.RenderPageInAjaxMode(HtmlTextWriter writer, Control page) +619
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +2065835
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +24
   System.Web.UI.Page.Render(HtmlTextWriter writer) +26
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +25
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +121
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +22
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1896
===================

I use the method "RadGrid.MasterTableView.ExportToExcel()" , Visual Studio 2005 and RadControls for ASPNET AJAX Q2 2008.

Could you help me with this?

Daniel
Top achievements
Rank 1
 answered on 24 Feb 2015
3 answers
207 views
Hi

I have added dynamically at runtime "GridTemplateColumn" from code behind that column type checkbox how will do this

then when i click button control i need find control for checkbox 
Jayesh Goyani
Top achievements
Rank 2
 answered on 24 Feb 2015
2 answers
121 views
On our web solution, using the editor, in chrome, a tab inserts this:

<p><span class="Apple-tab-span" style="white-space: pre;"> </span></p>

not an issue, but if you immediately press (delete), the html is changed to:

<span class="Apple-tab-span" style="white-space: pre; color: #56585a; font-family: Arial, Helvetica, sans-serif; font-size: 0.8em; background-color: #93bfd9;">

It's like the tab delete sequence triggers some type of macro. 

Anyone seen anything like this? And have a potential solution?

Thanks,
Todd.
Todd A
Top achievements
Rank 1
 answered on 24 Feb 2015
1 answer
232 views
Hi all,

I'm encountering some strange behavior using RadImageEditor.

I have code that displays two images on a page.  This in itself works fine.  However, attempting to resize the image on the server side causes the first image to not display at all, and the second image to not change its size upon display, though stepping through the code and looking at the properties indicates the Height and Width values are changed as expected.  Anyone have an explanation for this behavior?  Code included below.

Thanks in advance for any insights!

--Randy


            try
            {
                RadImageEditor1.ImageUrl = PathToUrl(imagerelpath);
                Telerik.Web.UI.ImageEditor.EditableImage ei = RadImageEditor1.GetEditableImage();
                ei.Resize((int)(ei.Width * .5), (int)(ei.Height * .5));  // browser rendering works as expected (shown full size) without this line
                RadImageEditor1.Height = ei.Height + 58;
                RadImageEditor1.Width = ei.Width;
            }
            catch (Exception ex)
            {
            }

            try
            {
                RadImageEditor2.ImageUrl = PathToUrl(backuprelpath);
                Telerik.Web.UI.ImageEditor.EditableImage ei2 = RadImageEditor2.GetEditableImage();
                ei2.Resize((int)(ei2.Width * .5), (int)(ei2.Height * .5));  // browser rendering works as expected (shown full size) without this line
                RadImageEditor2.Height = ei2.Height + 58;
                RadImageEditor2.Width = ei2.Width;
            }
            catch (Exception ex)
            {
            }
Vessy
Telerik team
 answered on 24 Feb 2015
1 answer
114 views
I have created a radgrid that functions with edit inplace and updates from an outside button to update an receords that were changed.  
I also would like to use the insert button to be able to add a new record. 
I am running in to a problem with the dropdowns because on an insert there is not a value to 'bind/eval', I need the dropdown to say "select' or something similar.  
Can I combine both items in the way I am trying?  I've attached the aspx from my column.  
Please advise.

                <telerik:GridTemplateColumn  UniqueName="PartNumber" SortExpression="PartNumber" AllowFiltering ="true"
                        HeaderText="Part Number"  ReadOnly="false" ItemStyle-VerticalAlign="Top" Visible="true" >
                             <ItemTemplate>
                           <asp:DropDownList ID="DropPart" runat="server" DataSourceID="dsPartNumbers" DataTextField="PartNumber" 
                                DataValueField="CustomerPartNumberID" SelectedValue='<%# DataBinder.Eval(Container.DataItem,"CustomerPartNumberID") %>'  >
                            </asp:DropDownList>
                            </ItemTemplate>
                              <EditItemTemplate>
                                 <asp:DropDownList ID="EditDropPartNumber" runat="server" DataSourceID="dspartNumbers" DataTextField="PartNumber" AppendDataBoundItems="true"
                                DataValueField="CustomerPartNumberID" SelectedValue='<%# bind("CustomerPartNumberID") %>'>
                                  </asp:DropDownList>
                                  <asp:RequiredFieldValidator ID="Validator1" ControlToValidate="EditDropPartNumber" 
                                  ErrorMessage="*Required" runat="server" Display="Dynamic" InitialValue="-- Select --" ForeColor="Red">
                                      </asp:RequiredFieldValidator>
                                </EditItemTemplate>
                    </telerik:GridTemplateColumn>
Konstantin Dikov
Telerik team
 answered on 24 Feb 2015
1 answer
179 views
Hi

     How can I use a Rad grid to perform batch edit, Edit form and Pop-Up edit combined?

     I have a grid which uses batch edit with some drop down, check box and text box control. I want to use Edit form to edit and display another grid (which is                related to the individual rows in the first grid) by clicking on one button similar to the edit button. Also I want to show a pop-up to display and edit other related          data with the first grid on clicking on another button. How can i achieve this?

Thanks & Regards
Lijo Sebastian
Viktor Tachev
Telerik team
 answered on 24 Feb 2015
1 answer
90 views
Hello,

I have a RadGrid, this RadGrid uses an Edit Form Template containing multiple controls for user input. In particular, I am interested in how I can add existing values to a RadComboBox which has multiple checkbox options when the edit form is opened.

Currently, I have methods to get all the values I need to check from my database. I also have all other elements in the grid initialized on edit mode because they are bound in my markup. Below is the code I am trying to use to check some items in the RadComboBox (OnEditOrInsertMode handles RadGrid.OnItemCreated, getFormFactorIds is a function that returns a list of ids to be checked.):

01.protected void OnEditOrInsertMode(object sender, GridItemEventArgs e)
02.{
03.    // Initalizes the RadComboBoxFormFactor combobox like all the other controls in the form.
04.    if (e.Item is GridEditableItem && e.Item.IsInEditMode)
05.    {
06.        GridEditableItem item = (GridEditableItem) e.Item;
07.        RadComboBox formFactorComboBox = (RadComboBox) e.Item.FindControl("RadComboBoxFormFactor");
08.        List<int> formFactorIds = (List<int>) getFormFactorIds((int) ((GridEditableItem)e.Item).GetDataKeyValue("CID"));
09. 
10.        formFactorComboBox.DataBind();
11.        foreach (RadComboBoxItem rcbItem in formFactorComboBox.Items)
12.        {
13.            rcbItem.Checked = formFactorIds.Contains(int.Parse(rcbItem.Value));
14.        }
15.        formFactorComboBox.DataBind();
16.    }
17.}


But, this seems to have no effect when I verify that a particular item has values marked in the multiple select combobox, and step through the code in the debugger and watch the 'Checked' values be set to 'true'.

What is causing the 'Checked' values to be set back to false?
Am I setting the 'Checked' values in the correct handler?

Thanks
Eyup
Telerik team
 answered on 24 Feb 2015
2 answers
139 views
Hi,

I want to hide the text under control (check the attached image file).

And I want to get "SaveSettings" values like json/xml format. Is it possible?
If possible I want take them from javascript, but if it is impossible I want to know how to get this settings from code behind in xml or json format
Eyup
Telerik team
 answered on 24 Feb 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?