Hi
I have a RadPane which loads an aspx page that contains a RadComboBox.
A Javascript function on the parent page is trying to find the element -
$('#RAD_SPLITTER_PANE_CONTENT_MyRadPane').contents().contents().find("#" + cbo.id)
However, this returns just a jQuery object which is not useful when I want to manipulate the items using get_items() etc.
How can I get the Telerik client object in this scenario?
Thanks in advance.
Hi,
I am facing an issue with the tab index order. The expected tabindex order should be ‘header – body – footer’ but the order is ‘header – footer – body’. After tabbing the last column in header, the tab should go to first checkbox in the 1st row, but the tab is going to the page nation in the footer, and after that it goes to the first checkbox in the 1st row. I checked in the developer tools and noticed that Telerik control renders in html as <thead>, <tfoot> and <tbody> which is disturbing the tab index order. Please let me know how can i resolve this issue? I am using 2016 version of telerik.ui.dll.
Thanks in advance.
Hello --
I have a custom task class and a custom provider (non-EM). Both follow the model code, and work perfectly on page load.
When changing values, the server side TaskUpdate event fires, and e.Tasks(0) has the expected values for the task that was just updated.
However...
Problem 1: e.Tasks(0) is a standard Task object, and not my CustomTask object. How can I get my custom field values on TaskUpdate?
Problem 2: Sender, while containing the appropriate RadGantt properties set on the .aspx page, does not have the Provider I gave it on Page Load. Also, Tasks contains zero object and GetAllTasks returns nothing.
I'm not sure what code will help, so I'll just post it all. Sorry for the length.
Gantt declaration on the .aspx:
<telerik:RadAjaxManager runat="server" EnableAJAX="true" ></telerik:RadAjaxManager>
<telerik:RadAjaxPanel runat="server" >
<telerik:RadGantt runat="server" RenderMode="Auto" ID="RadGantt1" Enabled="true" Visible="true"
Skin="BlackMetroTouch" Height="600" Width="100%" ListWidth="60%"
AllowColumnResize="true" AllowSorting="true" ReadOnly="false" ShowTooltip="false"
EnablePdfExport="true" AutoGenerateColumns="false" DisplayDeleteConfirmation="true"
AllowPercentCompleteDrag="false" ShowCurrentTimeMarker="true" EnableViewState="true"
SelectedView="WeekView" WeekView-UserSelectable="true" YearView-UserSelectable="true"
DayView-UserSelectable="true" MonthView-UserSelectable="true">
<Columns>
<telerik:GanttBoundColumn DataField="Title" DataType="String" Width="180px" />
<telerik:GanttBoundColumn DataField="Start" DataType="DateTime" DataFormatString="dd/MM/yy" Width="80px" />
<telerik:GanttBoundColumn DataField="End" DataType="DateTime" DataFormatString="dd/MM/yy" Width="80px" />
<telerik:GanttBoundColumn DataField="System" HeaderText="System" DataType="String" Width="120px" />
<telerik:GanttBoundColumn DataField="ActivityType" HeaderText="Type" DataType="String" Width="120px" />
<telerik:GanttBoundColumn DataField="AssignedTo" HeaderText="AssignedTo" DataType="String" Width="120px" />
<telerik:GanttBoundColumn DataField="NotificationAddress" HeaderText="Notify" DataType="String" Width="250px" />
<telerik:GanttBoundColumn DataField="Description" HeaderText="Description" DataType="String" Width="300px" />
</Columns>
<CustomTaskFields>
<telerik:GanttCustomField PropertyName="Description" ClientPropertyName="description" Type="String" />
<telerik:GanttCustomField PropertyName="AssignedTo" ClientPropertyName="assignedTo" Type="String" />
<telerik:GanttCustomField PropertyName="System" ClientPropertyName="system" Type="String" />
<telerik:GanttCustomField PropertyName="ActivityType" ClientPropertyName="activityType" Type="String" />
<telerik:GanttCustomField PropertyName="NotificationAddress" ClientPropertyName="notificationAddress" Type="String" />
</CustomTaskFields>
<DataBindings>
<TasksDataBindings IdField="ID" ParentIdField="ParentID" StartField="Start" EndField="End" TitleField="Title" PercentCompleteField="PercentComplete" SummaryField="Summary" ExpandedField="Expanded" OrderIdField="OrderID" />
<DependenciesDataBindings TypeField="Type" IdField="ID" PredecessorIdField="PredecessorID" SuccessorIdField="SuccessorID" />
</DataBindings>
</telerik:RadGantt>
</telerik:RadAjaxPanel>
The page code-behind:
Private Sub RadGantt1_TaskUpdate(sender As Object, e As TaskEventArgs) Handles RadGantt1.TaskUpdate
' Both sender and RadGantt1 have no tasks here!
'e.Tasks(0) is a standard Task object. How can I get my custom column data?
End Sub
Lastly, sorry for the huge clip, but I don't know what could be significant.
Here's the custom provider. It seems to work fine.
Imports System.Data.SqlClient
Imports Telerik.Web.UI
Imports Telerik.Web.UI.Gantt
Public Class CustomTask
Inherits Task
Public Sub New()
MyBase.New()
End Sub
Public Property Description() As String
Get
Return DirectCast(If(ViewState("Description"), ""), String)
End Get
Set(value As String)
ViewState("Description") = value
End Set
End Property
Public Property AssignedTo() As String
Get
Return DirectCast(If(ViewState("AssignedTo"), ""), String)
End Get
Set(value As String)
ViewState("AssignedTo") = value
End Set
End Property
Public Property System() As String
Get
Return DirectCast(If(ViewState("System"), ""), String)
End Get
Set(value As String)
ViewState("System") = value
End Set
End Property
Public Property RunActivityID() As Integer
Get
Return DirectCast(If(ViewState("RunActivityID"), ""), Integer)
End Get
Set(value As Integer)
ViewState("RunActivityID") = value
End Set
End Property
Public Property ActivityType() As String
Get
Return DirectCast(If(ViewState("ActivityType"), ""), String)
End Get
Set(value As String)
ViewState("ActivityType") = value
End Set
End Property
Public Property NotificationAddress() As String
Get
Return DirectCast(If(ViewState("NotificationAddress"), ""), String)
End Get
Set(value As String)
ViewState("NotificationAddress") = value
End Set
End Property
Public Property ScheduleDays() As String
Get
Return DirectCast(If(ViewState("ScheduleDays"), ""), String)
End Get
Set(value As String)
ViewState("ScheduleDays") = value
End Set
End Property
Protected Overrides Function GetSerializationData() As IDictionary(Of String, Object)
Dim dict = MyBase.GetSerializationData()
dict("Description") = Description
dict("AssignedTo") = AssignedTo
dict("System") = System
dict("RunActivityID") = RunActivityID
dict("ActivityType") = ActivityType
dict("NotificationAddress") = NotificationAddress
dict("ScheduleDays") = ScheduleDays
Return dict
End Function
Public Overrides Sub LoadFromDictionary(values As System.Collections.IDictionary)
MyBase.LoadFromDictionary(values)
Description = DirectCast(values("Description"), String)
AssignedTo = DirectCast(values("AssignedTo"), String)
System = DirectCast(values("System"), String)
RunActivityID = DirectCast(values("RunActivityID"), Integer)
ActivityType = DirectCast(values("ActivityType"), String)
NotificationAddress = DirectCast(values("NotificationAddress"), String)
ScheduleDays = DirectCast(values("ScheduleDays"), String)
End Sub
End Class
Public Class CustomGanttTaskFactory
Implements ITaskFactory
Private Function ITaskFactory_CreateTask() As Task Implements ITaskFactory.CreateTask
Return New CustomTask()
End Function
End Class
Public Class GanttCustomProvider
Inherits GanttProviderBase
Private TemplateName As String
Private RunID As Integer
Private ProcString As String 'all three of these are used to help form the SQL queries
Public Sub New()
MyBase.New()
End Sub
Public Sub New(Template As String)
MyBase.New()
TemplateName = Template
ProcString = "@TemplateName = '" & TemplateName & "'"
End Sub
Public Sub New(SandboxRunID As Integer)
MyBase.New()
RunID = SandboxRunID
ProcString = "@RunID = " & SandboxRunID.ToString
End Sub
Public Overrides ReadOnly Property TaskFactory() As ITaskFactory
Get
Return New CustomGanttTaskFactory()
End Get
End Property
Public Overrides Function GetTasks() As List(Of ITask)
Dim tasks = New List(Of ITask)()
Dim strConn As String = ConfigurationManager.ConnectionStrings("DefaultConnection").ConnectionString
Dim conn As New SqlConnection(strConn)
Dim cmdCommand As SqlCommand = conn.CreateCommand()
cmdCommand.CommandText = "usp_Telerik_Task_SELECT " & ProcString
cmdCommand.CommandType = System.Data.CommandType.Text
conn.Open()
Dim dr As SqlDataReader = cmdCommand.ExecuteReader()
If dr.HasRows Then
While dr.Read()
Dim newTask As New CustomTask
newTask.ID = dr("ID")
newTask.ParentID = dr("ParentID")
newTask.OrderID = dr("OrderID")
newTask.Title = dr("Title")
newTask.Start = dr("Start")
newTask.End = dr("End")
newTask.PercentComplete = dr("PercentComplete")
newTask.Expanded = dr("Expanded")
newTask.Summary = dr("Summary")
newTask.Description = dr("Description")
newTask.AssignedTo = dr("Assigned To")
newTask.System = dr("StageID").ToString()
newTask.RunActivityID = dr("RunActivityID")
newTask.ActivityType = dr("ActivityType")
newTask.NotificationAddress = dr("Notification Address")
newTask.ScheduleDays = dr("ScheduleDays")
tasks.Add(newTask)
End While
End If
tasks(0).ParentID = Nothing
tasks(0).Summary = True
Return tasks
End Function
Public Overrides Function UpdateTask(task As ITask) As ITask
Dim strConn As String
Dim sqlText As String = "usp_Telerik_Task_UPDATE "
sqlText = sqlText & "@ID = " & task.ID.ToString
sqlText = sqlText & ", @ParentID = " & task.ParentID.ToString
sqlText = sqlText & ", @OrderID = " & task.OrderID.ToString
sqlText = sqlText & ", @Title = '" & task.Title & "'"
sqlText = sqlText & ", @Start = '" & task.Start.ToString & "'"
sqlText = sqlText & ", @End = '" & task.End.ToString & "'"
sqlText = sqlText & ", @PercentComplete = " & task.PercentComplete.ToString
sqlText = sqlText & ", @Expanded = " & task.Expanded.ToString()
sqlText = sqlText & ", @Summary = " & task.Summary.ToString()
' comment out these lines because only a standard task is provided by the control and the custom fields are not included.
'sqlText = sqlText & ", @StageName = '" & task.StageName & "'"
'sqlText = sqlText & ", @ActivityType = '" & task.ActivityType.ToString & "'"
'sqlText = sqlText & ", @NotificationAddress = '" & task.NotificationAddress.ToString & "'"
'sqlText = sqlText & ", @ScheduleDays = '" & task.ScheduleDays.ToString & "'"
'sqlText = sqlText & ", @Comments = '" & task.Description.ToString & "'"
strConn = ConfigurationManager.ConnectionStrings("DefaultConnection").ConnectionString
Dim conn As New SqlConnection(strConn)
Dim cmdCommand As SqlCommand = conn.CreateCommand()
cmdCommand.CommandText = sqlText
cmdCommand.CommandType = System.Data.CommandType.Text
conn.Open()
cmdCommand.ExecuteNonQuery()
Return task
End Function
Public Overrides Function DeleteTask(task As ITask) As ITask
' not implemented yet
Return task
End Function
Public Overrides Function InsertTask(task As ITask) As ITask
' not implemented yet
Return task
End Function
Public Overrides Function GetDependencies() As List(Of IDependency)
Dim deps = New List(Of IDependency)()
Dim strConn As String
strConn = ConfigurationManager.ConnectionStrings("DefaultConnection").ConnectionString
Dim conn As New SqlConnection(strConn)
Dim cmdCommand As SqlCommand = conn.CreateCommand()
cmdCommand.CommandText = "usp_Telerik_TaskDependencies_SELECT " & ProcString
cmdCommand.CommandType = System.Data.CommandType.Text
conn.Open()
Dim dr As SqlDataReader = cmdCommand.ExecuteReader()
If dr.HasRows Then
While dr.Read()
Dim newDep As New Dependency
newDep.ID = dr("ID")
newDep.PredecessorID = dr("PredecessorID")
newDep.SuccessorID = dr("SuccessorID")
newDep.Type = dr("Type")
deps.Add(newDep)
End While
End If
Return deps
End Function
Public Overrides Function DeleteDependency(dependency As IDependency) As IDependency
' not implemented yet
Return dependency
End Function
Public Overrides Function InsertDependency(dependency As IDependency) As IDependency
' not implemented yet
Return dependency
End Function
End Class
Hi,
I am looking for ideas to display each row in two lines, as shown below.
| col1 | col 2 | col 3 | col 5| col 6 |
| col7 | Edit button | Save button |
Please suggest for any ideas, if possible.
Thank you,
Madhavi
Is it possible to apply Bootstrap styling to a version '2013.3.1324.40' RadGrid?
(Please don't discuss upgrades. It's just not politically possible at this time.)
Hi,
I have a site where I display a list of available Camps that the users can register for. What I would like to do is group them by "CampStartDate". I have the code below but no matter how I try to group, I always get the error "The RadListView control does not have an item placeholder specified."
<telerik:RadListView ID="RadListView1" ItemPlaceholderID="DataGroupPlaceHolder2" DataGroups="CampStartDate" GroupPlaceholderID="DataGroupPlaceHolder1" runat="server" DataKeyNames="CampId" Skin="Bootstrap" OnSelectedIndexChanged="RadListView1_SelectedIndexChanged">
<LayoutTemplate>
<asp:Panel ID="CampHolder" runat="server">
</asp:Panel>
</LayoutTemplate>
<GroupTemplate>
<div class="vc_row wpb_row vc_inner vc_row-fluid">
<asp:PlaceHolder ID="CampsHolder" runat="server"></asp:PlaceHolder>
</div>
</GroupTemplate>
<ItemTemplate>
<div class="rlvI vc_col-sm-4 wpb_column vc_column_container ">
<asp:Label ID="CampNameLabel" CssClass="camptitle" runat="server" Text='<%# "Camp: " + Eval("CampName") %>' />
<br /><br />
<strong>Start Date:</strong> <asp:Label ID="CampStartDateLabel" runat="server" Text='<%# Eval("CampStartDate", "{0:D}") %>' />
</div>
</ItemTemplate>
<AlternatingItemTemplate>
<div class="rlvA vc_col-sm-4 wpb_column vc_column_container ">
<asp:Label ID="CampNameLabel" CssClass="camptitle" runat="server" Text='<%# "Camp: " + Eval("CampName") %>' />
<br /><br />
<strong>Start Date:</strong> <asp:Label ID="CampStartDateLabel" runat="server" Text='<%# Eval("CampStartDate", "{0:D}") %>' />
</div>
</AlternatingItemTemplate>
<EmptyDataTemplate>
<div class="RadListView RadListView_Bootstrap">
<div class="rlvEmpty">
There are no camps to be displayed.</div>
</div>
</EmptyDataTemplate>
<ValidationSettings EnableModelValidation="False" EnableValidation="False" />
<DataGroups>
<telerik:ListViewDataGroup GroupField="CampStartDate" DataGroupPlaceholderID="DataGroupPlaceHolder1"
SortOrder="Ascending">
<DataGroupTemplate>
<asp:Panel runat="server" ID="Panel4" GroupingText='<%# (Container as RadListViewDataGroupItem).DataGroupKey %>'>
<asp:PlaceHolder runat="server" ID="DataGroupPlaceHolder2"></asp:PlaceHolder>
</asp:Panel>
</DataGroupTemplate>
</telerik:ListViewDataGroup>
</DataGroups>
</telerik:RadListView>
Hi,
My application requires to have grid navigation with up/down arrow keys and this is working, however, changing the selected row does not generates
raises the SelectedIndexChanged in the server side which I need to execute some other code to populate a panel with other information. The SelectedIndexChanged is only raised if a row is selected with a mouse click, and I need it to happen when changing the selected row with the arrow keys.
How do I need to configure the Grid to support this behavior?
Hey I have a RadGrid that pulls information from the database and I'm using my NeedDataSource Event to pull the data from the DB, make a few tweaks and assign it to my RadGrid DataSource property. We're using the default paging,sorting, etc and what happens when a user moves to the next page is that the NeedDataSource even is fired again and my data starts pulling from the database again and goes through the same process and it just went for no apparent reason. Is there a way to use the existing DataSource that is already in the RadGrid ? For Reference I'm using Telerik.Web.UI Version 2013.1.403.35
Thanks