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

Hi,

Based on appointment type, I need to display the appointments in different colors.

My "GetAppointments" method looks like this:

Public Overrides Function GetAppointments(ByVal p_oSchedulerInfo As ISchedulerInfo) As IEnumerable(Of Appointment)
    Dim l_oScheduleInfo = TryCast(p_oSchedulerInfo, wsScheduleInfo)
    Dim l_sScheduleIDs As String = l_oScheduleInfo.ScheduleIDs
 
    Dim l_aAppointments As New List(Of Appointment)()
 
    Using l_oDP As New wsDataProvider
        Using l_oSystem As New wsSystemGeneral(l_oDP)
            Dim l_sSql As String = "select * from `PlanningTaskBlocks` where `numScheduleID` in (" & l_sScheduleIDs & ") order by `numTaskID` asc"
            Using l_oDR As IDataReader = l_oDP.ExecuteReader(l_sSql)
                If l_oDR IsNot Nothing Then
                    Dim l_oAppointment As Appointment = Nothing, l_iTaskID As Long = 0
                    Dim l_sTask As String = Nothing, l_sColor As String = Nothing, l_iAgeMin As Integer = 18, l_iAgeMax As Integer = 99, l_sGender As String = "X"
                    While l_oDR.Read
                        If l_iTaskID <> l_oDR("numTaskID") Then
                            Using l_oDRtask As IDataReader = l_oDP.ExecuteReader("select * from `PlanningTasks` where `ID` = " & l_oDR("numTaskID") & " limit 1")
                                If l_oDRtask IsNot Nothing Then
                                    If l_oDRtask.Read Then
                                        l_sTask = l_oDRtask("txtName")
                                        l_sColor = l_oDRtask("txtColor")
                                        l_iAgeMin = l_oDRtask("numAgeMin")
                                        l_iAgeMax = l_oDRtask("numAgeMax")
                                        l_sGender = l_oDRtask("txtGender")
                                    End If
                                    If Not l_oDRtask.IsClosed Then l_oDRtask.Close()
                                End If
                            End Using
                            l_iTaskID = l_oDR("numTaskID")
                        End If
 
                        l_oAppointment = New Appointment
                        l_oAppointment.ID = l_oDR("ID")
                        l_oAppointment.Subject = Convert.ToString(l_sTask)
                        l_oAppointment.Start = DateTime.SpecifyKind(Convert.ToDateTime(l_oDR("dateStart")), DateTimeKind.Utc)
                        l_oAppointment.[End] = DateTime.SpecifyKind(Convert.ToDateTime(l_oDR("dateEnd")), DateTimeKind.Utc)
                        l_oAppointment.BackColor = System.Drawing.ColorTranslator.FromHtml(l_sColor)
 
                        l_oAppointment.Attributes("TaskID") = Convert.ToString(l_oDR("numTaskID"))
                        l_oAppointment.Attributes("TaskPoints") = Convert.ToString(l_oDR("numTaskPoints"))
                        l_oAppointment.Attributes("NumberOfPlaces") = Convert.ToString(l_oDR("numNumberOfPlaces"))
                        l_oAppointment.Attributes("AgeMin") = Convert.ToString(l_iAgeMin)
                        l_oAppointment.Attributes("AgeMax") = Convert.ToString(l_iAgeMax)
                        l_oAppointment.Attributes("Gender") = Convert.ToString(l_sGender)
 
                        'LoadResources(l_oAppointment)
                        l_aAppointments.Add(l_oAppointment)
                    End While
                    If Not l_oDR.IsClosed Then l_oDR.Close()
                End If
            End Using
        End Using
    End Using
 
    Return l_aAppointments
End Function
 

As you can see, I'm setting the BackColor property on every Appointment instance.

However, the Appointment.BackColor property is ignored and all appointsments are displayed with the same color in the RadScheduler. 

What do I need to do to 'push' my custom colors through the webservice to the scheduler?

 

Marja
Top achievements
Rank 1
 answered on 05 Jun 2015
2 answers
401 views

I have a radgrid in which I have added an image button to the header in the code behind.  Here is where I am adding the button:

protected void RadGridMain_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridHeaderItem)
            {
                GridHeaderItem headerItem = (GridHeaderItem)e.Item;
                GridTableView table = headerItem.OwnerTableView;
                GridColumn column = table.GetColumnSafe("AddTeamPositionColumn");
                if (column != null)
                {
                    ImageButton addTeam = new ImageButton();
                    addTeam.ID = "btnAddTeam";
                    addTeam.ImageUrl = "~/Images/Volunteer/AddPos.png";
                    addTeam.ToolTip = "Add new team";
                    headerItem["AddTeamPositionColumn"].Controls.Add(addTeam);
                    addTeam.CommandName = "initInsert";
                    headerItem.Style["vertical-align"] = "middle";
                }
            }
        }

This works fine, but in firefox and chrome the button appears at the very bottom of the header with blank space above it (pls see attached images).  It looks fine in IE.  I have tried all sorts of things to effect the alignment and nothing has any effect at all.  Here is the html of the column:

<telerik:GridButtonColumn ButtonType="ImageButton" ItemStyle-Wrap="true" CommandName="addNestedItem" Text="Add new team position"
                    ImageUrl="~/Images/Volunteer/AddPos.png" ButtonCssClass="MyImageButton" UniqueName="AddTeamPositionColumn">
     <HeaderStyle Width="25px" VerticalAlign="Middle"></HeaderStyle>
     <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" CssClass="MyImageButton"></ItemStyle></telerik:GridButtonColumn>

 

Does anyone know what I can do to make the image button added in the code behind be centered?

Kevin
Top achievements
Rank 1
 answered on 05 Jun 2015
5 answers
226 views

Hi,

I understand that there is no RadLabel control? I have read (and used) some of the workarounds for using ASP:Label eg, using RadFormDecorator to style labels, Setting visibility in pre-render for multi-pages.

It just seems that every time I use an asp label I have trouble eg. my current problem is that ASP:Labels do not display on RadWizard Steps. 

 

I was wondering what the reason is for having no RadLabel as surely this is a basic control for you guys to create (compared to other more fancy controls)?

 

 

Rumen
Telerik team
 answered on 05 Jun 2015
1 answer
127 views

Hi,

 

I search a lot but I don't find a way to "disable" the click event on a legend of a chart. I don't want my user could click on the legend.

 

Could you please help me ?

 

Thank

Vessy
Telerik team
 answered on 05 Jun 2015
1 answer
272 views

Hello,

I have a tabstrip that is dynamically created based on values in a table in a database.  There are several child tabs as well (up to three levels).  When I click on a tab a web user control is dynamically loaded into the RadMultiPage.  One of these web user controls contains a RadGrid that has a button column.  When the user clicks this button I want to switch to a new tab and I'd like to do this from code-behind.  Is this possible?  If it is, how?

Thanks.

Ivan Danchev
Telerik team
 answered on 05 Jun 2015
5 answers
449 views
I am struggling with radEditor for about several months now, and so far, I sent several threads on this forum and created a support ticket during my demo period. As we solve problems with workarounds, problems keep coming one by one. That is just another one.

By saying "disabled", I mean that I cannot click, or write anything on the textarea even if there is text on the load of the page. When I change the edit mode to HTML (from the default Design mode) functionality restores and I can come back to Design mode and continue using the editor normally. That is very annoying for the user to change the edit mode every time they open the page that holds radEditor.

I have created a demo page where the problem can be seen clearly.
http://datepicker.akssite01.tk/akspanel/Haberler

Use the username "demo" and password "123456" for login.

When you enter, click the green "Add" labeled button and try to enter some info in the textarea of radeditor. You will see that you can't.

Also, when you click a row on the table "Edit" button appears near the Add button. When you click on it, radeditor loads with text in it, but it also doesn't appear until you change the edit mode to Html from Design mode by clicking the buttons at the bottom of the editor. When you click the edit mode changer buttons to change edit mode, editor restores its functionality and continues to work all right until the next refresh of the page.

I am not getting any js errors on the console. Using Chrome for testing, but Firefox and Opera are the same for that matter. IE is just a disaster I am keeping my distance from.

I really need help from Telerik support on this one. May be you can help us to clear our problems all at once with the help of this sample project and I can convince my manager to use your editor on our projects for good. I am willing to provide any help possible in order to solve that issue. Just let me know.

Thanks!





Andreas
Top achievements
Rank 1
 answered on 05 Jun 2015
1 answer
96 views
Is there a way to show the loading panel gif and assign it to a control from an external ajax request?  By external ajax request I mean I doing a jQuery ajax request from a linked js file.  I can move this code inline but note I'm not using the ajaxmanager control.  
Konstantin Dikov
Telerik team
 answered on 05 Jun 2015
2 answers
125 views

hi,

i try to get my imagegallery same pic wich in folder's name 

ImageGallerr.ImagesFolderPath="Image/"

image is the name of my foder but it not work and whene i make the same url in propertie it work 

plz i need help very quickly 

Eyup
Telerik team
 answered on 05 Jun 2015
2 answers
135 views

So, I've got a grid configured as such

.DataSource(dataSource => dataSource
     .Ajax()
     .ServerOperation(false)
     .PageSize(250)
     .Read(read => read.Action("_readData", "Data", new { Id= Model.Id })))
.Scrollable(scrolling => scrolling.Enabled(true))
.Sortable()
.Pageable(paging => paging.Enabled(true)
                 .PageSizes(false)
                 .Input(false)
                 .Info(true)
                 .Numeric(false)
                 .PreviousNext(false)
                 .Messages(m => m.Display("Total Records: {2}")))

In the _readData() method of my controller, all data is retrieved and returned and the Total Records displayed reflects that.

var data = ReadData();
DataSourceResult result = data.ToDataSourceResult(request);
return Json(result);

However, the grid itself only displays 250 (the PageSize) items, even though all the items were returned, and nothing else gets displayed.

If I set Virtual(true) on the scrollable, then the grid will call out to the server again as I scroll, and once again all items data is retrieved, but it seems to only make use of the returned items PageSize at a time -- each time I scroll more than that, it calls back to the server to once again get all items, etc.

I thought ServerOperation(false) would tell the grid that all data will be requested through a single request so it wouldn't have to call back to the server each time.

The only thing I've found to work is to set PageSize(100000) (with or without virtual scrolling and with or without ServerOperation doesn't seem to affect it) to ensure that the number of items displayed is all the data that was returned, which in this case is only about 3000. This works, but seems pretty hacky.

Is there a better way to accomplish what I want?

Jay
Top achievements
Rank 3
Bronze
Iron
Iron
 answered on 05 Jun 2015
6 answers
247 views
Hi;
Is there an "Official" BreadCrumb control or do we need to work with ASP.Net Repeater to accomplish that?
Thanks!
Vessy
Telerik team
 answered on 05 Jun 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Iron
Iron
Andrey
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?