Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
385 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
152 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
83 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
285 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
117 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
115 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
1 answer
46 views
Hi,
I want when I bind radgrid from codebehind, all editable cell start in BatchChanged mode. Is it possible?
Because I made some calculations before bind grid, and after that sometimes values in cell are different, and I want to know which cell is with changed status
Eyup
Telerik team
 answered on 13 May 2015
1 answer
81 views

hi 

I Have RadGrid and want Delete One Row in ItemDataBound..... 

means , when ItemDataBound appaly i want  check some Item and then delete one row .... 

 protected void gvShow_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem dataitem = (GridDataItem)e.Item;
             
             if ( check one EstateMent)
              {  

Do Some things

                }

                else
                {
                here I want Delete Current Row 
                 }

Eyup
Telerik team
 answered on 13 May 2015
1 answer
93 views

Is there a way to prevent this? It makes life difficult when you can't use the design view. (see attached)

Note, this happens everywhere in the project.

Vessy
Telerik team
 answered on 13 May 2015
6 answers
115 views

Hi,

I have a requirement to be able to navigate our website using only the keyboard (we support blind people who do not use a mouse).

We find that once a RadGrid FilterMenu has popped up after clicking the Filter button, it is not possible to close it without selecting a menu item or clicking elsewhere with the mouse. I need the menu to close when the user presses "Escape".

I cannot seem to find a way to intercept keystrokes with the FilterMenu - There doesn't seem to be an OnKeyPress event?

 

I hope you can help,

Thanks.

 

Melanie
Top achievements
Rank 1
 answered on 13 May 2015
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?