Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
111 views
Hi,

I have created a combobox load on demand and I want to add an another combox box when I select an item of the first combo box. The second combo box must use the selected value of the first combo box to execute an SQL query and to retrieve items.


When I select an item of the first combo box, the second combobox is added, but when I open it, a popup is displayed.

Here is the code of my issue.

Thanks a lot.


protected void Page_Load(object sender, EventArgs e)
   {
       ComboBoxLoadOnDemand cbx = new ComboBoxLoadOnDemand();
       cbx.TableName = "ddl_report_collaborator";
       cbx.DataTextField = "text_ddl";
       cbx.DataValueField = "value_ddl";
       cbx.Height = Unit.Pixel(250);
       cbx.Width = Unit.Pixel(200);
       cbx.NbItemsRequested = 50;
       cbx.AutoPostBack = true;
       cbx.ShowMoreResultsBox = true;
       this.form1.Controls.Add(cbx);
       cbx.SelectedIndexChanged += new Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventHandler(cbx_SelectedIndexChanged);
        
        
   }
   void cbx_SelectedIndexChanged(object sender, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
   {
       ComboBoxLoadOnDemand cbx2 = new ComboBoxLoadOnDemand();
       cbx2.TableName = "ddl_report_collaborator";
       cbx2.DataTextField = "text_ddl";
       cbx2.DataValueField = "value_ddl";
       cbx2.Height = Unit.Pixel(250);
       cbx2.Width = Unit.Pixel(200);
       cbx2.NbItemsRequested = 50;
       cbx2.ShowMoreResultsBox = true;
       this.form1.Controls.Add(cbx2);
   }
TANSERI
Top achievements
Rank 1
 answered on 07 Feb 2011
1 answer
435 views
Good Morning,

I am binding a RadGrid GridDateTimeColumn to a DB2 datetime column that contains millisecond values. I need to use these millisecond values to be able to update/delete the proper rows from the DB2 table; however, it looks like the GridDateTimeColumn doesn't store the System.DataTime value all the way down to milliseconds. It looks like the value just stops at seconds. 

Am I correct that the RadGrid GridDateTimeColumn doesn't store date/time values down to the millisecond?

Thanks
Casey

EDIT***
I was able to change the DataFormatString to "{0:MM/dd/yyyy HH:mm:ss:ffffff}" and it worked!! 
Radoslav
Telerik team
 answered on 07 Feb 2011
3 answers
134 views
Hi,

I have some code which displays timings in the allday row, specifically this one. My Code is:

protected void radScheduler_TimeSlotCreated(object sender, TimeSlotCreatedEventArgs e)
{
    // Calculate total hours per day.
    if (radScheduler.SelectedView == SchedulerViewType.WeekView && e.TimeSlot.Duration.TotalDays == 1)
    {
        double totalHoursPerDay         = 0;
        double totalOvertimeHoursPerDay = 0;
        bool weekend = false;
 
        if (e.TimeSlot.Start.DayOfWeek == DayOfWeek.Saturday || e.TimeSlot.Start.DayOfWeek == DayOfWeek.Sunday)
        {
            weekend = true;
        }
 
        foreach (Appointment a in radScheduler.Appointments.GetAppointmentsInRange(e.TimeSlot.Start, e.TimeSlot.End))
        {
            // Check time of appointment and adding to hours or overtime accordingly.
            if (a.Start.TimeOfDay >= new TimeSpan(8, 0, 0) && a.End.TimeOfDay <= new TimeSpan(19, 0, 0) && weekend)
            {
                totalOvertimeHoursPerDay += a.Duration.TotalHours;
            }
            else if (a.Start.TimeOfDay >= new TimeSpan(8, 0, 0) && a.End.TimeOfDay <= newTimeSpan(17, 0, 0))
            {
                totalHoursPerDay += a.Duration.TotalHours;
            }
            else if (a.Start.TimeOfDay > new TimeSpan(17, 0, 0) && a.End.TimeOfDay <= newTimeSpan(19, 0, 0))
            {
                totalOvertimeHoursPerDay += a.Duration.TotalHours;
            }
            else if (a.Start.TimeOfDay >= new TimeSpan(8, 0, 0) && a.End.TimeOfDay <= newTimeSpan(19, 0, 0))
            {
                double overtime = a.End.TimeOfDay.TotalHours - 17;
                totalOvertimeHoursPerDay += overtime;
                totalHoursPerDay += (a.Duration.TotalHours - overtime);
            }
        }
 
        Literal hoursLiteral       = new Literal();
        Literal overtimeLiteral    = new Literal();
 
        if (!weekend)
        {
            hoursLiteral.Text = "Hrs: " + totalHoursPerDay.ToString();
        }
 
        overtimeLiteral.Text = " O/T: " + totalOvertimeHoursPerDay.ToString();
 
        radScheduler.Controls.Add(hoursLiteral);
        radScheduler.Controls.Add(overtimeLiteral);
 
        e.TimeSlot.Control.Controls.Add(hoursLiteral);
        e.TimeSlot.Control.Controls.Add(overtimeLiteral);
    }
}

With the context menu enabled, this is causing an exception when I switch week (in weekview). The exception is: "Failed to load viewstate.  The control tree into which viewstate is being loaded must match the control tree that was used to save viewstate during the previous request.  For example, when adding controls dynamically, the controls added during a post-back must match the type and position of the controls added during the initial request.", and it happens on:

radScheduler.Controls.Add(hoursLiteral);

You can find a sample code here.

Thank you for your support.

Daryl
Alan
Top achievements
Rank 1
 answered on 07 Feb 2011
3 answers
63 views
I am running into the following scenario.

I have a combobox and a rad grid on a page.  When a value is selected in the combobox I wan to highlight the associated item in the grid.  The associated item could be on any page on the grid so the focus will need to be on the correct page and then item on the page.

I could programatically page through the pages to find and select the item but was wondering if there was an inbuilt way in the grid.
Princy
Top achievements
Rank 2
 answered on 07 Feb 2011
8 answers
630 views
Thanks for a great sample to display items in a listview mode shown here  http://demos.telerik.com/aspnet-ajax/grid/examples/programming/listview/defaultcs.aspx

I wonder is there a way to switch between listlivew and grid view?
Here are two examples of such functionality:

If you could achieve it you'll be the best.

Thanks,
Michael
Sebastian
Telerik team
 answered on 07 Feb 2011
2 answers
154 views
I'm using a RadGrid within a RajAjaxManager.
On a specific LinkButton, I need to export the content of the grid to CSV.
So I need to disable Ajax to allow export works. I'm doing this :

<

 

script type="text/javascript">

 

 

function mngRequestStartedEAE(ajaxManager, eventArgs) {

 

 

if (eventArgs.EventTarget.indexOf("exportCsv") != -1) {

 

eventArgs.EnableAjax =

false;

 

}

 

}

 

</

 

script>
<

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" ClientEvents-OnRequestStart="mngRequestStartedEAE" >

    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="content">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="content" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Transparency="10"
    BackColor="#ffffff" CssClass="ajax_loader">
</telerik:RadAjaxLoadingPanel>
<asp:Panel ID="content" runat="server" CssClass="MaxW">
<!-- some other controls -->
<asp:LinkButton ID="exportCsv" runat="server" OnClick="exportCsv_Click" Text="Exporter"></asp:LinkButton>
<!-- grid declaration ... -->
</asp:Panel>

All of this works fine ! BUT :
All other next requests doesn't works, because no more ajax is running :( So all actions like autopostback on controls within content panel are not invoked...

What am I doing wrong ?

Thanks for help !
Alexandre BARBIER
Top achievements
Rank 1
 answered on 07 Feb 2011
1 answer
93 views
I am trying to use either a RadGrid or a RadListView - however I want the column names to be on the left hand side going up and down - much like the ASP.NET DetailsView.  Does anyone know how to accomplish this?
Sebastian
Telerik team
 answered on 07 Feb 2011
1 answer
76 views
Hi, just wondering if there's a way to display some lines to represent shifts (morning, afternoon, evening) in scheduler week or day view?

Cheers
Prasanna
Veronica
Telerik team
 answered on 07 Feb 2011
1 answer
71 views
Is it possible to use an Excel file as a template for RadGrid layout that would have merged cells, etc.?

Thank you
Princy
Top achievements
Rank 2
 answered on 07 Feb 2011
1 answer
95 views
In my RadSchedular I have set the following parameters.

DayView-WorkDayStartTime="08:00:00"
DayView-DayEndTime="18:00:00"      
WorkDayStartTime="08:30:00"
WorkDayEndTime="17:00:00"


As a test I created a task that started at 16:30 on one day, and finish at 9:00am the next day.

With Workday start and end times of 17:00 and  8:30am this is a one hour task.

However, by clicking the 24 hour view, the RadScheduler displays this task as running from 16.30 on the first day, till midnight that night, and on the next day starting at midnight and finishing at 9am.

Wrong.

How can I tell the RadScheduler to only display tasks in business hours. With this in mind, what is the point of the WorkDay[Start:End]Time parameters?

 
Peter
Telerik team
 answered on 07 Feb 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?