Telerik Forums
UI for ASP.NET AJAX Forum
13 answers
704 views
Hi. I have this code:

        <telerik:RadScheduler ID="RadScheduler1" runat="server" Culture="Portuguese (Portugal)" 
            Height="440px" SelectedView="WeekView" Skin="Web20" Width="751px" DayEndTime="1.00:00:00" DayStartTime="06:00:00" OverflowBehavior="Scroll" ShowFooter="False" ShowViewTabs="False" AllowDelete="True" AllowEdit="True" AllowInsert="True" DataEndField="Fim" DataKeyField="ID" DataSourceID="SqlAulas" DataStartField="Inicio" DataSubjectField="Assunto" FirstDayOfWeek="Monday" LastDayOfWeek="Saturday" DataMember="DefaultView" EnableTheming="True" ShowAllDayRow="False" WorkDayEndTime="23:00:00" WorkDayStartTime="06:00:00" EnableCustomAttributeEditing="True" ShowMonthlyColumnHeader="False">  
           <ResourceTypes> 
                <telerik:ResourceType DataSourceID="SqlSessoes" ForeignKeyField="sessao_id" KeyField="id" 
                    Name="Tipo" TextField="descricao" /> 
                <telerik:ResourceType DataSourceID="SqlFormadores" ForeignKeyField="formador_id" 
                    KeyField="user_id" Name="Formador" TextField="nome" /> 
                <telerik:ResourceType DataSourceID="SqlUFs" ForeignKeyField="uf_id" KeyField="ID" 
                    Name="UF" TextField="Designacao" /> 
            </ResourceTypes> 
            <InlineInsertTemplate> 
   <asp:TextBox  
       ID="TitleTextBox" 
       runat="server" 
       Text='<%# Bind("Assunto") %>' 
       Width="90%" 
       TextMode="MultiLine" 
       Height="20px">  
   </asp:TextBox><br /> 
                   <radCb:RadComboBox ID="RadComboBox5" runat="server" DataMember="DefaultView" DataSourceID="SqlFormadores" 
            DataTextField="nome" DataValueField="user_id" Skin="Default" SkinsPath="~/RadControls/ComboBox/Skins" 
            Value='<%# Bind("formador_id") %>' Width="90px" AppendDataBoundItems="True">  
                       <Items> 
                           <radCb:RadComboBoxItem ID="RadComboBoxItem1" Text="Formador" runat="server" Selected="True" /> 
                       </Items> 
        </radCb:RadComboBox> 
        <br /> 
        <radCb:RadComboBox ID="RadComboBox4" runat="server" DataMember="DefaultView" DataSourceID="SqlSessoes" 
            DataTextField="descricao" DataValueField="id" Skin="Default" SkinsPath="~/RadControls/ComboBox/Skins" 
            Value='<%# Bind("sessao_id") %>' Width="90px" AppendDataBoundItems="True">  
            <Items> 
                <radCb:RadComboBoxItem ID="RadComboBoxItem2" runat="server" Text="Sessão" Selected="True" /> 
            </Items> 
        </radCb:RadComboBox> 
        <br /> 
        <radCb:RadComboBox ID="RadComboBox3" runat="server" DataMember="DefaultView" DataSourceID="SqlUFs" 
            DataTextField="Designacao" DataValueField="ID" Skin="Default" SkinsPath="~/RadControls/ComboBox/Skins" 
            Value='<%# Bind("uf_id") %>' Width="90px" AppendDataBoundItems="True">  
            <Items> 
                <radCb:RadComboBoxItem ID="RadComboBoxItem3" runat="server" Text="UF" Selected="True" /> 
            </Items> 
        </radCb:RadComboBox> 
        <br /> 
<asp:CheckBox ID="CheckBox1" runat="server" Checked='<%# Bind("precenca") %>' Font-Names="Arial" Font-Size="Small" Text="Presenças" /><br /> 
<asp:CheckBox ID="CheckBox2" runat="server" Checked='<%# Bind("sumario") %>' Font-Names="Arial" Font-Size="Small" Text="Sumário" /><br /> 
<asp:CheckBox ID="CheckBox3" runat="server" Checked='<%# Bind("ocorrencias") %>' Font-Names="Arial" Font-Size="Small" Text="Ocorrências" /><br /> 
<asp:CheckBox ID="CheckBox4" runat="server" Checked='<%# Bind("visitada") %>' Font-Names="Arial" Font-Size="Small" Text="Visitada" /><br /> 
<asp:CheckBox ID="CheckBox5" runat="server" Checked='<%# Bind("realizada") %>' Font-Names="Arial" Font-Size="Small" Text="Realizada" /><br /> 
<asp:CheckBox ID="CheckBox6" runat="server" Checked='<%# Bind("substituida") %>' Font-Names="Arial" Font-Size="Small" Text="Substituida" /><br /> 
   <asp:LinkButton  
       ID="InsertButton" 
       runat="server" 
       CommandName="Insert">  
           <asp:Image  
               runat="server" 
               ID="insertImage" 
               ImageUrl="../Images/giscon/AppointmentEditOK.gif" 
               AlternateText="insert" /> 
           </asp:LinkButton> 
           <asp:LinkButton  
               ID="InsertCancelButton" 
               runat="server" 
               CausesValidation="False" 
               CommandName="Cancel">  
                   <asp:Image  
                       runat="server" 
                       ID="Image3" 
                       ImageUrl="../Images/giscon/AppointmentEditCancel.gif" 
                       AlternateText="cancel" /> 
           </asp:LinkButton> 
 
</InlineInsertTemplate>   
<AppointmentTemplate> 
<%# Eval("Assunto") %><br /> 
<%# Eval("sessao_id") %> 
 
        
</AppointmentTemplate>   
 
 
        </telerik:RadScheduler> 

Everithing shows fine except the AppointmentTemplate that is giving me this error:  

DataBinding: 'Telerik.Web.UI.Appointment' does not contain a property with the name 'Assunto'.

But I have the Assunto in the DB.

Can you help me please?


thanks.

Hristo Valyavicharski
Telerik team
 answered on 13 May 2015
3 answers
101 views

When RadMenu renders in mobile-mode - the drop down appears behind other controls - such as RadDock.

This seems like something that should be corrected.  How do we manually set the z-index for the dropdown (drop downs in desktop mode properly appear over the rad dock.)

 Also - is it possible to alter the width of the mobile dropdown - its far too narrow to display anything other than single word labels.

Dimitar
Telerik team
 answered on 13 May 2015
3 answers
544 views

 Hello,

 I am trying to access some controls in the EditItemTemplate of a RadGrid EditForm.  Two of the columns are GridTemplateColumns and have RadTextBoxes in the EditItemTemplates, one column is a GridDropDownColumn.

 I have a LinkButton that launches a popup window for edit and add records.  I want to pass the contents of the controls to the form and use the results that come back to change the value in one of the RadTextBoxes.

 I can pop the window up just fine, but I am unable to retrieve the values from the edit controls to put in the querystring of the popup window url.

 I have followed every example that I can find online and I am unable to retrieve the values from the RadTextBoxes or the RadComboBox on the client.  I have tried finding the controls by their ID, as well as the column's UniqueName.  All to no avail.

 Can any one help me please?

 The grid markup is:
 (The columns that I want to capture are:  UniqueName="Program", UniqueName="LicenseNum", UniqueName="ApplicantName")

       <telerik:RadGrid ID="gvwFunds" ShowStatusBar="True" runat="server" AutoGenerateColumns="False"
         PageSize="7" AllowPaging="True" Skin="Bootstrap" Visible="False" GroupPanelPosition="Top">
         <PagerStyle Mode="NumericPages"></PagerStyle>
         <MasterTableView Name="gtvPrograms" DataKeyNames="Programs_UID" EditMode="InPlace" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage" ClientDataKeyNames="Program, License_Num, ApplicantName">
           <CommandItemTemplate>
             &nbsp;<asp:LinkButton ID="lbAddProgram" CommandName="InitInsert" runat="server">&nbsp;&nbsp;&nbsp;&nbsp;<img style="border:0px;vertical-align:middle;" alt="" src="../../Custom/Images/AddRecord.png"/>&nbsp;&nbsp;Add New Program</asp:LinkButton>
           </CommandItemTemplate>
           <DetailTables>
             <telerik:GridTableView Name="gtvFunds" DataKeyNames="Funds_UID" Width="100%" runat="server" EditMode="InPlace" CommandItemDisplay="Top">
               <CommandItemTemplate>
                 &nbsp;<asp:LinkButton ID="lbAddFund" CommandName="InitInsert" runat="server">&nbsp;&nbsp;&nbsp;&nbsp;<img style="border:0px;vertical-align:middle;" alt="" src="../../Custom/Images/AddRecord.png"/>&nbsp;&nbsp;Add New Fund</asp:LinkButton>
               </CommandItemTemplate>
               <Columns>
                 <telerik:GridDropDownColumn UniqueName="ddlFiscalCode" ListTextField="FiscalCode" ListValueField="FiscalCode"
                   ListDataMember="FiscalCodes" DataField="FiscalCode" HeaderText="Fiscal Code" DropDownControlType="RadComboBox" />
                 <telerik:GridTemplateColumn UniqueName="Fund" HeaderText="Fund">
                   <ItemTemplate>
                   </ItemTemplate>
                   <EditItemTemplate>
                     <telerik:RadTextBox ID="txtFund" Skin="Bootstrap" runat="server" Enabled="False" ReadOnly="True">
                     </telerik:RadTextBox>
                   </EditItemTemplate>
                 </telerik:GridTemplateColumn>
                 <telerik:GridTemplateColumn UniqueName="ObjectCode" HeaderText="Object Code">
                   <ItemTemplate>
                   </ItemTemplate>
                   <EditItemTemplate>
                     <telerik:RadTextBox ID="txtObjectCode" Skin="Bootstrap" runat="server" Enabled="False" ReadOnly="True">
                     </telerik:RadTextBox>
                   </EditItemTemplate>
                 </telerik:GridTemplateColumn>
                 <telerik:GridBoundColumn HeaderText="Amount" DataField="Amount" UniqueName="Amount" DataFormatString="{0:#,##0.00}" ItemStyle-HorizontalAlign="Right" FooterStyle-HorizontalAlign="Right" HeaderStyle-HorizontalAlign="Right">
                   <FooterStyle HorizontalAlign="Right" />
                   <HeaderStyle HorizontalAlign="Right" />
                   <ItemStyle HorizontalAlign="Right" />
                 </telerik:GridBoundColumn>
                 <telerik:GridEditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit">
                 </telerik:GridEditCommandColumn>
               </Columns>
               <EditFormSettings>
                 <EditColumn FilterControlAltText="Filter EditCommandColumn1 column" UniqueName="EditCommandColumn1">
                 </EditColumn>
               </EditFormSettings>
             </telerik:GridTableView>
           </DetailTables>
           <Columns>
             <telerik:GridDropDownColumn UniqueName="Program" ListTextField="DESCR" ListValueField="CODE"
               ListDataMember="ProgramList" DataField="ProgramCode" HeaderText="Program" DropDownControlType="RadComboBox">
             </telerik:GridDropDownColumn>
             <telerik:GridTemplateColumn UniqueName="LicenseNum" HeaderText="License #">
               <ItemTemplate>
               </ItemTemplate>
               <EditItemTemplate>
                 <telerik:RadTextBox ID="txtLicenseNum" Skin="Bootstrap" runat="server">
                 </telerik:RadTextBox>
               </EditItemTemplate>
             </telerik:GridTemplateColumn>
             <telerik:GridTemplateColumn UniqueName="ApplicantName" HeaderText="Applicant Name">
               <ItemTemplate>
               </ItemTemplate>
               <EditItemTemplate>
                 <telerik:RadTextBox ID="txtApplicantName" Skin="Bootstrap" runat="server">
                 </telerik:RadTextBox>
               </EditItemTemplate>
             </telerik:GridTemplateColumn>
             <telerik:GridEditCommandColumn ButtonType="LinkButton" UpdateText="Update" CancelText="Cancel" EditText="Edit">
             </telerik:GridEditCommandColumn>
           </Columns>
         </MasterTableView>
       </telerik:RadGrid> 
 Thanks,

 Bob

Robert
Top achievements
Rank 1
 answered on 13 May 2015
4 answers
79 views
I am adding items to the combobox using the examples given in the documentation and when I add an item I get an

JavaScript runtime error: Object doesn't support property or method 'get_simpleRendering'. I have tried various ways to do this to no avail. Any ideas as to why I am getting this error?

var combo = $find("<%= DayRadDropDownList.ClientID %>");
var i = 1;
for (i = 1; i <= mtype; i++) {
var comboItem = new Telerik.Web.UI.RadComboBoxItem();
comboItem.set_text("1");
comboItem.set_value("1");
combo.get_items().add(comboItem);
}
Dimitar
Telerik team
 answered on 13 May 2015
1 answer
411 views

 Hi everybody, 

    So, I'm running into an issues with the list box that is confusing me. I'm working on a page with a two list boxes that I'm using to transfer items back and fourth, really similar to the demo.

However, when I try to catch the OnClientTransferring event in my javascript, I'm getting a null from get_selectedItem, even though the item is selected? I tested this by adding a handler for OnClientSelectedIndexChanged, and that seems to work fine. What did I miss?

If it matter's the list boxes are populated programatically based on the input from a 3rd list box.

 Here is my ListBox aspx code.

<telerik:RadListBox runat="server" ID="RadListBoxAccountSource" Height="300px" Width="300px"
    AllowTransfer="true" TransferToID="RadListBoxAccountDestination" ButtonSettings-AreaWidth="35px">
</telerik:RadListBox>
<telerik:RadListBox runat="server" ID="RadListBoxAccountDestination" Height="300px" Width="250px">
</telerik:RadListBox>

 My JavaScript:

var listBox;
 
  function pageLoad() {
      listBox = $find("<%= RadListBoxAccountSource.ClientID %>");
  }
 
  function SourceSelectedIndexChange() {
      //This works just fine.
      var selectedItem = listBox.get_selectedItem();
      alert("selected" + selectedItem.get_value());
  }
 
  function transferRight() {
 
      //This returns a list of the items, so I know the list box is populated.
      var Items = listBox.get_items();
 
      //This comes back null
      var selectedItem = listBox.get_selectedItem();
 
      if (selectedItem == null) {
          alert("You need to select a item first.");
          return false;
      }
      else {
          listBox.transferToDestination(selectedItem);
          return false;
      }
  }

 

Any help or advice would be welcome, I'm not sure what's going on. :/

Hristo Valyavicharski
Telerik team
 answered on 13 May 2015
6 answers
159 views

Hello.

I am using Telerik ASP.NET AJAX RadGrid 2010.3.1215.40 in an ASP.NET WebForms application and have the following problem: When I hit the export button of the grid the generated PDF file is displayed with the wrong filename and extension to the user.

The correct filename would be "my-product-list.pdf".

But the filename used is "index.aspx" (the name of the ASP.NET WebForms page).

These are the export settings used on the page:

<ExportSettings ExportOnlyData="true" OpenInNewWindow="true" IgnorePaging="true" FileName="my-product-list">
    <Pdf PaperSize="A4" AllowPrinting="true" />
</ExportSettings>

For some strange reason the problem only happens on our production server. Just like in this case: http://stackoverflow.com/questions/30050996/asp-net-content-disposition-using-wrong-filename-on-production-server (also posted by me)

Could you please help me to find out what causes this behaviour? I am out of ideas.

Daniel
Telerik team
 answered on 13 May 2015
1 answer
97 views

I noticed in all the current examples for the Diagram Control it only has the rotate button that only rotates 90 degrees instead of letting you manually rotate.  Is it possible to still get the shapes to rotate using the method used here:http://dojo.telerik.com/uZeN  or is this only possible in an older version? 

 Or maybe it would be possible to copy something out of the script files in that example into the current version to get the rotate to work this way?

 

 

Thanks.

Daniel
Telerik team
 answered on 13 May 2015
3 answers
293 views

Hi,

I have a RadComboBox with the checkboxes active. I want to have a postback for the ItemChecked event.

The combobox also is generating a postback on closing of the dropdown which I do not want. How can I prevent this to happen.

I have found a similar thread (http://www.telerik.com/forums/radcombobox-auto-post-back-issue) but the link to the solution presented there does not work anymore.

 

Paul

Aneliya Petkova
Telerik team
 answered on 13 May 2015
1 answer
123 views

I am having an issue with following the demo located at (http://demos.telerik.com/aspnet-ajax/grid/examples/data-editing/edit-form-types/defaultcs.aspx)

I have been able to get the radgrid to fill with my datasource, see the edit column and popsup the edit form as I have formated it. But when I make the "Edit" and choose the "Update" nothing happens. The values seem to be getting saved, but there not going to the database. The AcceptChanges() command is where I believe it is not saving to the database.  

Below is my code behind. Any help would be appreciated. Thank you in advance.

 

Partial Class Member

Public Function GetDataTable(ByVal query As String) As DataTable 

        Dim ConnString As String = ConfigurationManager.ConnectionStrings("DatabaseName").ConnectionString

        Dim conn As SqlConnection = New SqlConnection(ConnString)

        Dim adapter As SqlDataAdapter = New SqlDataAdapter

        adapter.SelectCommand = New SqlCommand(query, conn)

        Dim table1 As New DataTable

        conn.Open()

        Try

            adapter.Fill(table1)

        Finally

            conn.Close()

        End Try

        Return table1

    End Function 

    Public ReadOnly Property Members() As DataTable

        Get

            Dim obj As Object = Me.Session("Members")

            If (Not obj Is Nothing) Then

                Return CType(obj, DataTable)

            End If

    Dim dtblMember As New Main.tblMemberDataTable       

dtblMember = memberAdapter.GetAllMemberInfo()

            Me.Session("Members") = dtblMember

            Return dtblMember 

        End Get

    End Property

    Protected Sub rgMember_NeedDataSource(ByVal source As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgMember.NeedDataSource 

        Me.rgMember.DataSource = Me.Members

        Me.Members.PrimaryKey = New DataColumn() {Me.Members.Columns("MemberID")}

 End Sub

     Protected Sub rgMember_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles rgMember.PreRender

        If Not IsPostBack And Me.rgMember.MasterTableView.Items.Count > 1 Then

            'This sets the specified item to default to edit mode on load when set to True.

            Me.rgMember.MasterTableView.Items(1).Edit = False           

            Me.rgMember.MasterTableView.Rebind()

        End If

    End Sub

    Protected Sub rgMember_UpdateCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgMember.UpdateCommand

        Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)

        Dim MyUserControl As UserControl = CType(e.Item.FindControl(GridEditFormItem.EditFormUserControlID), UserControl)

'Locate the changed row in the DataSource
        Dim changedRows As DataRow() = Me.Members.Select("MemberID = " & editedItem.OwnerTableView.DataKeyValues(editedItem.ItemIndex)("MemberID"))

        If (Not changedRows.Length = 1) Then

            e.Canceled = True

            Return

        End If 

        'Update new values

        Dim newValues As Hashtable = New Hashtable 

        newValues("Designation") = CType(MyUserControl.FindControl("txtDesignation"), TextBox).Text

        newValues("AppointedDate") = CType(MyUserControl.FindControl("rdpAppointedDate"), RadDatePicker).SelectedDate.ToString()

        newValues("EffectiveDate") = CType(MyUserControl.FindControl("rdpEffectiveDate"), RadDatePicker).SelectedDate.ToString()

        newValues("TermExpireDate") = CType(MyUserControl.FindControl("rdpTermExpireDate"), RadDatePicker).SelectedDate.ToString()

        newValues("ChairID") = CType(MyUserControl.FindControl("ddlChair"), RadDropDownList).SelectedItem.Value

        newValues("SeatTypeID") = CType(MyUserControl.FindControl("ddlSeatType"), RadDropDownList).SelectedItem.Value

        newValues("Replacing") = CType(MyUserControl.FindControl("txtReplacing"), TextBox).Text 

        changedRows(0).BeginEdit()

        Try

            Dim entry As DictionaryEntry

            For Each entry In newValues

                changedRows(0)(CType(entry.Key, String)) = entry.Value

            Next

            changedRows(0).EndEdit()

            Me.Members.AcceptChanges()

        Catch ex As Exception

            changedRows(0).CancelEdit() 

            Dim lblError As Label = New Label()

            lblError.Text = "Unable to update Board Member. Reason: " + ex.Message

            lblError.ForeColor = System.Drawing.Color.Red

            rgMember.Controls.Add(lblError) 

            e.Canceled = True

        End Try

    End Sub

Konstantin Dikov
Telerik team
 answered on 13 May 2015
1 answer
120 views

Hi

Dear

 I have a grid with template column (item template and edit template) and i use required validation (client side) in item template because it is radtextbox, when export to excel, these fields have '*' in excel file .Why?

 <telerik:GridTemplateColumn FilterControlWidth="70%" AutoPostBackOnFilter="true" DataField="Shomaresh"
                        HeaderStyle-Width="100px" HeaderText="<%$ Resources:Resource, Shomaresh %>"
                        UniqueName="Shomaresh">
                        <ItemTemplate>
                            <telerik:RadNumericTextBox Width="100%"  runat="server" ID="rtxt_Shomaresh" Text='<%# Bind("Shomaresh") %>'>
                            </telerik:RadNumericTextBox>
                            <asp:RequiredFieldValidator ID="RFV_Shomaresh" runat="server" ErrorMessage="<%$ Resources:Resource, Shomaresh %>" Text="*" ValidationGroup="AnbarGardani" ControlToValidate="rtxt_Shomaresh" ForeColor="Red"></asp:RequiredFieldValidator>
                        </ItemTemplate>
                        <EditItemTemplate>
                            <telerik:RadNumericTextBox Width="100%" runat="server" ID="rtxt_Shomaresh" Text='<%# Bind("Shomaresh") %>'>
                            </telerik:RadNumericTextBox>
                            <asp:RequiredFieldValidator ID="RFV_Shomaresh" runat="server" ErrorMessage="<%$ Resources:Resource, Shomaresh %>" Text="*" ValidationGroup="AnbarGardani" ControlToValidate="rtxt_Shomaresh" ForeColor="Red"></asp:RequiredFieldValidator>
                        </EditItemTemplate>
                    </telerik:GridTemplateColumn>

I think this problem comes from required validator in item template.Other template columns that are not validator ,dont have this problem.

Please help.

 Thanks.

 

Maria Ilieva
Telerik team
 answered on 13 May 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?