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

Hi,

I have a Master page which looks like:


In the left placeholder, I have a RadGrid.  In the right placeholder I have a user control.
When a user clicks on a row in the RadGrid, the user control on the right is successfully populated and edits are allowed. 
I have a "save" button which, when clicked, successfully posts the data to the database.

Some of that data is displayed in the RadGrid.   However, after changing this data, the grid is not updated.

In the right placed holder I have a RadAjaxManagerProxy setup like so:


<!-- Ajax Manager -->
<telerik:RadAjaxManagerProxy ID="LocationAjaxProxy" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="LocationList">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="LocationInformationRadMultiPage" LoadingPanelID="RadAjaxGridLoad" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="LocationInformationRadMultiPage">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="LocationList" LoadingPanelID="RadAjaxGridLoad" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
<!-- Ajax Manager -->



LocationList is the RadGrid.  The LocationInformationRadMultiPage is a RadTabStrip that contains the user control that allows editing and saving of the data.

Is this the correct approach?

Thanks!

Antonio Stoilkov
Telerik team
 answered on 07 Dec 2011
1 answer
104 views
I want to insert,edit and Delete Appointments in RadScheduler from the database.
Iam using Visual Studio 2008 ,sqlserver 2005.
Peter
Telerik team
 answered on 07 Dec 2011
4 answers
188 views
On my project, i'm using RadScheduler. 


In result of the needs, i had to create a custom edit "window". 


Basically in the main page i have:


<telerik:RadScheduler runat="server" ID="radScheduler" SelectedView="TimelineView"
                EnableExactTimeRendering="True" DayStartTime="00:00:00" DayEndTime="23:59:59"
                DataKeyField="ID" DataSubjectField="Subject" DataStartField="Start" DataEndField="End"
                DataRecurrenceField="RecurrenceRule" DataRecurrenceParentKeyField="RecurrenceParentId"
                AllowInsert="false" AllowDelete="False" AllowEdit="false" ColumnWidth="100px"
                OnAppointmentCreated="radScheduler_AppointmentCreated" AdvancedForm-Modal="true"
                Width="100%" FirstDayOfWeek="Monday" ShowHoursColumn="False" Skin="Telerik" ShowsConfirmationWindowOnDelete="False"
                OnFormCreated="radScheduler_FormCreated">
                <TimelineView UserSelectable="true" GroupingDirection="Vertical" NumberOfSlots="24"
                    ColumnHeaderDateFormat="HH:mm" ShowInsertArea="false" StartTime="00:00:00" SlotDuration="01:00:00"
                    GroupBy="Room" />
                <DayView UserSelectable="false" />
                <MonthView UserSelectable="false" />
                <WeekView UserSelectable="false" />
                <AdvancedEditTemplate>
                    <scheduler:AdvancedForm runat="server" ID="AdvancedInsertForm1" Mode="Edit"/>
                </AdvancedEditTemplate>
            </telerik:RadScheduler>



and also a RadAjaxManager.


<scheduler:AdvancedForm>
points to AdvancedForm.ascx


In AdvancedForm.ascx i have this javascript block 


   
<script type="text/javascript">
 
 
        var chart; // global
     
        /*
         * Request data from the server, add it to the graph
         */
        function requestData() {
            $.ajaxSetup({ cache: false });
            $.getJSON('exampleurl', function (data) {
 
 
                //Clear the "old" series
                while (chart.series.length > 0) {
                    chart.series[0].remove(true);
                }
 
 
                //declare Json
                var jsonObj = {
                    series: []
                };
 
 
                //Cycle through each JSONobjcect returned by the url
                $.each(data, function (i, item) {
                    var key = item['tag'];
                    var value = item['data']['Velocity'];
 
 
                    jsonObj.series.push({
                        "name": key,
                        "data": value
                    });
                });
 
 
                //Add each of the key:value pair to the series
                for (var i in jsonObj.series) {
                    chart.addSeries(jsonObj.series[i]);
                }
 
 
                // call it again after ten seconds
                setTimeout(requestData, 10000);
            });
        }
 
 
        $(document).ready(function () {
            chart = new Highcharts.Chart({
                chart: {
                    renderTo: 'container',
                    defaultSeriesType: 'column',
                    events: {
                        load: requestData
                    }
                },
                title: {
                    text: 'Test Chart'
                },
                xAxis: {
                    title: {
                        text: 'Viaturas'
                    },
                    categories: ['']
                },
                yAxis: {
                    min: 0,
                    title: {
                        text: 'Velocidade (Km/h)'
                    }
                },
                tooltip: {
                    formatter: function () {
                        return '' +
                            this.series.name + ': ' + this.y + ' Km/h';
                    }
                },
            });
        });
</script>



the problem i have is that the $(document).ready is never called...


Thanks in advance for the help..
Peter
Telerik team
 answered on 07 Dec 2011
3 answers
106 views
I was going to enter my own markup so you can see what I'm talking about....but that isn't necessary seeing how the official telerik control is also displaying this strange behavior in Chrome...

open this link in chrome and select a date, you'll see that the textbox shifts or changes sizes and misaligns things.  It's really bugging me.

http://demos.telerik.com/aspnet-ajax/calendar/examples/datepicker/custompopup/defaultcs.aspx
Michael
Top achievements
Rank 1
 answered on 07 Dec 2011
1 answer
260 views
Hello
I am using RelatedLoDRadComboboxesinAdvForm. In my RadScheduler if I select a RadcomboBox list's value then some data according to this value should be displayed in my RadTextBox but not editable.
 suppose Client  First  name is selected then Last Name should be displayed in textbox.
Any help
Thanks
Ivana
Telerik team
 answered on 07 Dec 2011
2 answers
138 views
Hello, 

I am having difficulty with the problem of accessing the Selected value of a programatically created RadGrid.  The purpose of this app is to allow a user to select an order from a grid and open a new page with a new grid populated based on the selection of the previous grid.  I can't seem to find an example like this in the forums.  Most example assume the grid is bound directly, however I am pulling from a programatically created grid.  I am new to Telerik controls.  I tried using the format code block but it made my code unreadable.

Here is how I create the grid:

    <telerik:RadGrid ID="OrdersGrid" runat="server" Skin="WebBlue" CellSpacing="0" GridLines="None"
        ClientSettings-Selecting-AllowRowSelect="True">
        <ClientSettings>
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
        <MasterTableView DataKeyNames="OrderID" ClientDataKeyNames="OrderID">
            <CommandItemSettings ExportToPdfText="Export to PDF" />
            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_WebBlue">
        </HeaderContextMenu>
    </telerik:RadGrid>    <telerik:RadGrid ID="OrdersGrid" runat="server" Skin="WebBlue" CellSpacing="0" GridLines="None"
        ClientSettings-Selecting-AllowRowSelect="True">
        <ClientSettings>
            <Selecting AllowRowSelect="True" />
            <Scrolling AllowScroll="True" UseStaticHeaders="True" />
        </ClientSettings>
        <MasterTableView DataKeyNames="OrderID" ClientDataKeyNames="OrderID">
            <CommandItemSettings ExportToPdfText="Export to PDF" />
            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
            <EditFormSettings>
                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                </EditColumn>
            </EditFormSettings>
        </MasterTableView>
        <FilterMenu EnableImageSprites="False">
        </FilterMenu>
        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_WebBlue">
        </HeaderContextMenu>
    </telerik:RadGrid>

Here is how I bind the data to the new grid:

protected void Page_Load(object sender, EventArgs e)
        {
            using (Dbcontext)
            {
                companyID = Convert.ToInt32(Request.QueryString["CompanyID"]);
                OrdersGrid.DataSource = Dbcontext.usp_SelectOrders(null,companyID);
                OrdersGrid.DataBind();
                OrdersGrid.MasterTableView.DataKeyNames = new String[] { "OrderID" };
             }
        }

Here is how I am attempting to access the SelectedValue of the OrdersGrid:

protected void OrderDetailsButton_Click(object sender, EventArgs e)
        {
            Response.Redirect("~/Pages/OrderDetails.aspx?OrderID=" + OrdersGrid.SelectedValue.ToString());
        }

When the button is clicked I get an error stating that the Selected value has not been initialized.  When I hover over the SelectedValue in Debugging mode it says it is "null."

Any thoughts?

Thanks in advance,
Jonathan
Jonathan
Top achievements
Rank 1
 answered on 07 Dec 2011
5 answers
103 views
Hi,

I followed the instructions on the demo page: http://demos.telerik.com/aspnet-ajax/scheduler/examples/keyboardsupport/defaultcs.aspx , but do not get the required result.

In IE a javascript error is shown: Line: 17846
Error: Object doesn't support property or method '_getContentTable'

Line 17846 and surroundings:
var r=i.KeyboardNavigation.Models.createMap(d.get_activeModel()._getContentTable(),function(u){q=false;
var w=u.get_targetSlot().get_domElement();
var v=w.cellIndex;
var t=w.parentNode.rowIndex;
m.x=t;
m.y=v;
});


FF and Chrome do not show the javascript error, but no keyboard support eighter.

Any idea what might cause this?

Sceduler code:
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server">
</telerik:RadAjaxLoadingPanel>
<telerik:RadScheduler ID="rs_Planner" runat="server" Culture="Dutch (Netherlands)"  AccessKey="F" TabIndex="1"
    HoursPanelTimeFormat="HHtt" LastDayOfWeek="Sunday" FirstDayOfWeek="Monday" RowHeight="30px" 
    OverflowBehavior="Expand" Width="100%">
    <AppointmentContextMenus>
        <telerik:RadSchedulerContextMenu runat="server" ID="SchedulerAppointmentContextMenu">
            <Items>
                <telerik:RadMenuItem Text="Ga naar klant" Value="1" />
                <telerik:RadMenuItem IsSeparator="True" />
                <telerik:RadMenuItem Text="Niveau aanpassen" Value="2" />
                <telerik:RadMenuItem IsSeparator="True" />
                <telerik:RadMenuItem Text="Klant is niet geweest" Value="3" />
                <telerik:RadMenuItem IsSeparator="True" />
                <telerik:RadMenuItem Text="Klant toevoegen aan werkvoorraad" Value="4" />
                <telerik:RadMenuItem IsSeparator="True" />
                <telerik:RadMenuItem Text="Mail boekingen naar klant" Value="5" />
                <telerik:RadMenuItem IsSeparator="True" />
                <telerik:RadMenuItem Text="Losse verkoop aan deze klant" Value="6" />
            </Items>
        </telerik:RadSchedulerContextMenu>
        <telerik:RadSchedulerContextMenu runat="server" ID="RadSchedulerContextMenu1">
            <Items>
                <telerik:RadMenuItem IsSeparator="True" />
            </Items>
        </telerik:RadSchedulerContextMenu>
    </AppointmentContextMenus>
    <WeekView ColumnHeaderDateFormat="ddd, d MMM" HeaderDateFormat="d-MMM-yyyy" />
    <Localization AdvancedAllDayEvent="All day" AdvancedCalendarCancel="Annuleren" AdvancedCalendarToday="Vandaag"
        HeaderDay="Dag" HeaderMonth="Maand" HeaderToday="Vandaag"></Localization>
    <AdvancedForm DateFormat="d-M-yyyy" TimeFormat="H:mm" Modal="true"></AdvancedForm>
    <AppointmentTemplate>
        <%#GetAppointment(Eval("Onderwerp"), Eval("Plaatsenover"), Eval("start"), Eval("Type"), Eval("Naam"), Eval("Niveau"), Eval("RoosterStatusOmschrijving"), Eval("Boeking"), Eval("RoosterOpmerking"), Eval("Koppel"), Eval("OpenstaandBedrag"), Eval("Geboortedatum"), Eval("AlertMemo"), Eval("lesnummer"), Eval("KlantNietGeweest"))%>
    </AppointmentTemplate>
</telerik:RadScheduler>

Thanks for any help that you can give me
Genady Sergeev
Telerik team
 answered on 07 Dec 2011
17 answers
354 views
I have created my own advanced form "AdvForm.ascx"

At the top of my .aspx file i have put:

<%@ Register  tagprefix="schedular" tagname="AdvForm"  src="AdvForm.ascx"%>

Then further down in the scheduler i have put the following:

<script type="text/javascript">   
        //<![CDATA[
 
            // Dictionary containing the advanced template client object
         // for a given RadScheduler instance (the control ID is used as key).
         var schedulerTemplates = {};
         
         function schedulerFormCreated(scheduler, eventArgs) {
         // Create a client-side object only for the advanced templates
         var mode = eventArgs.get_mode();
         if (mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert ||
                    mode == Telerik.Web.UI.SchedulerFormMode.AdvancedEdit) {
         // Initialize the client-side object for the advanced form
         var formElement = eventArgs.get_formElement();   
         var templateKey = scheduler.get_id() + "_" + mode;
         var advancedTemplate = schedulerTemplates[templateKey];
         if (!advancedTemplate)
         {
         // Initialize the template for this RadScheduler instance
         // and cache it in the schedulerTemplates dictionary
     var schedulerElement = scheduler.get_element();
     var isModal = scheduler.get_advancedFormSettings().modal;
     advancedTemplate = new window.SchedulerAdvancedTemplate(schedulerElement, formElement, isModal);
     advancedTemplate.initialize();
 
     schedulerTemplates[templateKey] = advancedTemplate;
 
                        // Remove the template object from the dictionary on dispose.
     scheduler.add_disposing(function() {
                            schedulerTemplates[templateKey] = null;
     });
         }
 
         // Are we using Web Service data binding?
         if (!scheduler.get_webServiceSettings().get_isEmpty()) {
         // Populate the form with the appointment data
         var apt = eventArgs.get_appointment();
         var isInsert = mode == Telerik.Web.UI.SchedulerFormMode.AdvancedInsert;
         advancedTemplate.populate(apt, isInsert);
         }
         }
         }
             
        //]]>
        </script>
<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
        <scripts>
                <asp:ScriptReference Path="AdvancedForm.js" />
            </scripts>
        </telerik:RadScriptManager>
         
            
        <br />
        <telerik:RadScheduler ID="RadScheduler1" runat="server" EnableAdvancedForm="true"
            EnableDescriptionField="true" OnClientFormCreated="schedulerFormCreated">
             
            <AdvancedForm Modal="true" />
              <AdvancedInsertTemplate>
                
                 <schedular:AdvForm ID="AdvForm1" runat="server" Mode="Insert" />
                   
             </AdvancedInsertTemplate>
             
             
        </telerik:RadScheduler>
Is anyone able to tell me whey when i double click on the scheduler in run-time i.e. add appointment, nothing happens? That is the advanced form control is not popping up.
Peter
Telerik team
 answered on 07 Dec 2011
1 answer
90 views
Hi, One of our developers is trying to access the changed event for a resource dropdown in the advanced form of the RadScheduler.  Is it possible to fire a server-side event when this dropdown is changed? Any help would be greatly appreciated, as this is a time-sensitive project.

Thanks,
Peter
Telerik team
 answered on 07 Dec 2011
8 answers
909 views
If I know the column index, how do I get its header text and its unique name?
Please provide me the sample code to do that on both client-side (Javascript) and server-side (C# or VB).

Thanks

Lamk.
Elliott
Top achievements
Rank 2
 answered on 07 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?