Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
318 views

Hi,

We are testing the radScheduler for ASP.NET AJAX, we need to drag a branch name and ID from the tree view and create a visit schedule for that branch. On the nodeDropping event  we are creating a new appointment, can we add a new attribute to the appointment from the client side other than set_start, set_end and set_subject, like below we need to add "SiteId" as an attribute to the appointment.

                    var newAppointment = new Telerik.Web.UI.SchedulerAppointment();
                    newAppointment.set_start(startTime);
                    newAppointment.set_end(endTime);
                    newAppointment.set_subject(text);
                    newAppointment.set_description(siteId);
                    newAppointment.get_attributes().setAttribute("SiteId", siteId);

And in the server-side on post back, we will get all the appointments and update the database accordingly.

   foreach (Appointment a in RadScheduler1.Appointments)
        {
            string strSiteID;
            string strSubjectSiteId = a.Subject;
            DateTime startDate = a.Start;           
           string siteID = a.Attributes["SiteId"];         
        }

There is no error thrown we set the attribute at the client side, but in server side we are getting null and this attribute count is set to 0.
We have added the CustomAttributeNames="SiteId" into the markup.

Can you please guide us how we can add a custom attribute to the a Telerik.Web.UI.SchedulerAppointment.

Thank you

Regards,
Majid

 

Boyan Dimitrov
Telerik team
 answered on 24 Apr 2014
1 answer
271 views
1.if (!Page.IsPostBack)
2.{
3.    DataTable table = agenda.GetMeetings(DateTime.Now.AddDays(-30), DateTime.Now.AddDays(30));
4.    var meetings = table.AsEnumerable().OrderByDescending(m => m.Field<DateTime>("StartTime"));
5. 
6.    RadGrid1.DataSource = meetings;
7.    RadGrid1.DataBind();
8.}

Above is the databinding code.

Here is the GridHyperLinkColumn:

1.<telerik:GridHyperLinkColumn Text="View Agenda" HeaderText="" DataNavigateUrlFields="MeetingID"
2.    DataNavigateUrlFormatString="~/Routing/ViewAgenda.aspx?MeetingID={0}">
3.</telerik:GridHyperLinkColumn>

The column does not populate the DataNavigateURLFields property if the table is bound after the AsEnumberable conversion. If binding directly to the DataTable type, the hyperlink will work.
Eyup
Telerik team
 answered on 24 Apr 2014
1 answer
105 views
I use version 2011.1.413.35
LinkManager is missing OK button in Internet Explorer 11 but the buttons are visible in Firefox and Chrome.

Jon
Top achievements
Rank 1
 answered on 24 Apr 2014
15 answers
917 views
I have 4 row fields defined in RadPivotGrid. I made all row fields colapsed initially by set RowGroupsDEfaultExpanded attribute to false. But once I click the expand button on top level, it expands all 4 level for me, but I expect just expand level 2. Is there any way to change it? Thanks.
Angel Petrov
Telerik team
 answered on 24 Apr 2014
1 answer
281 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
167 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
151 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
210 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
119 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
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?