Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
105 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
167 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.0K+ 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
91 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
120 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
94 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
88 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
113 views
Is there a way to use javascript to scroll a radgrid to the last row?
Pavlina
Telerik team
 answered on 23 Apr 2014
2 answers
151 views
Hello people,

I have coded my EF5 dbcontext RadGrid datasource as this:

<telerik:RadGrid ID="RadGrid1"
          runat="server"
          CellSpacing="0" DataSourceID="edsMainGrid"
...

<asp:EntityDataSource ID="edsMainGrid" runat="server" 
                            OnContextCreating="edsMainGrid_ContextCreating"
                            EntitySetName="myCollection">
</asp:EntityDataSource>

Protected Sub edsMainGrid_ContextCreating(sender As Object, e As EntityDataSourceContextCreatingEventArgs)
        Dim ctx As myEntities = myEntities()
        e.Context = TryCast(ctx, IObjectContextAdapter).ObjectContext
End Sub


and all runs fine in EF5 but ....


... I'm migrating to EF6. And, as you know, they are several namespaces ported to EntityFramework.dll.

My issue is, than, in EF6, an error is raised in this line of code:

e.Context = TryCast(ctx, IObjectContextAdapter).ObjectContext

The issue is than e.Context and TryCast(ctx, IObjectContextAdapter).ObjectContext, both are ObjectContext objects, the same type, but declared in separate namespace. The error “Value of type 'System.Data.Objects.ObjectContext' cannot be converted to 'System.Data.Entity.Core.Objects.ObjectContext'“ occurs.

My question:

What is the right way to set dbcontext datasource for radgrind in EF6?



thanks in advance!






Daniel
Top achievements
Rank 1
 answered on 23 Apr 2014
2 answers
75 views
Hi,

I´m looking for a way to set flat colors for bar chart. So avoiding this chromish color effect /  color transition.
I just want to set #DA5430  for instance and not getting any "color effects" applied.

Is it possible?
Michael
Top achievements
Rank 1
 answered on 23 Apr 2014
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?