Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
66 views
Hi,

Can anyone tell me how to repopulate the grid based on dropdownlist selction changed. this dropdown is not part of grid.
 
It's a separate control by itself in the ascx. so, when i change values in this dropdown, my radgrid should bring corresponding values and bind to the radgrid. is it possible.
how do i implement this(c#).

Also, can someone tell when the grid's itemdataboud event will get called. To get this event called should i have radgrid.databind() ???
So, the radgrid should be filled first prior to calling this event right???
Thanks,
ZR
Shinu
Top achievements
Rank 2
 answered on 03 Aug 2009
3 answers
157 views
I got this compilation error when I try to use the data binding

 <telerik:RadScheduler runat="server" ID="DisplayAllBookings"
............
OnDataBinding="onDataBinding">

Here's my javascript:

        function onDataBinding(sender, arg) {
            alert("Data binding");
        }

I got this compilation error:

Compilation Error

Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS1061: 'ASP.booking_displayallbooking_aspx' does not contain a definition for 'onDataBinding' and no extension method 'onDataBinding' accepting a first argument of type 'ASP.booking_displayallbooking_aspx' could be found (are you missing a using directive or an assembly reference?)

Can anyone explain why I got this and how to resolve the problem?

Another question: basically I gonna have different number on each time slot and I want to use different colors to display time slots with various number. What I try to do is to modify the color of each time slot upon DataBinding. Apart from writing scripts for OnDataBinding, is there any easier way to do this?

Thank you very much.



Peter
Telerik team
 answered on 03 Aug 2009
3 answers
87 views
I am developing a site that handles content based on the domain name requested.  Code in global.asax assigns a DeptID based on the domain.  In using the scheduler, I only want to show/handle appointments for this DeptID.  I think I need to treat this like a custom resource - but how do I implement that?  I see how the documentation handles Rooms and Users, but I don't want to expose DeptID for the user to make a choice, and all appointments need to be filtered/inserted/updated for this DeptID only.
Peter
Telerik team
 answered on 03 Aug 2009
0 answers
106 views

Hi –

 I am using telerik Rad Controls in a .NET 2.0 application. There is an ASP.net page in application which consists of below controls.

<%@ Register Assembly="RadPanelbar" Namespace="Telerik.WebControls" TagPrefix="radp" %>

<%@ Register Assembly="RadMenu" Namespace="Telerik.WebControls" TagPrefix="radm" %>

<%@ Register Assembly="RadMultiPage" Namespace="Telerik.WebControls" TagPrefix="radMP" %>

<%@ Register Assembly="RadTabStrip" Namespace="Telerik.WebControls" TagPrefix="radTS" %>

<%@ Register TagPrefix="radA" Namespace="Telerik.WebControls" Assembly="RadAjax.Net2" %>

RadPanelbar.dll – version 3.5.2.0

RadMenu.dll – version 3.6.2.0

RadMultiPage.dll – version 1.5.2.0

RadTabStrip.dll – version 2.5.2.0

RadAjax.Net2.dll – version 1.8.4.0

 

The page contains a menu with few tabs. For each tab an asp.net web user control (.ascx) is loaded. The web user controls contains rad data grids and other rad & standard VS controls where data is fetched from a database.  A Rad Ajax Manager is placed in the page to perform some validations. Rad Ajax Manager and Rad Ajax Panel is placed inside Web user controls to implement ajax functionality.

When loading this page a JavaScript error is thrown as “ ‘parentNode’ is null or not an object” for RadMenu_Global.js.  The script error is thrown in RadMenu_Global.js. This does not occur all the time and it happens so rarely and because of that reason i have not been able to reproduce the issue to identify the problem.

Any idea’s to resolve this issue?

Nirmal
Top achievements
Rank 1
 asked on 03 Aug 2009
1 answer
97 views

Hi,

1) I need a column in radgrid with a dropdownlist with runtimebinding of the values.
2) The column should always be in  the dropdownlist with the values.
3) The grid should not have edit command column.
4) Selected value of the dropdown should be from datasource of radgrid.

But my datasource is a list<class> . so, how do i set the datasourceid and datatext and datavalue  if it is a list<class>.
Pls do elp me with code.


I'm doing the foll:
in ascx,GridTemplateColumn

 

<telerik:GridTemplateColumn HeaderText="mycol" UniqueName ="temp1">

 

 

<ItemTemplate>

 

 

<asp:DropDownList ID="ddl" runat="server"></asp:DropDownList>

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 


in ascx.cs:

in grid's itemdatabound event , i do this

if

 

(e.Item is GridDataItem)

 

{

 

GridDataItem item = (GridDataItem)e.Item;

 

 

DropDownList ddl1 = (DropDownList)item["temp1"].FindControl("ddl");

 

ddl1.DataSourceID = ?

ddl1.DataTextField =?


ddl1.DataValueField =?
ddl1.DataBind();

 

}


I don't know what to fill in the ? with. pls help me with code.


Princy
Top achievements
Rank 2
 answered on 03 Aug 2009
1 answer
72 views
Edit form settings in radgrid itemdatabound in combo box coding
Shinu
Top achievements
Rank 2
 answered on 03 Aug 2009
1 answer
60 views
hi ,Im  Bala,
          i create one radcombobox. items for that combo is retrieved from database.i want to set select as first item every time the page load initially. pls help.

Bala.k
Shinu
Top achievements
Rank 2
 answered on 03 Aug 2009
0 answers
63 views
Hello All

I have a TextBox say Enter Range, when the user click in the test box, i am getting radcalander and giving the choice to select date range, when user select dates i am getting one by one dates in the text box,

But i want only two dates should be selected and display in the text box at a time
can you please solve the problem,i want multiple selection and display which one is min and second is max that is start date  and enddate. the code is given below

<%

@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

 

<%

 

@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

 

<%

 

@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>

 

 

<!

 

DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

 

<

 

 

html xmlns="http://www.w3.org/1999/xhtml" >

 

<

 

 

head runat="server">

 

 

 

<title>Untitled Page</title>

 

 

 

 

 

</

 

head>

 

<

 

 

body>

 

 

 

<form id="form1" runat="server">

 

 

 

<asp:ScriptManager ID="ScriptManager1" runat="server">

 

 

 

</asp:ScriptManager>

 

 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">

 

 

 

<AjaxSettings>

 

 

 

<telerik:AjaxSetting AjaxControlID="RadScheduler1">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="RadScheduler1" />

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

 

 

<telerik:AjaxSetting AjaxControlID="RadAjaxManager1">

 

 

 

<UpdatedControls>

 

 

 

<telerik:AjaxUpdatedControl ControlID="RadScheduler1" />

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

 

 

</AjaxSettings>

 

 

 

</telerik:RadAjaxManager>

 

 

 

<telerik:RadScheduler ID="RadScheduler1"

 

 

 

runat="server"

 

 

 

AllowDelete="True"

 

 

 

AllowEdit="True"

 

 

 

AllowInsert="True"

 

 

 

DataEndField="End"

 

 

 

DataKeyField="ID"

 

 

 

DataRecurrenceField="RecurrenceRule"

 

 

 

DataRecurrenceParentKeyField="RecurrenceParentID"

 

 

 

DataSourceID="SqlDataSource1"

 

 

 

DataStartField="Start"

 

 

 

DataSubjectField="Subject"

 

 

 

HoursPanelTimeFormat="h:mm tt"

 

 

 

SelectedDate="2007-11-29" OnAppointmentInsert="RadScheduler1_AppointmentInsert">

 

 

 

</telerik:RadScheduler>

 

 

 

<asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:SchedulerDataConnectionString %>"

 

 

 

DeleteCommand="DELETE FROM [Appointments] WHERE [ID] = @ID" InsertCommand="INSERT INTO [Appointments] ([Subject], [Start], [End], [UserID], [RoomID], [RecurrenceRule], [RecurrenceParentID], [Annotations]) VALUES (@Subject, @Start, @End, @UserID, @RoomID, @RecurrenceRule, @RecurrenceParentID, @Annotations)"

 

 

 

SelectCommand="SELECT [ID], [Subject], [Start], [End], [UserID], [RoomID], [RecurrenceRule], [RecurrenceParentID], [Annotations] FROM [Appointments]"

 

 

 

UpdateCommand="UPDATE [Appointments] SET [Subject] = @Subject, [Start] = @Start, [End] = @End, [UserID] = @UserID, [RoomID] = @RoomID, [RecurrenceRule] = @RecurrenceRule, [RecurrenceParentID] = @RecurrenceParentID, [Annotations] = @Annotations WHERE [ID] = @ID">

 

 

 

<DeleteParameters>

 

 

 

<asp:Parameter Name="ID" Type="Int32" />

 

 

 

</DeleteParameters>

 

 

 

<UpdateParameters>

 

 

 

<asp:Parameter Name="Subject" Type="String" />

 

 

 

<asp:Parameter Name="Start" Type="DateTime" />

 

 

 

<asp:Parameter Name="End" Type="DateTime" />

 

 

 

<asp:Parameter Name="UserID" Type="Int32" />

 

 

 

<asp:Parameter Name="RoomID" Type="Int32" />

 

 

 

<asp:Parameter Name="RecurrenceRule" Type="String" />

 

 

 

<asp:Parameter Name="RecurrenceParentID" Type="Int32" />

 

 

 

<asp:Parameter Name="Annotations" Type="String" />

 

 

 

<asp:Parameter Name="ID" Type="Int32" />

 

 

 

</UpdateParameters>

 

 

 

<InsertParameters>

 

 

 

<asp:Parameter Name="Subject" Type="String" />

 

 

 

<asp:Parameter Name="Start" Type="DateTime" />

 

 

 

<asp:Parameter Name="End" Type="DateTime" />

 

 

 

<asp:Parameter Name="UserID" Type="Int32" />

 

 

 

<asp:Parameter Name="RoomID" Type="Int32" />

 

 

 

<asp:Parameter Name="RecurrenceRule" Type="String" />

 

 

 

<asp:Parameter Name="RecurrenceParentID" Type="Int32" />

 

 

 

<asp:Parameter Name="Annotations" Type="String" />

 

 

 

</InsertParameters>

 

 

 

</asp:SqlDataSource>

 

 

 

 

 

 

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">

 

 

 

<script type="text/javascript">

 

 

 

function

 

OnDateSelected(sender, args)

 

{

 

 

var date = new Date(args.Date[0], (args.Date[1]-1), args.Date[2]);

 

$get(

 

"TextBox2").value += date.format("yyyy/MM/dd");

 

$get(

 

"TextBox2").value += " ";

 

$find(

 

"PopEx2").hidePopup();

 

}

 

function

 

pageLoad()

 

{

$find(

 

'PopEx').hidePopup();

 

}

 

 

 

 

 

 

 

 

</script>

 

 

 

</telerik:RadCodeBlock>

 

 

 

 

 

<asp:UpdatePanel ID="UpdatePanel1" runat="server">

 

 

 

<ContentTemplate>

 

 

 

<asp:Label ID="lblSelectDate" runat="server" Text="Enter Date Range"></asp:Label>

 

 

 

<asp:TextBox ID="TextBox1" runat="server">

 

 

 

</asp:TextBox>

 

 

 

<telerik:RadCalendar ID="RadCalendar1" runat="server" AutoPostBack="true" OnSelectionChanged="RadCalendar1_SelectionChanged">

 

 

 

</telerik:RadCalendar>

 

 

 

 

<cc1:PopupControlExtender ID="PopEx" runat="server" TargetControlID="TextBox1"

 

 

 

PopupControlID="RadCalendar1" Position="Bottom" />

 

 

 

</ContentTemplate>

 

 

</

 

asp:UpdatePanel> &nbsp; &nbsp;

 

 

 

 

 

 

 

 

 

</form>

 

</

 

 

body>

 

</

 

 

html>


Code  Behind --------------------------------------------

 

 

protected void RadCalendar1_SelectionChanged(object sender, Telerik.Web.UI.Calendar.SelectedDatesEventArgs e)

 

{

TextBox1.Text +=

 

String.Format("{0} ", e.SelectedDates[e.SelectedDates.Count - 1].Date.ToString("yyyy/MM/dd"));

 

 

}

 

imtiyaz mohammed
Top achievements
Rank 1
 asked on 03 Aug 2009
5 answers
121 views
Hello,

I am implementing a solution where I look at the current time and loop through a series of appointments to see if any of the appointments occur during this minute.  My current solution is not working well as it is inefficient and I'm having trouble finding a way to do a more efficient search.

I am currently looping through the Occurrences collection of the recurrence rule for every appointment in my list (can be hundreds or thousands).  The only limiting factor that makes my algorithm slightly efficient is that I end the loop through the occurrences once the current occurrence time is in the future (or past the current minute).

Question:
I'd like to do a binary search through the occurrences collection.  This would require that I know the # of occurrences in the appointment so I can look at the midway point to determine if it is in the future or past.

ex)
intPosition = Floor(Appointment.Occurrences.Count / 2);
if((DateTime)Appointment.Occurrences[intPosition] > dateCurrent) --> Continue with Binary search...

The only issue is that there does not seem to be any information available to me about the Occurrences collection.

Question
Is there any way to do what I mentioned above?  Is there a better way to approach this given my scenario of having  a list of appointments and needing to see if the current time is the time for any of the appointments?

Thanks in advance,

Ryan


rjb227s
Top achievements
Rank 1
 answered on 03 Aug 2009
2 answers
59 views
Hi All,

The Appointment_MoveEnd captures the new date time of the selected appointment after it is moved within the same resouce, but what if the appointment is moved to a different resource when Scheduler displays mutiple resources. Is there any way i could find new resource details after the appointment has been move to a different resource.

Thanks in advance.

Haroon


Haroon Khokhar
Top achievements
Rank 1
 answered on 02 Aug 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?