Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
140 views
Greetings,

i've been trying to use RadScheduler for a few hours and i have already a problem.
Got this error "Both DataSource and DataSourceID are defined on 'RadScheduler".

I don't understand why since i haven't defined a datasource anywhere. Just DataSourceID trying to set a DataSource.
All my code was so far generated automatically


This is what i have:

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="RadSchedulerWebForm.aspx.cs" Inherits="RadSchedulerWebForm" %>

<%@ Register src="RadSchedulerWebFormAdvancedForm.ascx" tagname="AdvancedForm" tagprefix="uc1" %>

<!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></title>
    <telerik:RadStyleSheetManager ID="RadStyleSheetManager1" runat="server" />
</head>
<body>
    <form id="form1" runat="server">
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server">
        <Scripts>
            <%--Needed for JavaScript IntelliSense in VS2010--%>
            <%--For VS2008 replace RadScriptManager with ScriptManager--%>
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
            <asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
        </Scripts>
    </telerik:RadScriptManager>
    <script type="text/javascript">
        //Put your Java Script code here.
    </script>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadScheduler1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadScheduler1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
 
    <telerik:RadSkinManager ID="RadSkinManager1" Runat="server" Skin="Forest">
    </telerik:RadSkinManager>
    <div>
        <telerik:RadScheduler runat="server" ID="RadScheduler1"
            Width="750px"
            OnAppointmentInsert="RadScheduler1_AppointmentInsert"
            OnAppointmentUpdate="RadScheduler1_AppointmentUpdate"
            OnAppointmentDelete="RadScheduler1_AppointmentDelete"
            DataKeyField="idRDV" DataSubjectField="objet" DataStartField="debut" DataEndField="duree"
            DataRecurrenceField="objet" DataRecurrenceParentKeyField="objet"
            StartInsertingInAdvancedForm="True" DataDescriptionField="description"
            DataSourceID="SqlDataSource1">

            <AdvancedEditTemplate>
            <uc1:AdvancedForm    runat="server" ID="AdvancedEditForm"
                                        Subject='<%# Bind("Subject") %>'
                                        Start='<%# Bind("Start") %>'
                                        End='<%# Bind("End") %>'/>
               <div style="text-align: right">
                    <asp:Button ID="UpdateButton" runat="server" CommandName="Update" Text="Update"/>
                    <asp:Button ID="UpdateCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"/>
               </div>
            </AdvancedEditTemplate>
            <AdvancedInsertTemplate>
            <uc1:AdvancedForm    runat="server" ID="AdvancedInsertForm"
                                        Subject='<%# Bind("Subject") %>'
                                        Start='<%# Bind("Start") %>'
                                        End='<%# Bind("End") %>'/>
                <div style="text-align: right">
                    <asp:Button ID="InsertButton" runat="server" CommandName="Insert" Text="Insert"/>
                    <asp:Button ID="InsertCancelButton" runat="server" CausesValidation="False" CommandName="Cancel" Text="Cancel"/>
                </div>
            </AdvancedInsertTemplate>
    </telerik:RadScheduler>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server"
            ConnectionString="<%$ ConnectionStrings:IntranetConnectionString %>"
            SelectCommand="SELECT [objet], [debut], [duree], [heure], [description], [lieu], [idRDV] FROM [rendezvous]">
        </asp:SqlDataSource>
    </div>
    </form>
</body>
</html>




thank you in advance for you help
Plamen
Telerik team
 answered on 07 Oct 2011
3 answers
72 views
Took the following sample code:

http://demos.telerik.com/aspnet-ajax/grid/examples/programming/selectedvalue/defaultvb.aspx

And adapted it to mysql and my dB, can get grids one and two working as they should but grid 3 will not show any data. what am i doing wrong?
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
</telerik:RadScriptManager>
 
 
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <ajaxsettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid3" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid2">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid2" />
                    <telerik:AjaxUpdatedControl ControlID="RadGrid3" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="RadGrid3">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid3" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </ajaxsettings>
    </telerik:RadAjaxManager>
     
    <strong>States:</strong>
    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="true"
        PageSize="5" DataSourceID="SqlDataSource1" GridLines="None" width="95%">
        <clientsettings allowkeyboardnavigation="true" enablepostbackonrowclick="true">
            <Selecting AllowRowSelect="true" />
        </clientsettings>
        <mastertableview datakeynames="State" />
        <pagerstyle mode="NextPrevAndNumeric" />
    </telerik:RadGrid><br /><br />
     
    <strong>Companies:</strong>
    <telerik:RadGrid ID="RadGrid2" ShowStatusBar="true" runat="server"
        AllowPaging="True" PageSize="5" DataSourceID="SqlDataSource2" GridLines="None"
        width="95%" HorizontalAlign="NotSet">
        <mastertableview width="100%" datakeynames="State"
            datasourceid="SqlDataSource2">
        </mastertableview>
         <clientsettings allowkeyboardnavigation="true" enablepostbackonrowclick="true">
            <Selecting AllowRowSelect="true" />
        </clientsettings>
        <pagerstyle mode="NextPrevAndNumeric" />
    </telerik:RadGrid><br /><br />
     
    <strong>Records:</strong>
    <telerik:RadGrid ID="RadGrid3" ShowStatusBar="true" runat="server"
        AllowPaging="True" PageSize="5" DataSourceID="SqlDataSource3" GridLines="None"
        width="95%" HorizontalAlign="NotSet">
        <mastertableview width="100%"
            datasourceid="SqlDataSource3">
        </mastertableview>
         <clientsettings allowkeyboardnavigation="true" enablepostbackonrowclick="true">
            <Selecting AllowRowSelect="true" />
        </clientsettings>
        <pagerstyle mode="NextPrevAndNumeric" />
    </telerik:RadGrid>
 
 
    <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:connex %>"
        ProviderName="MySql.Data.MySqlClient" SelectCommand="
            SELECT EMPLOYER_STATE AS State,
            COUNT(EMPLOYER_STATE) as 'Total Filings'
            FROM y2010
            GROUP BY EMPLOYER_STATE
            ORDER BY COUNT(EMPLOYER_STATE) desc"
        runat="server"></asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:connex %>"
        ProviderName="MySql.Data.MySqlClient" SelectCommand="
        SELECT EMPLOYER_NAME AS Employer,
        EMPLOYER_STATE AS State,
        COUNT(EMPLOYER_NAME) as 'Total Filings'
        FROM y2010
        WHERE EMPLOYER_STATE=@state
        GROUP BY EMPLOYER_NAME
        ORDER BY COUNT(EMPLOYER_STATE) desc"
        runat="server">
        <SelectParameters>
         <asp:ControlParameter ControlID="RadGrid1" DefaultValue="CA" Name="State"
         PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>
    <asp:SqlDataSource ID="SqlDataSource3" ConnectionString="<%$ ConnectionStrings:connex %>"
        ProviderName="<%$ ConnectionStrings:connex.ProviderName %>"
        SelectCommand="SELECT SOC_NAME, EMPLOYER_NAME AS Employer
        FROM y2010 WHERE (EMPLOYER_NAME = @Employer)"
        runat="server">
        <SelectParameters>
         <asp:ControlParameter ControlID="RadGrid2" name="Employer"
         PropertyName="SelectedValue" Type="String" />
        </SelectParameters>
    </asp:SqlDataSource>


Marin
Telerik team
 answered on 07 Oct 2011
1 answer
88 views
Greetings.

We are trying to display a simple bar chart. This bar chart has to display following values:

X-Axis    Y-Axis
A              2
B              2
C              2        
D              2
E              2

But when we try to run the page, each time we get different chart. Sometime the bars are overlapping. Please help.

We are using AJAX controls Q3 2010.

Peshito
Telerik team
 answered on 07 Oct 2011
2 answers
105 views
ASP.NET framework 4.0
Windows 7
RadControls for ASP.NET AJAX Q2 2011

preferred programming C#

I have a question about how to change the RadAsyncuploading handling of saving to the targetfolder. 

The situation as i want it goes as follows: The user is able to select his files/images and they are saved in the temporaryfolder. This way i can view the images with the webviewer im using. Also the utility RadASyncUploader helps with deleting files that are not being used or not being deleted and so on..
But i do not want to save the files to another targetfolder but i want to save them in a database. How can i make this happen?

Im rather new to web programming and i really could use the help. Saving to a database i can do ofcourse but where do i change the handling of saving to the targetfolder

THanks in advance,

Koen Staal


Koen
Top achievements
Rank 1
 answered on 07 Oct 2011
1 answer
69 views
I have a RadGrid that loads from a DataTable pulled from my database.  The user can click a "Refresh" button on the page that will update the database behind the scenes, then update various labels on the page as well as the RadGrid from the new database entries, all through RadAjax.  The labels correctly update, but the problem comes when I call RadGrid1.Rebind();

The "Refresh" click code sets two global variables in the codebehind and then uses those values in updating the page.  Then Rebind() gets called at the end of the function, and in the process, processes each row of the grid.  One column in each row calls a function that uses one of the global variabes set earlier to genereate an image URL.  However, even though the same global variable was accessible in the Callback code, in the Rebind code it is suddenly NULL.  I get a Javascript error and the RadGrid doesn't get updated.

Summary: How do I set variables in my RadAjax callback function that will be accessable by the functions Rebind calls when repopulating my RadGrid?

Thanks in advance for your help.
Veli
Telerik team
 answered on 07 Oct 2011
1 answer
102 views
i have a grid with editmode="inPlace" for textboxes.i m not able to perform javascript validation on update and insert.can u share a sample code for the same validation.here i m attaching screen shot of grid
Iana Tsolova
Telerik team
 answered on 07 Oct 2011
2 answers
53 views
Hi All,

Sorting does not work in my radgrid when I paginate it. If I keep AllowPaging=false, then columns are properly sorted. I tried to sort it using sort expression as well as code-behind but same issue. I also referred to official example given online, but it did not help.

Please guide if I am missing something. Thanks in advance!!!

Dhaval
Dhaval
Top achievements
Rank 1
 answered on 07 Oct 2011
1 answer
56 views

Hi I started with your

Grid / User Control Edit Form

http://demos.telerik.com/aspnet-ajax/grid/examples/dataediting/usercontroleditform/defaultvb.aspx

I have altered it with comboboxes for form values to add or alter, they show up fine. but when I hit insert or update, the values are not nothing.

from user control
combo
<telerik:RadComboBox ID="rcbclient" runat="server" DataMember="id" DataTextField="client_name"
                             AutoPostBack="true" AllowCustomText="true" Width="275px">
                        </telerik:RadComboBox>
  
databind
rcbclient.DataSource = getClients()
        rcbclient.DataBind()
  
from Default.vb
 Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
        Dim userControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)
  
        'Prepare new row to add it in the DataSource
        Dim newRow As DataRow = Me.Staging.NewRow
  
        'Insert new values
        Dim newValues As Hashtable = New Hashtable
        newValues("id") = CType(userControl.FindControl("rcbclient"), RadComboBox).SelectedItem.Value
        newValues("client_id") = CType(userControl.FindControl("rcbclient"), RadComboBox).DataMember
        newValues("client_name") = CType(userControl.FindControl("rcbclient"), RadComboBox).SelectedValue.ToString


thank you.
regina
Top achievements
Rank 1
 answered on 06 Oct 2011
4 answers
67 views
Hi,
I've just downloaded the latest version (DEMO) of Telerik ASP.NET AJAX controls.
I wanted to check if there is the option to use UpdatePanel or RadAjaxPanel to submit the content from the editor in AJAX postback.

Generally it is possible. But it doesn't work in my Firefox. I have Firefox 6.0.2 and each button in my example makes classic postback.
I did it on the basis of that page.

Here you have my code. All the 4 clicks make classic postback in FF. I need to use AJAX and it should work in the latest FF, IE (7,8,9), the latest Chrome, and the latest Safari.

<form id="form1" runat="server">
   <asp:ScriptManager ID="ScriptManager1" runat="server" />
   <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
       <asp:Panel ID="pnlRadEditor" runat="server">
           <div>
               Standard Button:  <asp:Button ID="btnSave" UseSubmitBehavior="false" runat="server"
                   OnClick="btnSave_Click" Text="Save" /></div>
           <div style="margin-top: 10px;">
               Image Button: <asp:ImageButton ID="ImageButton1" runat="server" OnClientClick="javascript:__doPostBack(this.id,'');return false;"
                   OnClick="btnSave_Click" ImageUrl="http://www.telerik.com/DEMOS/ASPNET/RadControls/Editor/Skins/Default/buttons/save.gif" /></div>
           <div style="margin-top: 10px;">
               <telerik:RadEditor ID="RadEditor1" runat="server" EnableViewState="false">
               </telerik:RadEditor>
           </div>
       </asp:Panel>
   </telerik:RadAjaxPanel>
   <div>
       Standard Button:  <asp:Button UseSubmitBehavior="false" ID="Button1" runat="server"
           OnClick="btnSave_Click" Text="Save" /></div>
   <asp:UpdatePanel ID="UpdatePanel1" runat="server">
       <Triggers>
           <asp:AsyncPostBackTrigger ControlID="Button1" />
       </Triggers>
       <ContentTemplate>
           <div style="margin-top: 10px;">
               Image Button: <asp:ImageButton ID="ImageButton2" runat="server" OnClientClick="javascript:__doPostBack(this.id,'');return false;"
                   OnClick="btnSave_Click" ImageUrl="http://www.telerik.com/DEMOS/ASPNET/RadControls/Editor/Skins/Default/buttons/save.gif" /></div>
           <div style="margin-top: 10px;">
               <telerik:RadEditor ID="RadEditor2" runat="server" EnableViewState="false">
               </telerik:RadEditor>
           </div>
       </ContentTemplate>
   </asp:UpdatePanel>
   </form>

Regards,
Dawid Niedzwiedz
Dawid Niedzwiedz
Top achievements
Rank 1
 answered on 06 Oct 2011
1 answer
94 views
Hi,

I have a asp gridview on the parent page and there is a button outside of the grid. On button click, radwindow popup appears. When the user closes the popup, it invokes the RadajaxManager's ajaxrequest on the parent page. The code steps into the _ajaxrequest and does gridview.databind. I can see that the number of rows are correct in the grid but when the process is complete, the grid does not refresh. I tried by replacing the asp gridview with Radgrid but still had no success.
I am pasting my code here. Please let me know if I need to give more information.

Any help is greatly appreciated..

btnDelegate lauches the radwindow.
function 
  
openRadWindow(args) { 
var EmpID = $find("<%=cboEmployee.ClientID %>")._value; 
window.radopen("AdminDelegationPopup.aspx?EmpID=" + EmpID + "&Type=" + args, "RadWindow1"); }
  
   
  
   
  
function refreshGrid(arg) {  
if (arg == 'Delegation') { 
$find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("Delegation"); // Invoking ajaxRequest }
  
   
  
}

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest"
  
 <AjaxSettings> 
  
  <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"
  
  <UpdatedControls> 
  
  <telerik:AjaxUpdatedControl ControlID="grdDelegatedRights" /> 
  
  <telerik:AjaxUpdatedControl ControlID="btnDelegate" /> 
  
  </UpdatedControls> 
  
 </telerik:AjaxSetting> 
  
<telerik:AjaxSetting AjaxControlID="grdDelegatedRights"
  
 <UpdatedControls> 
  
 <telerik:AjaxUpdatedControl ControlID="grdDelegatedRights" /> 
  
 </UpdatedControls> 
  
 </telerik:AjaxSetting> 
  
 <telerik:AjaxSetting AjaxControlID="btnDelegate"
  
 <UpdatedControls> 
  
 <telerik:AjaxUpdatedControl ControlID="grdDelegatedRights" /> 
  
 <telerik:AjaxUpdatedControl ControlID="btnDelegate" /> 
  
 </UpdatedControls> 
  
 </telerik:AjaxSetting> 
  
 </AjaxSettings> 
  
 </telerik:RadAjaxManager> 
  
 <asp:GridView ID="grdDelegatedRights" runat="server" AutoGenerateColumns="False" CellPadding="4" Font-Names="Tahoma,Verdana" Font-Size="10px" ForeColor="#333333" Width="825px" AllowPaging="True" DataKeyNames="EmpDelegationId">  
<Columns> 
  
 <asp:BoundField DataField = "EmpName" HeaderText = "Employee Name" /> 
  
<asp:BoundField DataField="EmpId" HeaderText="Employee Id" /> 
  
 <asp:BoundField DataField="FullName" HeaderText="Delegated Employee" /> 
  
 <asp:BoundField DataField="SecurityRole" HeaderText="Role" /> 
  
 <asp:BoundField DataField="DateDelegated" HeaderText="Date Delegated" /> 
  
 <asp:TemplateField ShowHeader="False"
  
 <ItemTemplate> 
  
 <asp:ImageButton ID="imgRemoveDelegation" runat="server" CausesValidation="False" 
  
 CommandName="Delete" ImageUrl="~/Images/document_delete_small.gif" OnClientClick="return confirm('Are you sure you want to remove the delegation?');"  ToolTip="Remove the delegated rights" /> 
  
</ItemTemplate> 
  
 <ItemStyle HorizontalAlign="Center" /> 
  
 </asp:TemplateField> 
  
 </Columns> 
  
 <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> 
  
 <RowStyle BackColor="#F7F6F3" ForeColor="#333333" /> 
  
 <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" /> 
  
 <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" /> 
  
 <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" /> 
  
 <EditRowStyle BackColor="#999999" /> 
  
 <AlternatingRowStyle BackColor="White" ForeColor="#284775" /> 
  
 <PagerSettings Mode="NumericFirstLast" /> 
  
 </asp:GridView> 

 
AjaxRequest..I am able to step into the following code succesfully.

Protected Sub RadAjaxManager1_AjaxRequest(ByVal sender As Object, ByVal e As Telerik.Web.UI.AjaxRequestEventArgs) 
  
If e.Argument = "Delegation" Then 
  
 Dim oDelegation As New Delegation 
  
 Dim dsDelegatedRights As DataSetdsDelegatedRights = oDelegation.GetDelegatedRights(cboEmployee.SelectedValue)grdDelegatedRights.DataSource = dsDelegatedRights
  
grdDelegatedRights.DataBind()
End If 
End Sub

this is on the radwindow.

 

function
  
 CloseAndRebindGrid(args) { 
  
 GetRadWindow().Close();
  
GetRadWindow().BrowserWindow.refreshGrid(args);
  
}
Vijetha
Top achievements
Rank 1
 answered on 06 Oct 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?