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

Can you use a variable or a Session["variable"] as the ClientDetailTemplateId value? Or does it have to be a hard-coded string?

Thanks,

Shawn

Eyup
Telerik team
 answered on 12 Dec 2016
11 answers
646 views
Hi,

I am storing Image in Database in binary format. Is it possible to bind Rad Image gallery control to binary images?. Also I want to add this inside RAD Grid, I am binding Grid on NEED DATASOURCE event. please help me.



Thank you.
Konstantin Dikov
Telerik team
 answered on 12 Dec 2016
2 answers
158 views

Hi ,

 

I am radscheduler using Sql data source method.

<telerik:RadAjaxPanel ID="ajaxpanel1" runat="server">
<telerik:RadScheduler Width="940px" runat="server" ID="ASIScheduler" DataDescriptionField="Description"
DataEndField="End" DataRecurrenceParentKeyField="RecurrenceParentID" DataRecurrenceField="RecurrenceRule"
DataKeyField="ID" DataReminderField="Reminder" DataSourceID="SqlDataSource1"
DataStartField="Start" DataSubjectField="Subject"
EnableDescriptionField="True" Height="700px"
SelectedView="MonthView" OnAppointmentDataBound="ASIScheduler_AppointmentDataBound">
<Reminders Enabled="True" />
</telerik:RadScheduler>
<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:DevConnString %>"
SelectCommand="SELECT [ID], [Subject], [start], [End], [RecurrenceRule], [RecurrenceParentID], [Reminder], [Description], [Annotations] FROM [EventCalendar]"
DeleteCommand="DELETE FROM [EventCalendar] WHERE [ID] = @ID" InsertCommand="INSERT INTO [EventCalendar] ([Subject], [Start], [End], [RecurrenceRule], [RecurrenceParentID], [Description],[Reminder]) VALUES (@Subject, @Start, @End, @RecurrenceRule, @RecurrenceParentID, @Description, @Reminder)"
UpdateCommand="UPDATE [EventCalendar] SET [Subject] = @Subject, [Start] = @Start, [End] = @End, [RecurrenceRule] = @RecurrenceRule, [RecurrenceParentID] = @RecurrenceParentID, [Description] = @Description WHERE [ID] = @ID"></asp:SqlDataSource>
</telerik:RadAjaxPanel>

When user tries to add new appointment  , we are getting following error

Must declare the scalar variable "@Description".

 

but when user clicks new appointment and then click on "options" and fill in other details then appointment gets saved.

 

Please advise fix for this.

Sapandeep
Top achievements
Rank 1
 answered on 12 Dec 2016
1 answer
65 views
How to set when the pagedown key is pushed it select the next row in the grid
Eyup
Telerik team
 answered on 12 Dec 2016
1 answer
96 views

Hi,

Is it possible to upgrade radEditor only , I am using Telerik.Web.UI v4.0.30319 for asp.net web forms.

Thank you,

 

Marin Bratanov
Telerik team
 answered on 12 Dec 2016
1 answer
88 views

Hi,

 

I create a Webpage with DataGrid, and all great working, edit items, add nee etc. 

I have problem with this Grid when I try to implementing something in Page_load. I have to add to roles, One of them are editor, second one are reader. I catch the login user name from Request.ServerVeriables, and then recognize the login and assign role for them, bur when I do this my grid only list the rows but doesn't work any button on them like "edit" or "add new row" ;/ 

 

Thanks for feedback

regards

Tomasz
Top achievements
Rank 1
 answered on 12 Dec 2016
1 answer
201 views

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.

Ivan Danchev
Telerik team
 answered on 12 Dec 2016
1 answer
290 views

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.

Kostadin
Telerik team
 answered on 12 Dec 2016
2 answers
199 views

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

David
Top achievements
Rank 1
 answered on 11 Dec 2016
2 answers
699 views

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

madhavi
Top achievements
Rank 1
 answered on 10 Dec 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Bohdan
Top achievements
Rank 3
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Elliot
Top achievements
Rank 1
Iron
Iron
Iron
Sunil
Top achievements
Rank 1
Cynthia
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?