Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
102 views
Hi, 

I m getting following error since last couple of days, when I try to load the application.
For last 2 years there was no issue with data binding. But since last week we are having this issue. This error occurs suddenly with out any modification in application code. Data source also not empty. 
Could you please provide solution for this issue.

ASPX
<RAD:RADGRID ID="radGridReports" RUNAT="server"></RAD:RADGRID>

CS Code
if (!IsPostBack)
{
radGridReports.DataSource = Staff.GetAll();
radGridReports.DataBind();
}


ERROR:
System.ArgumentOutOfRangeException was unhandled by user code
  Message="Specified argument was out of the range of valid values.\r\nParameter name: index"
  Source="System.Web"
  ParamName="index"
  StackTrace:
       at System.Web.UI.ControlCollection.get_Item(Int32 index)
       at Telerik.WebControls.GridGroupPanel.get_MainTable()
       at Telerik.WebControls.GridGroupPanel.InitializeIn(RadGrid grid, Boolean FromViewState)
       at Telerik.WebControls.RadGrid.CreateChildControls(IEnumerable dataSource, Boolean dataBinding)
       at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data)
       at Telerik.WebControls.RadGrid.PerformSelect()
       at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
       at Telerik.WebControls.RadGrid.DataBind()
       at IRM.Authorised.AnalysisServices.Controls.FavoriteReports.ShowReports() in C:\CAMMS_Projects\Development 2.0.0.0\IRM_OnGoing\CAT.IRM.WebApplication\Authorised\AnalysisServices\Controls\FavoriteReports.ascx.cs:line 184
       at IRM.Authorised.AnalysisServices.Controls.FavoriteReports.Page_Load(Object sender, EventArgs e) in C:\CAMMS_Projects\Development 2.0.0.0\IRM_OnGoing\CAT.IRM.WebApplication\Authorised\AnalysisServices\Controls\FavoriteReports.ascx.cs:line 162
       at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
       at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
       at System.Web.UI.Control.OnLoad(EventArgs e)
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Control.LoadRecursive()
       at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Thanks and Best Regards,
Sampath Eleperuma
Sampath
Top achievements
Rank 1
 answered on 20 Jun 2011
1 answer
211 views
I have a chart that is almost generating like I'd like it to. The only thing that is missing is the Labels for the Legend. I currently have the Legend set to display ItemLabels. I thought I set the item labels when I added the item, but apparently not. How do I go about setting these ItemLabels? Below is the code I'm using to build the Chart, and attached is an image of what the chart currently looks like.

reader.GetValue(2) will pull the label text from the database.

CODE
protected void makechart()
        {
            RadChart invChart = new RadChart();
            invChart.ChartTitle.Visible = false;
 
            // Create a ChartSeries and assign its name and chart type
            ChartSeries chartSeries = new ChartSeries();
            chartSeries.Name = "TotalValue";
            chartSeries.Type = ChartSeriesType.Pie;
 
            // Display Item Labels in the Legend
            chartSeries.Appearance.LegendDisplayMode = ChartSeriesLegendDisplayMode.ItemLabels;
             
            // Open SQL Connection
            SqlConnection connection = new SqlConnection(ConfigurationManager.ConnectionStrings["ConnectionString"].ConnectionString);
            connection.Open();
            SqlCommand command = new SqlCommand("GetInventoryValue", connection);
            command.CommandType = CommandType.StoredProcedure;
            SqlDataReader reader = command.ExecuteReader();
 
            while (reader.Read())
            {
                // Set value and value text
                chartSeries.AddItem((Double)(reader.GetValue(0)), reader.GetValue(0).ToString());
            }
 
            // Close SQL Connection
            connection.Close();
 
            // add the series to the RadChart Series collection
            invChart.Series.Add(chartSeries);
            // add the RadChart to the page.
            this.invChart.Controls.Add(invChart);
        }
    }
HrMeibom
Top achievements
Rank 2
Iron
 answered on 20 Jun 2011
5 answers
63 views
Hi

I have a ComboBox that I am using in a Filter Template.

I get the selection event in my javascript block and can apply the filter.

However I cann't return to an unfiltered state.

I notice that even though I get the event, with the correct item the text in the
combo always revert to 'All', my unfiltered state.

So I never get a client side notification that will allow me to set NoFilter.

Help!!!!!! 
Dimitar Terziev
Telerik team
 answered on 20 Jun 2011
7 answers
480 views
Hi,

I have a master/detail grid and I want to loop through all the items. Problem is I just cant seem to get to the detail items.
Somewhere I am missing something.

The reason I want to do this is that each detail row has two RadButton objects that are configured as radio buttons.
I want to persist their values client-side and I have already written the code to update the javascript array when a selection is changed.
I just need to be able to read the value back from the array and set them on the rows controls.

Note: I was able to do this successfully using the grid's onRowCreated event, but then it only works the first time it loads.
After an ajax update it wont find the controls in the rows again using args.get_item().findControl()

Any help would be appreciated thanks.


function onGridCreated(sender, args) {
                alert("onGridCreated");
 
 
                var masterTable = sender.get_masterTableView();
                //alert(masterTable.get_dataItems().length);
 
                var i = 0;
                 
                var rows = masterTable.get_dataItems();
 
                for (var i = 0; i < rows.length; i++) {
 
                     
                    for (var j = 0; j < i.rows; j++) {
 
                        var btnIsDualListedYes = args.get_item().findControl("btnIsDualListedYes");
                        var btnIsDualListedNo = args.get_item().findControl("btnIsDualListedNo");
 
                        if (btnIsDualListedYes != null && btnIsDualListedNo != null) {
                            var intrumentMasterID = btnIsDualListedYes.get_groupName();
 
                            if (dualListedSelection[id]) {
                                alert("Dual Listed " + id + " True");
 
                                btnIsDualListedYes.set_checked(true);
                                btnIsDualListedNo.set_checked(false);
                            }
                            else {
                                alert("Dual Listed " + id + " False");
                                btnIsDualListedYes.set_checked(false);
                                btnIsDualListedNo.set_checked(true);
                            }
                        } else {
                            alert("btnIsDualListedYes and btnIsDualListedNo is NULL");
                        }
 
//                    }
 
                }
Konrad
Top achievements
Rank 1
 answered on 20 Jun 2011
5 answers
115 views
I have a page that has a RadFormDecorator on it which is decorating CheckBoxes.  I also have a RadComboBox on the page where I am putting CheckBoxes in the ItemTemplate.  When the page renders the CheckBoxes are not visible.  If I turn off the CheckBox decoration in the RadFormDecorator they appear.

<rad:RadFormDecorator ID="RadFormDecorator1" runat="server" DecorationZoneID="BodyContents" DecoratedControls="Buttons, CheckBoxes, RadioButtons" /> 
 
<rad:RadComboBox ID="rcbTradeStatus" runat="server" DataValueField="pkTradeStatus" DataTextField="sStatusDesc" Width="300px" HighlightTemplatedItems="true" AllowCustomText="true">  
    <ItemTemplate> 
        <asp:CheckBox ID="cbTradeStatus" runat="server" TextAlign="Right" Text='<%# Eval("sStatusDesc") %>' />   
    </ItemTemplate> 
</rad:RadComboBox> 
Dimitar Terziev
Telerik team
 answered on 20 Jun 2011
1 answer
96 views
I am using telerik RadGrid.

Here I am having around thousands of records(rows) in my grid. I have my pagesize of 10 records per page. Now when i am using 'Show all results', all the records are getting populated on single page. So, now I am having vertical scroll bar to scroll down.

Now here the issue is, when I am scrolling down to any record and the selecting that row(say 50th) then my grid is again getting scrolled up to first record. Though that 50th record is selected when i am again scrolling down.

So, is there any option to stop this kind of automatic scrolling up when clicking on any row?

Thanks in advance...
Pavlina
Telerik team
 answered on 20 Jun 2011
1 answer
109 views
Hi,

I am running into an issue with the Calendar Datepicker control in IE6 and 7 and IE8/9 in compatibility mode, when the controls are drawn dynamically with absolute positioning.  The controls drop about 10px down from their intended position sometimes as soon as the screen draws and sometimes when the mouse hovers over the first datapicker control.  Below is an example of a test I built to demonstrate this behavior.
Please note the DOCTYPE tag I am using for the page, and that the application is running ASP.Net 4.  I am using build 2011.1.413.40 of the Telerik.Web.UI assembly.

Page3.aspx
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Page3.aspx.vb" Inherits="ASPNET4Test1.Page3" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
 
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        </telerik:RadAjaxManager>
    <div>
            <asp:Panel ID="Panel1" runat="server">
            </asp:Panel>
    </div>
    </form>
</body>
</html>


Page3.aspx.vb
Imports System.Data
Imports System.Collections.Generic
Imports Telerik.Web.UI
Imports System.Linq
 
Public Class Page3
    Inherits System.Web.UI.Page
 
    Private Sub Panel1_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Panel1.Init
        Try
            Dim _date3 As RadDatePicker = Nothing
            Dim oLabel As Label
            Dim _cal As RadCalendar = Nothing
            Dim _calAdded As Boolean = False
            Dim Pnl As System.Web.UI.WebControls.WebControl = Panel1
            Dim _posLeft As Integer = 80
            Dim _posLabelLeft As Integer = 20
            Dim _posTop As Integer
 
            For _tabIndex As Integer = 1 To 3
                _posTop = _tabIndex * 20 + 20
                If IsNothing(_cal) Then
                    _cal = New RadCalendar()
                    _cal.ID = "sharedcalendar"
                    Pnl.Controls.Add(_cal)
                End If
 
                oLabel = New Label
                oLabel.Style.Add("position", "absolute")
                oLabel.Style.Add("top", String.Format("{0}px", (_posTop).ToString()))
                oLabel.Style.Add("left", String.Format("{0}px", (_posLabelLeft).ToString()))
                oLabel.Style.Add("width", String.Format("{0}px", (50).ToString()))
                oLabel.Style.Add("height", String.Format("{0}px", (22).ToString()))
                oLabel.Text = "Field " + _tabIndex.ToString()
                oLabel.CssClass = "fls "
                oLabel.EnableViewState = True
                Pnl.Controls.Add(oLabel)
 
                _date3 = New RadDatePicker()
                _date3.ID = "dtp_" + _tabIndex.ToString()
                _date3.Width = Unit.Pixel(60 + 15)  '+ 10   ' 87   
                _date3.Height = Unit.Pixel(22 - 5)  ' - 13
                _date3.TabIndex = _tabIndex
                _date3.SharedCalendar = _cal
                _date3.Style.Add("position", "absolute")
                _date3.Style.Add("top", String.Format("{0}px", (_posTop).ToString()))
                _date3.Style.Add("left", String.Format("{0}px", _posLeft.ToString()))   ' sCLeft)
                _date3.Attributes.Add("fieldid", "fld" + _tabIndex.ToString())
                _date3.Attributes.Add("fieldname", "fld" + _tabIndex.ToString())
                _date3.Attributes.Add("fieldtype", "date")
                _date3.Calendar.EnableNavigationAnimation = True
                _date3.Culture = System.Globalization.CultureInfo.CurrentUICulture
                _date3.MinDate = CDate("1900-1-1")
                _date3.ShowPopupOnFocus = True
                _date3.DatePopupButton.Visible = False
                _date3.DateInput.EmptyMessage = System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern.ToUpper()
                _date3.DateInput.DateFormat = System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern
                _date3.DateInput.DisplayDateFormat = System.Globalization.CultureInfo.CurrentUICulture.DateTimeFormat.ShortDatePattern
                _date3.DateInput.SelectionOnFocus = SelectionOnFocus.SelectAll
                _date3.DateInput.ShowButton = False
                _date3.DateInput.Width = Unit.Pixel(60)
                _date3.DateInput.Height = Unit.Pixel(22 - 5)
                Pnl.Controls.Add(_date3)
            Next
        Catch ex As System.Exception
            Trace.Write(String.Format("Failed to draw fields. Exception: {0}", ex.ToString()))
            Throw
        Finally
            Trace.Write("End ---> Panel1_Init")
        End Try
    End Sub
End Class

Here is an image depicting the behavior I am experiencing this this page.


Thanks
Ali M.
Galin
Telerik team
 answered on 20 Jun 2011
5 answers
217 views
Hello,

I am using Telerik AJAX Hierarchical Grid. I am using the version of 2010.3.1317.20. I cant upgrade to the latest version as the framework I am using .Net 2.0.

Now the issues is, below is my code. I dont see the Ajax loader and also getting an error saying the two controls cannot have the ID. So I have changed the AjaxControlID in AjaxSettings.

I want to show the busy icon on the grid, either the user do some action on the grid like clicking delete button on any of the row. or adding new rows to the grid or until the grid loads the data.

I am assigning the datasource from the SQL Server database.

My page where i have embedd the telerik grid is inside the contentplaceholder.

<asp:UpdatePanel ID="upGetStatus" runat="server" UpdateMode="Conditional">
                <ContentTemplate>
                    <asp:Panel ID="pnlMain" runat="server">
                        <asp:Label ID="lblError" runat="server" Font-Bold="true" ForeColor="Red"></asp:Label>
                        <br />
                        <div id="Div1" style="z-index: 103; width: 80%; text-align: left" runat="server"
                            font-size="Large" font-names="Arial" font-bold="True" height="21px">
                            <div>
                                <div style="width: 20%; float: left">
                                    <asp:Label ID="lblParentSerialNumber" runat="server">Parent Serial #</asp:Label>
                                </div>
                                <div style="width: 80%;">
                                    <asp:TextBox ID="txtParentSerialNumber" runat="server" Width="150px" CausesValidation="false"
                                        AutoPostBack="false" MaxLength="12"></asp:TextBox>                                    
                                </div>
                            </div>
                            <div>
                                <div style="width: 20%; float: left; height: 19px;">
                                    <asp:Label ID="lblSubSerialNumbers" runat="server">Sub Serial #</asp:Label>
                                </div>
                                <div style="width: 50%;">
                                    <asp:TextBox ID="txtSubSerialNumbers" runat="server" TextMode="MultiLine" Width="150px"
                                        Height="150px" AutoPostBack="false" CausesValidation="false"></asp:TextBox>
                                </div>
                            </div>
                            <div style="float: right">
                                <asp:Button ID="btnValidate" TabIndex="6" runat="server" Font-Bold="True" Width="130px"
                                    BackColor="DarkKhaki" Text="Validate and Save" CausesValidation="true"></asp:Button>
                                <%-- <asp:Button ID="btnSave" TabIndex="4" runat="server" Font-Bold="True" Width="70px"
                                    BackColor="Green" Text="Save" Enabled="false" />--%>
                                <asp:Button ID="btnClear" TabIndex="5" runat="server" Font-Bold="True" Width="70px"
                                    BackColor="Peru" Text="Clear" CausesValidation="false" />
                            </div>
                        </div>
                        <br />
                        <div style="width: 80%; text-align: left">
                              
                        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                            <AjaxSettings>
                                <telerik:AjaxSetting AjaxControlID="RadGrid11">
                                    <UpdatedControls>
                                        <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
                                    </UpdatedControls>
                                </telerik:AjaxSetting>
                            </AjaxSettings>
                        </telerik:RadAjaxManager>
                        <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Width="95%"
                            Transparency="5">
                            <img style="border: 0; margin-top: 150px;" alt="Loading..." src="Images/infineralogo.gif" />
                        </telerik:RadAjaxLoadingPanel>
  
                        <telerik:RadGrid ID="RadGrid1" runat="server" Width="95%" ShowStatusBar="true" AutoGenerateColumns="False"
                            PageSize="10" AllowSorting="True" AllowMultiRowSelection="False" AllowPaging="True"
                            AlternatingItemStyle-BackColor="Ivory" ItemStyle-BackColor="LightGoldenrodYellow"
                            HeaderStyle-BackColor="SandyBrown" GridLines="None">
                            <PagerStyle Mode="NumericPages"></PagerStyle>
                            <MasterTableView Width="100%" DataKeyNames="ParentSerialNumber" AllowMultiColumnSorting="False">
                                <DetailTables>
                                    <telerik:GridTableView DataKeyNames="SerialNoAssociateId" Name="SubSerialNumberGrid"
                                        Width="100%" AllowSorting="true">
                                        <Columns>
                                            <telerik:GridBoundColumn SortExpression="SerialNoAssociateId" HeaderText="SerialNoAssociateId"
                                                HeaderButtonType="TextButton" DataField="SerialNoAssociateId" Visible="false">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn SortExpression="ParentSerialNumber" HeaderText="ParentSerialNumber"
                                                HeaderButtonType="TextButton" DataField="ParentSerialNumber" Visible="false">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridBoundColumn SortExpression="SubSerialNumber" HeaderText="Sub Serial Number"
                                                HeaderButtonType="TextButton" DataField="SubSerialNumber">
                                            </telerik:GridBoundColumn>
                                            <telerik:GridButtonColumn HeaderText="Delete" ConfirmTitle="MPT" ConfirmDialogType="Classic"
                                                ButtonType="ImageButton" ConfirmText="Are you sure you want to delete?" ItemStyle-HorizontalAlign="Left"
                                                CommandName="DeleteSubSerial" Text="Delete" ImageUrl="Images/Delete.jpg">
                                            </telerik:GridButtonColumn>
                                        </Columns>
                                    </telerik:GridTableView>
                                </DetailTables>
                                <Columns>
                                    <telerik:GridBoundColumn SortExpression="ParentSerialNumber" HeaderText="Parent Serial Number"
                                        HeaderButtonType="TextButton" DataField="ParentSerialNumber">
                                    </telerik:GridBoundColumn>
                                </Columns>
                            </MasterTableView>
                        </telerik:RadGrid>
                        </div>
                        <br />
                        <div style="width: 80%; text-align: left">
                            <asp:DataGrid ID="dgdErrors" runat="server" AutoGenerateColumns="true" CellSpacing="2"
                                GridLines="None" Visible="false">
                                <AlternatingItemStyle BackColor="Ivory"></AlternatingItemStyle>
                                <ItemStyle BackColor="LightGoldenrodYellow"></ItemStyle>
                                <HeaderStyle BackColor="SandyBrown"></HeaderStyle>
                            </asp:DataGrid>
                        </div>
                    </asp:Panel>
                </ContentTemplate>
            </asp:UpdatePanel>
Iana Tsolova
Telerik team
 answered on 20 Jun 2011
3 answers
156 views
Hi,

Is it possible to open a RadWindow when I click an item on the RadGrid even by adding a link inside? I did have a solution but it reloads the page and its very sloppy.

The way I did it was that I added the following in my aspx:

 <telerik:GridHyperLinkColumn DataTextFormatString="Edit Item"
        avigateUrlFields="country_id" UniqueName="country_id"         DataNavigateUrlFormatString="~/admin/AdmCountries.aspx?edit_id={0}"
                        HeaderText="Edit Item" DataTextField="country_id" >
        </telerik:GridHyperLinkColumn>

then I updated my codebehind's OnPageLoad like this:
           
       
 string editID = Request.QueryString["edit_id"];
 
if (editID != null)
{
  RadWindowManager1.Windows[0].VisibleOnPageLoad = 
true;
} else {
  RadWindowManager1.Windows[0].VisibleOnPageLoad = false;
}


So essentially reloading the page with the ID parameter and if it is set then the window is displayed. What I would like instead is not to have a postback, rather displaying the window with a given ID, maybe using AJAX.

I am new to this great product and would like to get the hang of it, please help.

Thanks,
Miklos
Shinu
Top achievements
Rank 2
 answered on 20 Jun 2011
1 answer
64 views
Hello,

I need to gain on Space specially in height on a page containing a RadCalendar.  I tried to change the height and width properties of the radcalendar component, and i note that its size get invariant below a given threshold values.  In the attached document, you can see in the first image the min calendar size i have got , and in the second the size of the calendar  that i would like to get  ( I want more tight calendar cells). Should i create a new skin. If it is the case, which CSS classes should i redefine?

Thanks & Regards,


Shinu
Top achievements
Rank 2
 answered on 20 Jun 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?