Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
355 views
I have a radcombobox with checkboxes and Multiple values in the drop-down, when I check  values in the radcombobox , OnitemChecked server side event is called and based on the values checked data shows up on the page.

But when I checked Select All for Checkboxes, no event is called. Could someone please suggest  me which event is related to the Select All Checkboxes feature
<telerik:RadComboBox ID="uxRCBCustomerName" runat="server" Width="200px" EnableCheckAllItemsCheckBox="true"
            DropDownWidth="500px"  height="120px" DataTextField="HPDCustomerName" DataValueField="HPDCustomerID"  AllowCustomText="true" CheckBoxes="true"  DataKeyField="employerGroupID" EmptyMessage="No Promo Found" AutoPostBack="true" CheckedItemsTexts="DisplayAllInInput"   AppendDataBoundItems="true" OnItemChecked="uxRCBCustomerName_ItemChecked"   EnableViewState="true" MarkFirstMatch="true" CausesValidation="false" >
           <ItemTemplate>
                              
                               <ul
                   <li class="col1" >
                   <%# DataBinder.Eval(Container, "Text")%>
                    </li>
                      <li class="col2">         
                       <%# If(DataBinder.Eval(Container.DataItem, "hasJOnly"), "J", "")%><%# If(DataBinder.Eval(Container.DataItem, "hasJM"), "JM", "")%><%# If(DataBinder.Eval(Container.DataItem, "hasJOnly")=False and DataBinder.Eval(Container.DataItem, "hasJM")=false, "N/A", "")%></td>
                                           
                   </li>  
                   </ul>
                                     
                 
           </ItemTemplate>
       </telerik:RadComboBox>

I am looking for a server side event. Please see my code above for radcombobox.

Thanks,
Ruby
Top achievements
Rank 1
 answered on 23 Oct 2012
1 answer
97 views
Hello,

I need a tip on RadAjaxPanel.

Can anyone give me some idea about that how I can get the RadAjaxPanel object (refernce) in external java script file...!!!

I am very bad with java script, I know lot of gurus are around here :)

shadow
Top achievements
Rank 2
 answered on 23 Oct 2012
1 answer
71 views
Hello,

I am facing a strange problem related to design of RadProgressArea.
I have attatched an image. 

It is not rendering the ProgressArea with proper design after postback.

Any help...!!!
shadow
Top achievements
Rank 2
 answered on 23 Oct 2012
2 answers
116 views
Hi,

I am using a Radgrid with script services for the data binding.
For deleting a row, I implemented a GridClientDeleteColumn which fires a "Delete"-command on which I am deleting the clicked row via a script service. After deleting a row, the rowIndexes are actually not updated and I get some errors when I am deleting several rows after each other.

Here is my code:

   

function KontakthistorieGridCreated(ansprechpartnerid) {
 
    pms_neu.grid_service.get_history(window.location.hostname, ansprechpartnerid, kontakthistorieUpdateGrid);
 }
 
 function kontakthistorieUpdateGrid(result) {
     var tableView = $find("<%= rdg_historie.ClientID %>").get_masterTableView();
         tableView.set_dataSource(result);
         tableView.dataBind();
         tableView.set_virtualItemCount(result.length);
         adjust_pane_heights();
 }
 
 function OnCommand(sender, args) {
     //Die funktion kann ruhig leer sein, MUSS aber vorhanden sein (irgendwas mit Client-Object erstellen und so...)
     if (args.get_commandName() == "Delete") {
         var itemIndex = args.get_commandArgument();
         var history_id = sender.get_masterTableView().get_dataItems()[itemIndex].getDataKeyValue("id");
         pms_neu.grid_service.delete_history(window.location.hostname, history_id, history_delete_done);
 
         args.set_cancel(true);
     }
 }

There problem occurs because the commandArgument() isnot beeing updated after deleting the row and even not after I call the databind method again. Deleting itemIndex 0 will cause that the following first item has itemIndex 1 but it must be zero for fetching the right datatime.
 
var itemIndex = args.get_commandArgument();
var history_id = sender.get_masterTableView().get_dataItems()[itemIndex].getDataKeyValue("id");

Does anyone knows a solution for this?
I would really appreciate some help on this

Kind regards



Nils C.
Top achievements
Rank 1
 answered on 23 Oct 2012
6 answers
379 views

Hello,

I want to set value of radNumericTextbox in its “OnValueChanging” Client event.

But in OnValueChanging event, I am able to get value of radNumericTextbox using sender.get_value(), but sender.set_value(10.123) returns undefined.

 

So, I tried following method

function OnValueChanging(sender, eventArgs) {

  

    var message;

   

    var target = document.getElementById(sender.get_element().id + '_text');

target.value= 10.123

}

Now, my value is set correctly as 10.123 in radNumericTextBox but without number format.

My radNumericTextbox must have “d” as decimal separator. So it should display 10d123.

Any solutions how set my value with number format in RadNumericTextbox?

Thanks in advance.

Kavitha
Top achievements
Rank 1
 answered on 23 Oct 2012
5 answers
140 views
I'm new to RadControls and I'm trying to rough out a simple page using a couple of RadComboBoxes, version 4.0.

First of all I note that there seems to be a great deal of chatter on this forum about bugs in the boxes.

However I wonder if my problem is related or whether I can't use these as ordinary combo boxes.

The code is extremely simple.
I bind it like this:
 cb.DataTextField = "Desc";
 cb.DataValueField = "Id";
 cb.DataBind();

I then hit an ordinary Asp.Net button and try to get the selected values in the click event. 
The data appears to have loaded correctly and the selected text is correct but I cannot get the correct selected value.
I've tried both SelectedValue and SelectedItem.Value.  It's as if it's not setting at all.
Nencho
Telerik team
 answered on 23 Oct 2012
1 answer
104 views
Hi,

RAD Editor having option save the content as PDF and RDF..

 Is there any option to save as a image?


Regards,
Saravanan M
Rumen
Telerik team
 answered on 23 Oct 2012
1 answer
135 views
The below code works on another page but the CountryCombo always says Afghanistan (alpha order) when in InsertMode.  This is a radWindow page, hence the querystrings at the beginning.  I've attached everything so the page lifecycle is clear.  For some reason ItemCreated always fires twice, and when I step though, I see it Select the correct record, but when the form displays, it always says Afghanistan.

  Private Sub Page_Init(sender As Object, e As System.EventArgs) Handles Me.Init
 
        recipientOrganizationID = Request.QueryString.Get("ID")
        DisplyMode = Request.QueryString.Get("show")
 
        If recipientOrganizationID = Nothing AndAlso DisplyMode Is Nothing Then
            RecipientOrganizationView.ShowInsertItem()
        Else
            For i = 0 To RecipientOrganizationView.PageSize - 1
                RecipientOrganizationView.EditIndexes.Add(i)
            Next
        End If
 
    End Sub
 
    Private Sub RecipientOrganizationView_ItemCreated(sender As Object, e As Telerik.Web.UI.RadListViewItemEventArgs) Handles RecipientOrganizationView.ItemCreated
 
        If TypeOf e.Item Is RadListViewEditableItem AndAlso e.Item.IsInEditMode Then
 
            'if the item is in edit mode
            Dim editItem As RadListViewEditableItem = DirectCast(e.Item, RadListViewEditableItem)
            Dim CountryCombo As RadComboBox = DirectCast(editItem.FindControl("CountryCombo"), RadComboBox)
            CountryCombo.AutoPostBack = True
 
            Dim ProvinceCombo As RadComboBox = DirectCast(editItem.FindControl("ProvinceCombo"), RadComboBox)
            ProvinceCombo.AutoPostBack = True
 
            AddHandler CountryCombo.SelectedIndexChanged, AddressOf CountryCombo_SelectedIndexChanged
            AddHandler ProvinceCombo.SelectedIndexChanged, AddressOf ProvinceCombo_SelectedIndexChanged
 
        End If
 
        If TypeOf e.Item Is RadListViewInsertItem Then
 
            Dim editItem As RadListViewEditableItem = DirectCast(e.Item, RadListViewEditableItem)
            Dim CountryCombo As RadComboBox = DirectCast(editItem.FindControl("CountryCombo"), RadComboBox)
 
            LoadCountries(CountryCombo)
            SetComboBoxDefault(43, CountryCombo, "Country")
 
            'Dim ComboBoxItem As RadComboBoxItem = CountryCombo.FindItemByValue(43)
            'ComboBoxItem.Selected = True
 
        End If
 
    End Sub
 Private Sub RecipientOrganizationView_ItemDataBound(sender As Object, e As Telerik.Web.UI.RadListViewItemEventArgs) Handles RecipientOrganizationView.ItemDataBound
 
        If TypeOf e.Item Is RadListViewEditableItem AndAlso e.Item.IsInEditMode Then
 
            Dim item As RadListViewDataItem = TryCast(e.Item, RadListViewDataItem)
            Dim CountryId As String = CType(DataBinder.Eval(item.DataItem, "CountryId"), String)
            Dim ProvinceId As String = CType(DataBinder.Eval(item.DataItem, "ProvinceId"), String)
            Dim CityId As String = CType(DataBinder.Eval(item.DataItem, "CityId"), String)
 
            Dim CountryCombo As RadComboBox = CType(e.Item.FindControl("CountryCombo"), RadComboBox)
            LoadCountries(CountryCombo)
            If CountryId IsNot Nothing Then
                Dim ComboBoxItem As RadComboBoxItem = CountryCombo.FindItemByValue(CountryId)
                ComboBoxItem.Selected = True
            End If
 
            Dim ProvinceCombo As RadComboBox = CType(e.Item.FindControl("ProvinceCombo"), RadComboBox)
            LoadProvinces(CountryId, ProvinceCombo)
            If ProvinceId IsNot Nothing Then
                Dim ComboBoxItem As RadComboBoxItem = ProvinceCombo.FindItemByValue(ProvinceId)
                ComboBoxItem.Selected = True
            End If
 
            Dim CityCombo As RadComboBox = CType(e.Item.FindControl("CityCombo"), RadComboBox)
            LoadCities(ProvinceId, CityCombo)
            If CityId IsNot Nothing Then
                Dim ComboBoxItem As RadComboBoxItem = CityCombo.FindItemByValue(CityId)
                ComboBoxItem.Selected = True
            End If
 
        End If
 
 
    End Sub
    Private Sub RecipientOrganizationView_NeedDataSource(sender As Object, e As Telerik.Web.UI.RadListViewNeedDataSourceEventArgs) Handles RecipientOrganizationView.NeedDataSource
 
        Dim repository As New DataEntities
        RecipientOrganizationView.DataSource = repository.RecipientOrganizations.Where(Function(x) x.RecipientOrganizationID = recipientOrganizationID).ToList
 
    End Sub
 
Public Sub CountryCombo_SelectedIndexChanged(ByVal sender As Object, ByVal e As RadComboBoxSelectedIndexChangedEventArgs)
 
        Dim btn = CType(sender, RadComboBox)
        Dim item = CType(btn.NamingContainer, RadListViewEditableItem)
        Dim Combo As RadComboBox = CType(item.FindControl("ProvinceCombo"), RadComboBox)
 
        Combo.ClearSelection()
        LoadProvinces(e.Value, Combo)
 
    End Sub
Protected Sub LoadCountries(ByVal Control As RadComboBox)
 
        Using context As New DataEntities
            With Control
                .DataValueField = "CountryId"
                .DataTextField = "CountryName"
                .DataSource = context.Countries.OrderBy(Function(x) x.CountryName).ToList
            End With
            Control.Width = Unit.Pixel(225)
            Control.DataBind()
        End Using
 
    End Sub
   ''' <summary>
    ''' Checks to see of the Provice/State or Country combox should have Preselected data, otherwise Default Data is Presented
    ''' </summary>
    ''' <param name="FindItemByValue"></param>
    ''' <param name="Control"></param>
    ''' <param name="DisplayText"></param>
    Public Sub SetComboBoxDefault(ByVal FindItemByValue As Integer, ByVal Control As RadComboBox, ByVal DisplayText As String)
 
        Dim ComboBoxItem As RadComboBoxItem
 
        If FindItemByValue > 0 Then
            ComboBoxItem = Control.FindItemByValue(FindItemByValue)
            If ComboBoxItem IsNot Nothing Then
                ComboBoxItem.Selected = True
            Else
                Control.Items.Insert(0, New RadComboBoxItem("-- Please select a " & DisplayText & " --", String.Empty))
            End If
        Else
            Control.Items.Insert(0, New RadComboBoxItem("-- Please select a " & DisplayText & " --", String.Empty))
        End If
 
    End Sub




Nencho
Telerik team
 answered on 23 Oct 2012
1 answer
75 views
Hello,

I'm looking for some advice on where to start debugging an issue.  It's a little weird, and we can't reproduce it in out environments, but our customer is reporting it, and it's becoming a big deal for them.  So this is more of a consultation rather than a complaint or a bug report.. So this is the issue: they're using a TreeView-based control, and the tree view is configured to use Load on Demand with LazyLoad.  The client response time is taking 3-5 seconds, and there's not that much data coming back.  I know this isn't much information, but any pointers on where to start looking would be much appreciated.

Thank you!

Dasha.
Boyan Dimitrov
Telerik team
 answered on 23 Oct 2012
1 answer
251 views


I posted this originally on this thread Save to File but haven't gotten any replies for a few days, so maybe that thread isn't being looked at, so I'm reposting here.

I'm using RadControls for ASP.NET AJAX Q2 2012 SP2

I'm using the described method to export to excel file, and it seems to work if I'm exporting a single grid. However, In my case I have three grids and I need to export all three to seperate excel files, then continue to do some additional processing after the exports are completed.

When I attempt to export mutliple excel files one after the other, none of the exports work. NO errors, NO nothing, see code excerpts below.

In addition, is there any way to suppress the open/save dialog when writing the exported file to disk, other than
Response.Redirect(Request.Url.ToString())

The issue seems to be with exporting multiple grids back to back.

I've also tried firing the Export Command from codebehind, the grids ItemCommand runs, but GridExporting doesn't.
Dim GCI As Telerik.Web.UI.GridCommandItem = CType(Me.rgSummary.MasterTableView.GetItems(Telerik.Web.UI.GridItemType.CommandItem)(0), Telerik.Web.UI.GridCommandItem)
  
GCI.FireCommandEvent("EXPORTTOEXCEL", String.Empty)


Any help would be appreciated.


Protected Sub btnExport_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExport.Click
Me.rgSummary.Rebind()
Me.rgSummary.ExportSettings.FileName = "Fantastic_Invoice_Summary_" + Format(Now, "MM_dd_yyyy_hh_mm_tt")
Me.rgSummary.ExportSettings.OpenInNewWindow = False
Me.rgSummary.MasterTableView.ExportToExcel()
'If I exit sub here, I'll get the summary excel file.
Me.rgDetail.Rebind()
Me.rgDetail.ExportSettings.FileName = "Fantastic_Invoice_Detail_" + Format(Now, "MM_dd_yyyy_hh_mm_tt")
Me.rgDetail.ExportSettings.OpenInNewWindow = False
Me.rgDetail.MasterTableView.ExportToExcel()
'I get neither file if I don't exit after the summary export
Me.rgCommission.Rebind()
If Me.rgCommission.Items.Count <> 0 Then
Me.rgCommission.ExportSettings.FileName = "Fantastic_Invoice_Commission_" + Format(Now, "MM_dd_yyyy_hh_mm_tt")
Me.rgCommission.ExportSettings.OpenInNewWindow = False
Me.rgCommission.MasterTableView.ExportToExcel()
End If
'Additional processing below
end sub
Private Sub rgSummary_GridExporting(sender As Object, e As Telerik.Web.UI.GridExportingArgs) Handles rgSummary.GridExporting
Dim fs As System.IO.FileStream
Dim FileName As String = Server.MapPath("~/Temp/") + Me.rgSummary.ExportSettings.FileName + "." + Me.rgSummary.ExportSettings.Excel.FileExtension
fs = System.IO.File.Create(FileName)
'Dim output As Byte() = Encoding.GetEncoding(1252).GetBytes(e.ExportOutput)
Dim output As Byte() = System.Text.Encoding.Default.GetBytes(e.ExportOutput)
fs.Write(output, 0, output.Length)
fs.Close()
End Sub
Kostadin
Telerik team
 answered on 23 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?