Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
160 views
I have a RadGrid on my Master page, and I'd like to put the DataSource on the content page.  (The data source will change depending on which content page is loaded).  Is this possible?
Kamal
Top achievements
Rank 1
 answered on 25 Feb 2015
3 answers
98 views
I've got a SQLDatasource that pulls back a qty on a monthly basis.  Currently the XAXIS is the Month.  However, If I hard code the month, the data does not correctly line up.  If I don't hard code the Items the data is correct; however the month's are not in order.

I've posted two images.  The first one is how the data looks through SQL.  There are only 4 months, I plan on making a query parameter based on a RadComboBox later.  The second is an image of the two Chart's below, I've been toying with.  I only need one of them to work properly, just included both to show what I've tried thus far.

I really need help displaying all 12 months in order on the left hand side of the chart, and linking the correct value to be displayed..  

01.<table style="width: 100%;">
02.    <tr>
03.        <td style="width: 50%;">
04.            <telerik:RadHtmlChart ID="HardCodedMonthNames" runat="server" DataSourceID="SqlDataSourceNearMissByMonth">
05.                <ChartTitle Text="Near Misses By Month">
06.                </ChartTitle>
07.                <Legend>
08.                    <Appearance Visible="False" />
09.                </Legend>
10.                <PlotArea>
11.                    <XAxis Visible="True" DataLabelsField="Month">
12.                        <Items>
13.                            <telerik:AxisItem LabelText="January" />
14.                            <telerik:AxisItem LabelText="February" />
15.                            <telerik:AxisItem LabelText="March" />
16.                            <telerik:AxisItem LabelText="April" />
17.                            <telerik:AxisItem LabelText="May" />
18.                            <telerik:AxisItem LabelText="Jun" />
19.                            <telerik:AxisItem LabelText="July" />
20.                            <telerik:AxisItem LabelText="Aug" />
21.                            <telerik:AxisItem LabelText="September" />
22.                            <telerik:AxisItem LabelText="October" />
23.                            <telerik:AxisItem LabelText="November" />
24.                            <telerik:AxisItem LabelText="December" />
25.                        </Items>
26.                    </XAxis>
27. 
28.                    <YAxis Visible="True" Name="Number of Assessments">
29.                        <TitleAppearance Position="Center" RotationAngle="0"
30.                                         Text="Near Misses" />
31.                    </YAxis>
32. 
33.                    <Series>
34.                        <telerik:BarSeries DataFieldY="Qty" Name="Month">
35.                        </telerik:BarSeries>
36.                    </Series>
37.                </PlotArea>
38.            </telerik:RadHtmlChart>
39.        </td>
40.        <td style="width: 50%;">
41.            <telerik:RadHtmlChart ID="QueryBasedMonthNames" runat="server" DataSourceID="SqlDataSourceNearMissByMonth">
42.                <ChartTitle Text="Near Misses By Month">
43.                </ChartTitle>
44.                <Legend>
45.                    <Appearance Visible="False" />
46.                </Legend>
47.                <PlotArea>
48.                    <XAxis Visible="True" DataLabelsField="MonthName">
49. 
50.                    </XAxis>
51. 
52.                    <YAxis Visible="True" Name="Number of Assessments">
53.                        <TitleAppearance Position="Center" RotationAngle="0"
54.                                         Text="Near Misses" />
55.                    </YAxis>
56. 
57.                    <Series>
58.                        <telerik:BarSeries DataFieldY="Qty" Name="Month">
59.                        </telerik:BarSeries>
60.                    </Series>
61.                </PlotArea>
62.            </telerik:RadHtmlChart>
63. 
64.        </td>
65.    </tr>
66.</table>
67.<asp:SqlDataSource ID="SqlDataSourceNearMissByMonth" runat="server" ConnectionString="<%$ ConnectionStrings:OSHAConnectionString %>" SelectCommand="
68.                   select 'ABC COMPANY' AS LOCATION,
69.                   MONTH,
70.                   Year,
71.                   DateName( month , DateAdd( month , [MONTH] , 0 ) - 1 ) as MonthName,
72.                   COUNT(ID) as Qty
73.                   from aaa_v_ReportingData
74.                   where IncidentType = 'Near Miss'
75.                   and incidentdate is not null
76.                   group by Location,
77.                   Year,
78.                   MONTH,
79.                   DateName( month , DateAdd( month , [MONTH] , 0 ) - 1 )
80.                   Order by MONTH
81.                   ">
82.</asp:SqlDataSource>
Skip
Top achievements
Rank 1
 answered on 24 Feb 2015
4 answers
142 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.3K+ 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
476 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
154 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
79 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
184 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
85 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
133 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?