Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
126 views

So I have a grid inside an asp update panel. I have a dropdown list with differnet cultutres on the master page. In the need data source event handler for the grid, I check the value of the dropdown like so

    Protected Sub grid_NeedDataSource(ByVal sender As Object, ByVal e As GridNeedDataSourceEventArgs) Handles grid.NeedDataSource
        PopulateGrid(False)
        Dim ddl As New DropDownList()
        Dim strLanguage As String
        ddl = CType(Me.Master.FindControl("ddlLanguage"), DropDownList)
        strLanguage = ddl.SelectedValue
        If strLanguage Is Nothing Or strLanguage.Length = 0 Then
            strLanguage = "en-US"
        End If
        Dim newCulture As CultureInfo = CultureInfo.CreateSpecificCulture(strLanguage)
        gridVirtualPoints.Culture = newCulture
    End Sub

Here is the PopulateGrid method called in the first line of the above method

    Private Sub PopulateGrid(ByVal reload As Boolean)
        If CurrentUser.isAdmin Or CurrentUser.isParent Then
            Dim Customers = dal.SelectCustomersByCustomerID(CurrentCustomer.CustomerID)
            Dim CustomerIDs As New List(Of String)

            For Each Customer As Customer In Customers
                If Not Customer Is Nothing Then
                    CustomerIDs.Add(Customer.CustomerID)
                End If
            Next
        //this just gets the data from the database
            grid.DataSource = dal.getgriddata(CustomerIDs)
        Else
            grid.DataSource = dal.getgriddata(CurrentUser.UserID)
        End If

        If reload Then
            grid.DataBind()
        End If
    End Sub

 

When I change the dropdown from the masterpage to a different language, it changes all the other values in the resx file except the page text. The really weird part is, if I change the dropdown value again it then updates the pager text to what it should have been the first time. So in other words

1. change from english to french. All the text from the resx file EXCEPT the PagerText changes.

2. Change back to English. All the text from the english rex file change correctly, and the pagertext now changes to the french pager text from the resx file. 

Could this have something to do with the asp update panel?

Konstantin Dikov
Telerik team
 answered on 22 Jul 2016
14 answers
421 views

Hi,

i have tried the link manager on RadEditor and got it to work for uploading the document into local file system when user tried to create a download link.

i would like to check how do i preform the same action but the document is to be upload to SharePoint document library

current mockup

1.<telerik:RadEditor ID="txtOverview" runat="server" ToolsFile="~/ToolsFile.xml" EditModes="Design">
2.         <DocumentManager ViewPaths="~/Documents" UploadPaths="~/Documents" />
3.</telerik:RadEditor>

Marin Bratanov
Telerik team
 answered on 22 Jul 2016
1 answer
177 views

If a page has no other controls except a grid with the add new record command, whenever a user presses enter they get the insert behavior - even if they're in the middle of editing a record. It's confusing and annoying if you have a grid configured for modal, popup edits - and you press enter while editing. RadGrid launches a 2nd insert popup on top of the edit popup.

How can I prevent the add new button from behaving like a default button?

Thanks!

Vasil
Telerik team
 answered on 22 Jul 2016
1 answer
172 views

I need to allow the user to select / remove columns which will be stored and displayed in a custom report. What would be the best Telerik control to start with to create this functionality? I am aware of the RadWizard, which can take them step by step in a 'custom' generation scenario.

However, I also need to create a UI which allows the user to select and remove fields, and save the selections. I have attached a screenshot of what I am looking for. Any help / directions as far as the best controls to start with would be much appreciated. Thanks!

Ivan Danchev
Telerik team
 answered on 22 Jul 2016
3 answers
171 views

i have set the externaldialogpath for my editor but it seems that it is still taking the old dialog code.

i have confirm the path to the dialog is correct

the code is a custom web part for sharepoint 2013

 

<telerik:RadEditor ID="RadEditor1" runat="server" ExternalDialogsPath="/inetpub/wwwroot/wss/VirtualDirectories/siteproject/externalFiles/TelerikEditorDialogs/" DialogHandlerUrl="~/Telerik.Web.UI.DialogHandler.axd"  OnClientLoad="OnClientLoad">
</telerik:RadEditor>

Vessy
Telerik team
 answered on 22 Jul 2016
3 answers
244 views
Hi all,

I am attempting to maintain the position of a RadSplitBar on postback. I am able to maintain -a- position, but am having trouble progressing it further than that.

My understanding is this:

When the RadSplitBar is moved it's related RadPane's are resized. Therefore, I would like to capture the RadPane's resize event. Unfortunately, there is no server side handling of this by default. So, I must capture OnClientResized events. This puts me off into client-side javascripting, though...and writing to Session isn't a simplistic procedure.

Is there a simple way to run some server-side code after capturing the OnClientResized event?

Ideally, it would be something like this:

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server" >
    <script type="text/javascript">
        function OnClientResized(pane, arg) {
            pane.SaveState();
         
    </script>
</telerik:RadCodeBlock>

Where SaveState is server-side code I have written to record the pane's height and width to Session. Should I be looking into AJAX for this functionality? 

EDIT: (Disclaimer: This won't be very pretty.) I managed to do this, but it's quite the workaround. If you guys have any better ideas it would be appreciated.

Here's the gist of it:

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server" >
    <script type="text/javascript">
 
        function OnClientResized(pane, args) {
            var context = new Object();
            var paneIDandHeight = pane.get_id() + ',' + pane.get_height();
            //Context is just thrown away.
            CallSetDimensions(paneIDandHeight, context);
        }
 
        function CallbackOnSucceeded(result, context) {
        //Logging
        }
 
        function CallbackOnFailed(result, context) {
        //Logging
        }
    </script>
</telerik:RadCodeBlock>


public partial class _Default : System.Web.UI.Page, ICallbackEventHandler
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            RegisterCallBackReference();
        }
 
        private void RegisterCallBackReference()
        {
            //Target: The name of a server Control that handles the client callback.
            //Argument: An argument passed from the client script to the server.
            //clientCallback: The name of the client event handler that receives the result of success.
            //context: Client script that is evaluated on the client prior to initating the callback.
            //clientErrorCallback: The name of the client event handler that handles an error.
            //useAsync: True/False asynchronous postback.
 
            String callBack = Page.ClientScript.GetCallbackEventReference(this, "arg", "CallbackOnSucceeded", "context", "CallbackOnFailed", true);
 
            String clientFunction = "function CallSetDimensions(arg, context){ " + callBack + "; }";
 
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "Call To Server", clientFunction, true);
        }
 
        #region ICallbackEventHandler Members
        String returnValue;
        string ICallbackEventHandler.GetCallbackResult()
        {
            return returnValue;
        }
 
        void ICallbackEventHandler.RaiseCallbackEvent(string eventArgument)
        {
            bool result = SetDimensions(eventArgument);
 
            if (result)
            {
                returnValue = "Success.";
            }
            else
            {
                returnValue = "Failure.";
            }
        }
        #endregion
 
        private bool SetDimensions(string args)
        {
            bool saveSuccessful = false;
 
            string[] paneIDandHeight = args.Split(',');
            string paneID = paneIDandHeight[0];
            string paneHeight = paneIDandHeight[1];
            RadPane pane = Utilities.FindControlRecursive(Page, paneID) as RadPane;
            int height = 0;
 
            int.TryParse(paneHeight, out height);
 
            if (!object.Equals(pane, null))
            {
                saveSuccessful = true;
                RadPaneSetting paneSetting = RadPaneSetting.GetSettings(pane);
                pane.Height = new Unit(height, UnitType.Pixel);
                SavePane(pane);
            }
 
            return saveSuccessful;
        }
    }

This code won't compile if you just copy/paste it, I'm using a lot of other helper functions, but if you're stuck with this problem this would be a good place to start. From here you'll need to look up the demo example on persisting state in session.

Jorge
Top achievements
Rank 1
 answered on 21 Jul 2016
4 answers
376 views
Hi All,

I am using the radchat on some pages. On development environment it work fine, but on production it is showing "Error loading RadChart image. You may also wish to check the ASP.NET Trace for further details.\Display stack trace"  in alert. If i click Cancel then it show the page with-ought the chart.

First it was showing permission issue on the temp folder, i have assigned full control to everyone on temp folder. Now i am getting this alert. I have set  UseSession=false.

IIS 7.5
ASP.NET 4.0 
Telerik Version:- 2012.1.411.40

Please let me solution ASAP, because it is on production issue.

Thanks
Satish
Top achievements
Rank 1
 answered on 21 Jul 2016
2 answers
698 views

I have an ASP.Net page that uses the ProgressBar when user clicks on EXPORT button to export data to an Excel (.xlsx) file.  It works great.

Now the question is that is there a way to use that ProgressBar or the ProgressArea when executing a long running SQL statement?

When the user clicks on the EXPORT button, the VB code-behind looks at the RadRadioButtonList to determine which was selected and run the appropriate Export process.  The RadRadioButtonList has EXCEL, PDF, and TABLE.  When EXCEL is selected, the ProgressBar is used to show progress of exporting data to an Excel file.  Exporting to PDF does not use the ProgressBar.  I would like to have a way to show the ProgressBar or use the ProgressArea when exporting to a TABLE which basically means it using the SQL INSERT statement to insert records from a SELECT statement into another table.

Please help!

Thanks!

Sincerely,

Keith Jackson

Keith
Top achievements
Rank 1
 answered on 21 Jul 2016
1 answer
276 views
I apologize for cross posting but couldn't decide what made the most sense :(

I need to run a couple of discrete stored proc when I do my update from a grid.  I need to check if the combobox selection indicates a change to one field and if so execute etc.
I can't for the life of me figure out how to get that value, I tried an selectedindexchanged event and that doesn't seem to work either. I'd be very grateful for a nudge in the right direction as I'm veryyyyyyyyyy rusty :(

Here's what I tried most recently:

protected void RadGrid1_UpdateCommand(object source, GridCommandEventArgs e)
{

if (e.CommandName == "Update")
{


GridEditableItem item = (GridEditableItem)e.Item;
RadComboBox combo =(RadComboBox)item.FindControl("updateComboBox");
var status = (string)item.GetDataKeyValue("status");
if (combo.SelectedItem.Text!= status)
{
 // Do my update...
}
Peter Milchev
Telerik team
 answered on 21 Jul 2016
1 answer
328 views

i received the error about Telerik dialog require http handlers in web.config.

i have added the following to my web config

previously i was developing as a asp.net web application and i did not have this issue.

after integrating the ascx file which contain the Editor control into Sharepoint 2013 as a custom web part, i encounter this issue

01.<system.web>
02.    <httpHandlers>
03.      <add path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" verb="*" validate="false" />
04.      <add path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" validate="false" />
05.      <add path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" validate="false" />
06.    </httpHandlers>
07.</system.web>
08.  <system.webServer>
09.<handlers>
10.<remove name="Telerik_Web_UI_WebResource_axd" />
11.      <remove name="Telerik_Web_UI_SpellCheckHandler_axd" />
12.      <remove name="Telerik_Web_UI_DialogHandler_aspx" />
13.      <remove name="Telerik_RadUploadProgressHandler_ashx" />
14.<remove name="ChartImage_axd" />
15.      <!-- This is the primary handler used to fetch most of the needed resources -->
16.      <add name="Telerik_Web_UI_WebResource_axd" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" verb="*" preCondition="integratedMode" />
17.      <!-- Only needed for RadSpell and RadEditor's spell checking -->
18.      <add name="Telerik_Web_UI_SpellCheckHandler_axd" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" verb="*" preCondition="integratedMode" />
19.      <!-- Only needed for controls that have complex dialogs like RadEditor, RadImageEditor -->
20.      <add name="Telerik_Web_UI_DialogHandler_aspx" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" />
21.      <!-- Only needed if RadAsyncUpload, RadProgressArea/RadProgressManager or the obsolete RadUpload are used -->
22.      <add name="Telerik_RadUploadProgressHandler_ashx" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler" verb="*" preCondition="integratedMode" />
23.      <!-- Only needed if the obsolete RadChart control is used -->
24.      <add name="ChartImage_axd" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" verb="*" preCondition="integratedMode" />
25.</handlers>
26.  </system.webServer>

Vessy
Telerik team
 answered on 21 Jul 2016
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?