Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
272 views
Prior to adding the OnClientClose event handler, closing the RadWindow did not cause a postback.  I added the following function to the RadWindow as the OnClientClose event handler, and now the parent window refreshes with a postback anytime the RadWindow is closed.  The event handler's purpose is to hide a the DropDownList of a RadComboBox within the RadWindow that isn't hidden properly if it's displayed and the user closes the RadWindow (The RadWindow closes, but the RadComboBox's DropDownList remains displayed until you click elsewhere on the page).  How can I prevent the postback?

There are no other Unload or Closing related events on the RadWindow.  Like I said, without the event handler for ClientClose, closing the RadWindow does not cause a postback of the parent window.  I didn't think hideDropDown() would cause a postback (at least, looking at its definition, it doesn't look like it should).

​function rwPOAOptionsDialog_ClientClose(sender, args) {
    $('#<%=luPatient.ClientID%>_cbLookup').hideDropDown();
}
Shinu
Top achievements
Rank 2
 answered on 24 Apr 2014
6 answers
161 views
Protected Sub RadGridProducts_ItemCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGridProducts.ItemCommand 
        ViewState("GridItem") = e.Item ' gets the selected row for detail 
        LblException.Text = "" 
        Select Case e.CommandName 
             
        End Select 
    End Sub 
 
Protected Sub RadGridProducts_DetailTableDataBind(ByVal source As ObjectByVal e As Telerik.Web.UI.GridDetailTableDataBindEventArgs) Handles RadGridProducts.DetailTableDataBind 
        Try 
            Dim item As GridItem = CType(ViewState("GridItem"), GridItem) 
            Dim ProductId As String = RadGridProducts.MasterTableView.DataKeyValues(item.ItemIndex)("Id").ToString() 
            Dim DTable As DataTable = DataAccess.Products.GetAllProductPricesById(ProductId) 
            RadGridProducts.MasterTableView.DetailTables(0).DataSource = DTable 
            RadGridProducts.MasterTableView.DetailTables(0).DataBind() 
        Catch ex As Exception 
        End Try 
    End Sub 
i want to bind the details table view  programmatically with the above code.
But This Gives an error as follows

Type 'Telerik.Web.UI.GridDataItem' in Assembly 'Telerik.Web.UI, Version=2008.3.1314.20, Culture=neutral, PublicKeyToken=121fae78165ba3d4' is not marked as serializable.

Please Help me i dont want to use DataSource Controls as our Project DAL is written in classic way.
Thanks
Angel Petrov
Telerik team
 answered on 24 Apr 2014
1 answer
140 views
I am creating a RadGrid as follows:
protected override void OnInit(EventArgs e)
      {
          this.Controls.Clear();
          this._RadLoadingPanel.ID = "_RadLoadingPanel";
          this._RadLoadingPanel.Transparency = 30;
          this._RadLoadingPanel.Skin = "WebBlue";
          this._RadLoadingPanel.BackgroundPosition = AjaxLoadingPanelBackgroundPosition.Center;
          this.Controls.Add(this._RadLoadingPanel);
  
          this._RadGrid1.Skin = "WebBlue";
          this._RadGrid1.Width = Unit.Percentage(98);
          this._RadGrid1.GridLines = GridLines.None;
  
          this._RadGrid1.AutoGenerateColumns = false;
          this._RadGrid1.AllowSorting = true;
          this._RadGrid1.GridLines = GridLines.None;
          this._RadGrid1.PageSize = 100;
          this._RadGrid1.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;
          this._RadGrid1.ShowGroupPanel = true;
          this._RadGrid1.AllowPaging = true;
          this._RadGrid1.AllowSorting = true;        
          this._RadGrid1.EnableLinqExpressions = false;
          this._RadGrid1.MasterTableView.NoMasterRecordsText = string.Format("There are no documents associated with this order / quote / proposal.");
          this._RadGrid1.MasterTableView.Width = Unit.Percentage(100);                
            
          this._RadGrid1.NeedDataSource += RadGrid1_NeedDataSource;
                       
         // Setup Columns         
          GridBoundColumn boundColumn = new GridBoundColumn();
          this._RadGrid1.MasterTableView.Columns.Add(boundColumn);
          boundColumn.DataField = this._DocList.DescriptionColumn.ColumnName;
          boundColumn.HeaderText = "Document Type";
          boundColumn.UniqueName = "DocumentType";
          boundColumn.AllowSorting = true;    
         
          this._UpdatePanel.Unload += new EventHandler(UpdatePanel_Unload);
          this._UpdatePanel.ID = "ajaxPanel";
          this._UpdatePanel.UpdateMode = UpdatePanelUpdateMode.Always;
          this._UpdatePanel.ContentTemplateContainer.Controls.Add(this._RadGrid1);
  
          this.Controls.Add(this._UpdatePanel);
                        
          base.OnInit(e);
         
      }
protected override void OnPreRender(EventArgs e)
      {
          _RadGrid1.MasterTableView.Rebind();
          base.OnPreRender(e);      
          var ajaxManager = RadAjaxManager.GetCurrent(Page);
  
          if (ajaxManager != null)
              ajaxManager.AjaxSettings.AddAjaxSetting(this._UpdatePanel, this._RadGrid1, this._RadLoadingPanel);        
      }
It gives the following error:
Cannot unregister UpdatePanel with ID 'ajaxPanel' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.
Parameter name: updatePanel

After reading in forums I added the following:
void UpdatePanel_Unload(object sender, EventArgs e)
     {
         MethodInfo methodInfo = typeof(ScriptManager).GetMethods(BindingFlags.NonPublic | BindingFlags.Instance)
     .Where(i => i.Name.Equals("System.Web.UI.IScriptManagerInternal.RegisterUpdatePanel")).First();
         methodInfo.Invoke(ScriptManager.GetCurrent(Page),
             new object[] { sender as UpdatePanel });
     }

This did not resolve it. I even added Controls.clear, but did not work. When I comment out the  boundColumn.DataField = this._DocList.DescriptionColumn.ColumnName; statement, it displays a grid.
Please help me resolve this.
I forgot to mention that the Update {anel of this Radgrid is placed inside another Update Panel.
Eyup
Telerik team
 answered on 24 Apr 2014
1 answer
202 views
Hi guys,


I have page with radgrid which has 3 columns  of data and 1 column of asp:checkbox with allowpaging="true". The problem is when the user selects the values in 1 page and moves to further pages the page is refreshing resulting in unchecking of the selected items.How can I avoid this?I want to retain the checkbox value no matter how many times the user navigates through pages.


Thanks
Shinu
Top achievements
Rank 2
 answered on 24 Apr 2014
6 answers
1.1K+ views

hi, I have a Grid that updates through a User control and uses LINQ in the background and everything works fine until I Edit/Update few times. The problem  is that the grid freezes after I update a couple of times and I get this javascript error. RadGrid.NET2.dll assembly version number is 5.1.3.0. Please help me solve it as this is very urgent. Thanks in anticipation.

Here's my code.

<

asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">

<AjaxSettings><telerik:AjaxSetting AjaxControlID="rgProperties"><UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="rgProperties" /></UpdatedControls>

</telerik:AjaxSetting></AjaxSettings></telerik:RadAjaxManager>

 <rad:RadGrid ID="rgProperties" runat="server" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" AutoGenerateColumns="False" AutoGenerateDeleteColumn="false" AutoGenerateEditColumn="False" EnableAJAX="True" GridLines="None" onneeddatasource="rgProperties_NeedDataSource" Height="700px" OnDeleteCommand="rgProperties_DeleteCommand" OnUpdateCommand="rgProperties_UpdateCommand">

 <clientsettings> <scrolling allowscroll="True" usestaticheaders="True" /> </clientsettings>

<

MasterTableView DataKeyNames="Id" Width="100%">

<

RowIndicatorColumn Visible="False"><HeaderStyle Width="50px"></HeaderStyle>

</

RowIndicatorColumn><ExpandCollapseColumn Visible="true" Resizable="False">

<

HeaderStyle Width="200px"></HeaderStyle>

</

ExpandCollapseColumn>

 <Columns>

 <rad:GridEditCommandColumn EditText="Edit" UpdateText="Update" CancelText="Cancel" UniqueName="EditButtonColumn"></rad:GridEditCommandColumn>

 <rad:GridButtonColumn UniqueName="DeleteColumn" Text="Delete" CommandName="Delete" ConfirmText="Are you sure?" />

 <rad:GridBoundColumn UniqueName="Ref#" HeaderText="RefNo" DataField="RefNo"/>

 <rad:GridBoundColumn UniqueName="Name" HeaderText="Name" DataField="Name"/>

 <rad:GridBoundColumn UniqueName="Description" HeaderText="Description" DataField="Description"/>

 <rad:GridBoundColumn UniqueName="Price" HeaderText="Price" DataField="Price"/>

 <rad:GridBoundColumn UniqueName="Available For" HeaderText="Available For" DataField="idAvailableFor"/>

 <rad:GridBoundColumn UniqueName="Availability" HeaderText="Availability" DataField="idAvailability"/>

 <rad:GridBoundColumn UniqueName="Status" HeaderText="Status" DataField="idStatus"/>

 <rad:GridBoundColumn UniqueName="Property Type" HeaderText="Property Type" DataField="idPropertyType"/>

 <rad:GridBoundColumn UniqueName="Property City" HeaderText="Property City" DataField="IdPropertyCity"/>

 <rad:GridBoundColumn UniqueName="Property Area" HeaderText="Property Area" DataField="IdPropertyArea"/>

 </Columns>

 <EditFormSettings CaptionFormatString="Edit details for Property with Ref Number {0}" CaptionDataField="RefNo" UserControlName="EmployeeDetailsCS.ascx" EditFormType="WebUserControl">

 <FormTableItemStyle Width="100%" Height="29px"></FormTableItemStyle>

 <FormTableStyle GridLines="None" CellSpacing="0" CellPadding="2"></FormTableStyle>

 <FormStyle Width="100%" BackColor="#eef2ea"></FormStyle>

 <EditColumn ButtonType="ImageButton" />

 </EditFormSettings>

 <EditFormSettings UserControlName="~/UserControls/Properties/PropertyEditInsertForm.ascx" EditFormType="WebUserControl">

 <EditColumn UniqueName="EditButtonColumn">

 </EditColumn>

 </EditFormSettings>

</

MasterTableView>

</

rad:RadGrid>

Mehmet
Top achievements
Rank 1
 answered on 23 Apr 2014
1 answer
117 views
Hi Dev,

Hope you are doing good. I wanted to achieve  below scenario using the RadDateTimePicker under the radgrid where N number of RadDateTimePicker can be added or removed.

The StartTime of TimeView should change on the basis of date selection. e. g.
1. All the date before today should not be selectable (Already achieved this using Calendar.RangeMinDate property)
2. By default (if any date is not selected), the time should start from from 12:00 AM.
2. If the date is selected as today, and current time is 4:15 PM the timeview should have start with the 4:30 PM.
3. If date is selected as day after today then time should start from from 12:00 AM.


I have tried setting StartTime in multiple events but only able to set the StartTime properly in RadGrid_OnItemCreated event. but i am not getting the selecteddate here.

Thanks !!!



Angel Petrov
Telerik team
 answered on 23 Apr 2014
1 answer
166 views
I want my end user to select fields from database i allow them and generate reports or charts as they want. is it possible to integrate report designer into asp.net application ? or any other way to achieve my task.
Peter
Telerik team
 answered on 23 Apr 2014
2 answers
108 views
I may have found a bug in the $telerik.getLocation method. I'm using version 2013.3.1324.10 of Telerik UI for ASP.NET AJAX. We ran into an issue in one of our applications where as a user scrolls down a page that contains an AjaxLoadingPanel, when the panel is shown it is shows further up the page than the Ajax panel it should be covering. If I scroll down the page 70px, the AjaxLoadingPanel displays exactly 70px above the panel it should be displaying over. This issue occurs in all webkit based browsers (safari & chrome).

Digging through the telerik client side source we determined that the issue stems from the $telerik.getLocation method. On our page we have 5 total forms, the first of which is hidden within model markup at the top of the page. The $telerik.getLocation method has a specific case towards the end, where it checks if the browser is Safari (really checking for webkit apparently) and if it is, it gets all the forms on the page, then it calls originalGetLocation on the first form in that list. This is where we run into problems. If that form is hidden, originalGetLocation returns a Point object with an x of 0 and y of 0. The script goes on to check if these values are less than zero, if they are it attempts to increment the x and y value of ajax panel by the scroll value of the window which is what is required in order to correctly calculate the position of an element in a webkit browser. The problem is, since originalGetLocation returns 0 for x & y, the increment never happens so as you scroll down the page telerik fails to factor in your scroll and you loading panel shows further and further above the element it should cover. 

I'm not posting the telerik code because I wasn't for sure if it is allowed to add the telerik source that seems to be the problem. Our current source is currently too much to post as an example but I'll try to come up with smaller test case to illustrate the bug.

In the meantime, I've found the removing the check for whether x&y of the form is less than zero and simply incrementing the value no matter what seems to solve the issue in my particular case. Of course, I'd rather not have to override a core method of the telerik source if there is another work around.



Maria Ilieva
Telerik team
 answered on 23 Apr 2014
1 answer
103 views
Hi,


we are using telerik control version 2014.1.225.40(licensed version) and we have IE 10 installed.

On one "cancel" button click event I am getting "jscript runtime error '$telerik' is undefined" error.

and it goes to

if(!$telerik.isChrome&&!$telerik.isSafari) location.

This is happening across the application and we are stuck.
I have implemented with the solution given , but no luck
http://www.telerik.com/help/aspnet-ajax/introduction-troubleshooting.html

Can you pls look and let us give resolution

Thanks,

Suryansu.



Pavlina
Telerik team
 answered on 23 Apr 2014
1 answer
143 views
Is there a way to use javascript to scroll a radgrid to the last row?
Pavlina
Telerik team
 answered on 23 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?