Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
84 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
59 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
100 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
347 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
122 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
94 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
105 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
59 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
217 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
1 answer
82 views
Hi,
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="btnSubmit">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="gvStaff" LoadingPanelID="RadAjaxLoadingPanel1" />
                    <telerik:AjaxUpdatedControl ControlID="panMessage" />
                </UpdatedControls>
            </telerik:AjaxSetting>
            <telerik:AjaxSetting AjaxControlID="gvStaff">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="panMessage" />
                </UpdatedControls>
            </telerik:AjaxSetting>
           
        </AjaxSettings>
</telerik:RadAjaxManager>
 
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Style="position: absolute;
        top: 200px; left: 600px;" IsSticky="True">
        <div class="overlay" id="divProgress" style="position: absolute; visibility: visible;
            vertical-align: middle; border-style: inset; border-color: black; background-color: White;
            width: 200px; height: 100px; font-size: medium;">
            <center>
                <div style="margin-top: 30px;">
                    <asp:Image GenerateEmptyAlternateText="true" ID="imgLoader" runat="server" ImageUrl="~/images/ajax_loading.gif"
                        Style="margin-top: 7px;" />  
                    <asp:Label ID="lblWait" runat="server" Text="Please wait..."></asp:Label>
                </div>
            </center>
        </div>
    </telerik:RadAjaxLoadingPanel>
 
 
<telerik:RadGrid ID="gvStaff" runat="server" AllowPaging="True" AutoGenerateColumns="False"
            CellSpacing="0" GridLines="None" Width="100%" PageSize="20" Visible="False" AllowSorting="true">
            <MasterTableView AllowMultiColumnSorting="true">
                <CommandItemSettings ExportToPdfText="Export to PDF" />
                <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                </RowIndicatorColumn>
                <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridButtonColumn Text="Select" CommandName="Select">
                    </telerik:GridButtonColumn>
                    <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="StaffID"
                        UniqueName="TemplateColumn" SortExpression="StaffID">
                        <ItemTemplate>
                            <asp:Label ID="staffID" runat="server" Text='<%# Bind("StaffID") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Justify" />
                    </telerik:GridTemplateColumn>
                    <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column" HeaderText="Staff Name"
                        UniqueName="TemplateColumn" SortExpression="Name">
                        <ItemTemplate>
                            <asp:Label ID="Name" runat="server" Text='<%# Bind("Name") %>'></asp:Label>
                        </ItemTemplate>
                        <ItemStyle HorizontalAlign="Justify" />
                    </telerik:GridTemplateColumn>
                  </Columns>
                <EditFormSettings>
                    <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                    </EditColumn>
                </EditFormSettings>
            </MasterTableView>
            <HeaderStyle HorizontalAlign="Justify" />
            <FilterMenu EnableImageSprites="False">
            </FilterMenu>
        </telerik:RadGrid>
The radAjaxLoadingPanel not working when the search button is click and the radgrid will display out the result. The loading panel only working when click the submit button second time after the page load. Please help. Thanks.
Eyup
Telerik team
 answered on 23 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?