Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
500 views
Attached is an example (with sensitive data removed).

We want to simply disable it the quickest way possible when a page loads.

If that means simply disabling the save button that would be enough.

A lot of examples here involve javascript.  If possible we want to avoid javascript for security reasons and use a server side solution.
Shinu
Top achievements
Rank 2
 answered on 02 Apr 2014
2 answers
155 views
Hi There,

What I'm trying to achieve looks pretty simple and works well with GridViews, but for some reason I just can't get it to work with a ListView control.

Here's what I'm doing :

On my default.aspx page I have an aspPanel, with a RadAjaxManager. Within that panle I dynamically load usercontrols such as the ones embedding the RadGridView mentioned earlier. When I click on a GridItem from those GridView to download some file, obviously I need to prevent this to happen through an Ajax request to make it work.
Hence, my js handler ClientEvents-OnRequestStart="requestsStart" and my js function looks like the following:

1.function requestsStart(ajaxManager, eventArgs) {
2.    console.log("test : " + eventArgs.get_eventTarget());
3.    if (eventArgs.get_eventTarget().indexOf("Download") != -1) {
4.        eventArgs.set_enableAjax(false);
5.    }
6.}

As I said everything works fine from my GridViews. here my usercontrol code that embeds the ListView :

01.<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="feature-doc-download.ascx.cs"
02.    Inherits="NRP.Study.usercontrols.feature_doc_download" %>
03.<link href="css/feature-doc-download.css" rel="stylesheet" type="text/css" />
04.<telerik:RadListView ID="RlvListDocuments" runat="server" OnNeedDataSource="RlvListDocuments_NeedDataSource"
05.    DataKeyNames="ID" ItemPlaceholderID="IPListDocuments" OnItemCommand="RlvListDocuments_ItemCommand"
06.    AllowPaging="true" PageSize="12">
07.    <LayoutTemplate>
08.        <table>
09.            <tr>
10.                <td>
11.                    <asp:PlaceHolder ID="IPListDocuments" runat="server"></asp:PlaceHolder>
12.                </td>
13.            </tr>
14.            <tr>
15.                <td>
16.                    <telerik:RadDataPager ID="RadDataPager1" runat="server" PagedControlID="RlvListDocuments"
17.                        PageSize="12">
18.                        <Fields>
19.                            <telerik:RadDataPagerButtonField FieldType="FirstPrev"></telerik:RadDataPagerButtonField>
20.                            <telerik:RadDataPagerButtonField FieldType="Numeric"></telerik:RadDataPagerButtonField>
21.                            <telerik:RadDataPagerButtonField FieldType="NextLast"></telerik:RadDataPagerButtonField>
22.                        </Fields>
23.                    </telerik:RadDataPager>
24.                </td>
25.            </tr>
26.        </table>
27.    </LayoutTemplate>
28.    <ItemTemplate>
29.        <asp:LinkButton ID="BtnDownload" runat="server" CommandName="Download" CommandArgument='<%#Eval("ID") %>'>
30.                    <div class="docTile">
31.                    <table>
32.                        <tr>
33.                            <td rowspan="2">
34.                                <div class="iconWrapper">
35.                                    <img src='<%#Eval("IconUrlLarge") %>' alt='' class="docTypeIcon" />
36.                                </div>
37.                            </td>
38.                            <td class="fileName">
39.                                <%#Eval("FileName") %>
40.                            </td>
41.                        </tr>
42.                        <tr>
43.                            <td class="Comment">
44.                                <%#Eval("Comment") %>
45.                            </td>
46.                        </tr>
47.                    </table>
48.                </div>
49.        </asp:LinkButton>
50.    </ItemTemplate>
51.    <AlternatingItemTemplate>
52.        <asp:LinkButton ID="BtnDownload" runat="server" CommandName="Download" CommandArgument='<%#Eval("ID") %>'>
53.                    <div class="docTile">
54.                    <table>
55.                        <tr>
56.                            <td rowspan="2">
57.                                <div class="iconWrapper">
58.                                    <img src='<%#Eval("IconUrlLarge") %>' alt='' class="docTypeIcon" />
59.                                </div>
60.                            </td>
61.                            <td class="fileName">
62.                                <%#Eval("FileName") %>
63.                            </td>
64.                        </tr>
65.                        <tr>
66.                            <td class="Comment">
67.                                <%#Eval("Comment") %>
68.                            </td>
69.                        </tr>
70.                    </table>
71.                </div>
72.        </asp:LinkButton>
73.    </AlternatingItemTemplate>
74.    <EmptyDataTemplate>
75.    </EmptyDataTemplate>
76.</telerik:RadListView>

When I click on any item, it does not even display the console.log('test' + blablabla) that is in my js requestStart function. It's like it doesn't care about the AjaxManager.
I tried to specifically indicate those controls to the RadAjaxMgr a below but even then it never enter my js function:

01.<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest" ClientEvents-OnRequestStart="requestsStart">
02.    <AjaxSettings>
03.       <telerik:AjaxSetting AjaxControlID="RlvListDocuments">
04.            <UpdatedControls>
05.                <telerik:AjaxUpdatedControl ControlID="RlvListDocuments" />
06.            </UpdatedControls>
07.        </telerik:AjaxSetting>
08.    </AjaxSettings>
09.</telerik:RadAjaxManager>

And then I end up with the following error message that makes it obvious my request was ajaxified by the manager :

"Sys.WebForms.PageRequestManagerParserErrorException: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

Details: Error parsing near '%PDF-1.5

%����

1 0'.
"

Idea ?

Cheers, 

Chris
Christophe
Top achievements
Rank 1
 answered on 01 Apr 2014
2 answers
164 views
I have referenced the following code for saving grid settings for users
http://www.telerik.com/help/aspnet-ajax/grid-saving-settings-on-per-user-basis.html

All works well. However, when saving the object for grouping settings your page above suggests the following code:

Protected Overridable Sub SaveGroupByExpressions()          
  Settings.GroupByExpressionsStates =
New Object(Grid.MasterTableView.GroupByExpressions.Count) {}           
  Dim i As Integer = 0           
  While i < Settings.GroupByExpressionsStates.Length             
    Settings.GroupByExpressionsStates(i) =(
DirectCast(Grid.MasterTableView.GroupByExpressions(i),IStateManager)).SaveViewState()                               System.Math.Max(System.Threading.Interlocked.Increment(i), i - 1)
   
End While       
End Sub

In the while statement the i variable is used for both the GroupByExpressionsStates index and the GroupByExpressions index.
If only one GroupBy expression is selected by the user, then the GroupByExpressions.Count  = 1 and the the object length = 2.
When going through the loop, it fails because once past the first index of 0, there is no group expression for Grid.MasterTableView.GroupByExpressions(1).

I'm trying to figure out why the empty object created by the statement:
Settings.GroupByExpressionsStates = New Object(Grid.MasterTableView.GroupByExpressions.Count) {}
is creating a Settings.GroupByExpressionsStates object with 2 empty arrays when only 1 is needed for this example?

Please see the attachments.
Patrice
Top achievements
Rank 1
 answered on 01 Apr 2014
3 answers
207 views
I have a requirement of hiding GridBoundColumn  if it does not have any value for any row.
Does RadGrid have any property to know that specific column has any value or not?
Chad
Top achievements
Rank 1
 answered on 01 Apr 2014
2 answers
228 views
I'm evaluating an upgrade to the latest 2014 Q1 libs for the ASP.NET Ajax controls. I get this javascript error in both IE11 and Chrome. I've got a lot of stuff going on on this page, RadTreeViewControl, RadSpliter, RadGrid, RadTimePicker, RadScriptManager, RadAjaxManager, etc... I thoughtab I'd post this and see if I can get lucky about finding a solution before stripping the page down to figure out what's going on. This error occurs when I click on an item in the RadTreeViewControl.

Uncaught SyntaxError: An invalid or illegal string was specified. Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_MainContent_RadScriptManager11_TSM&compress=…:5369
Telerik.Web.UI.RadAjaxControl.updateHeadStyles Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_MainContent_RadScriptManager11_TSM&compress=…:5369
Telerik.Web.UI.RadAjaxControl.set_styles Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl00_MainContent_RadScriptManager11_TSM&compress=…:5168

The full exception is attached.

--Mark
marksweat
Top achievements
Rank 1
 answered on 01 Apr 2014
4 answers
1.5K+ views
Hi,
I want to use the radgrid control to create a filter functionality for my project.
Each row in radgrid should have two columns one with a radcombobox and another with a textbox. On the button  click the user can add more rows with same structure preserving the previous selections, user can add n number of rows.
Once the user has add all the required filter rows, they apply that filter, this triggers a postback event. I need to preserve the state of the radgrid with all the filters (rows).

Is this possible, any starting ideas to it?

Thank you,
Jay Mehta.
NLNG
Top achievements
Rank 1
 answered on 01 Apr 2014
3 answers
79 views
Is there any way to be selective about what is persisted?

Example - I want to persist what columns are visible in a radGrid - but I don't want to persist the page the user is currently viewing.
Daniel
Telerik team
 answered on 01 Apr 2014
2 answers
101 views
Column Chart

I am working through the drill down chart example and all is great, but I want is to show the title of the product in the 'DataLabelsField' but pass the productID value when I click the column. 

I'm passing the value client side 
function OnClientSeriesClicked(sender, args) {
                  if (args.get_seriesName() != "Orders") $find("<%= rapD.ClientID %>").ajaxRequest(args.get_category());
              }

My SQLDataSource has productID, ProductName and a count field.

I've been searching for ages now but can't find a solution to what must be simple.

Cheers,

Jon
Jon
Top achievements
Rank 1
 answered on 01 Apr 2014
7 answers
310 views
I'm getting this run time error:

Could not load file or assembly 'Telerik.Web.UI, Version=2011.2.915.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)

Can you give an update tutorial and help me solve the above problem. I can't find references to the old assembly in my project or in the GAC.

Thanks in advance.
Kate
Telerik team
 answered on 01 Apr 2014
1 answer
239 views
Hello everyone,

I've got a RadTabStrip and a RadMultiPage that both work together on one page and are supposed to toggled between pages, depending on certain events and conditions.

My issue is that when i set them up, I can get the GoToNextTab() and GoToNextPageView() events to work when called on my first User Control (Step 1) but when attempting to call the method from my second User Control, the methods are unresponsive.

Here are theTabStrip and MultiPage controls on the default.aspx web form...

<!--Navigation Strip Menu-->
<telerik:RadTabStrip ID="BillPayNavigationRadTabStrip" SelectedIndex="0" runat="server" MultiPageID="BillPayRadMultiPage" Align="Justify"
    Skin="Silk" CssClass="tabStrip" CausesValidation="false">
</telerik:RadTabStrip>
 
<!-- MultiPage  -->
<telerik:RadMultiPage ID="BillPayRadMultiPage" runat="server" SelectedIndex="0" OnPageViewCreated="BillPayRadMultiPage_PageViewCreated"
    CssClass="multiPage" BorderWidth="1" BorderColor="#888888">
</telerik:RadMultiPage>


default.aspx code behind...

protected void Page_Load(object sender, EventArgs e)
{
    // Make sure we begin at Step 1 and disable the rest when the site loads for the first time.
    if (!Page.IsPostBack)
    {
        AddTab("Bill", true);
 
        RadPageView pageView = new RadPageView();
        pageView.ID = "Bill";
        BillPayRadMultiPage.PageViews.Add(pageView);
 
        AddTab("Provider", false);
        AddTab("Payment", false);
        AddTab("Confirmation", false);
        AddTab("Receipt", false);
    }
}
 
#region Navigation TabStrip and MultiPage handlers
 
// This method adds the tabs to our Navigation TabStrip and assigns an appropriate background image
private void AddTab(string tabName, bool enabled)
{
    RadTab tab = new RadTab(tabName);
    tab.Enabled = enabled;
 
    switch (tab.Text)
    {
        case "Bill":
            tab.SelectedImageUrl = "Images/1_active.png";
            tab.ImageUrl = "Images/1_normal.png";
            break;
        case "Provider":
            tab.ImageUrl = "Images/2_normal.png";
            tab.SelectedImageUrl = "Images/2_active.png";
            tab.DisabledImageUrl = "Images/2_disable.png";
            break;
        case "Payment":
            tab.ImageUrl = "Images/3_normal.png";
            tab.SelectedImageUrl = "Images/3_active.png";
            tab.DisabledImageUrl = "Images/3_disable.png";
            break;
        case "Confirmation":
            tab.ImageUrl = "Images/4_normal.png";
            tab.SelectedImageUrl = "Images/4_active.png";
            tab.DisabledImageUrl = "Images/4_disable.png";
            break;
        case "Receipt":
            tab.ImageUrl = "Images/5_normal.png";
            tab.SelectedImageUrl = "Images/5_active.png";
            tab.DisabledImageUrl = "Images/5_disable.png";
            break;
        default:
            break;
    }
 
    BillPayNavigationRadTabStrip.Tabs.Add(tab);
}
 
// When the MultiPage control loads, look in the controls folder for each step page
protected void BillPayRadMultiPage_PageViewCreated(object sender, RadMultiPageEventArgs control)
{
    Control pageViewContents = LoadControl("controls/" + control.PageView.ID + ".ascx");
    pageViewContents.ID = control.PageView.ID + "userControl";
    control.PageView.Controls.Add(pageViewContents);
}
 
#endregion


User Control 1 methods (these work)...
       protected void MedicBillTypeImage_Click(object sender, ImageClickEventArgs e)
       {
           Session["ProviderBillType"] = "medic";
           Session["PaymentStep"] = "2";
           GoToNextTab();
           GoToNextPageView();
       }
 
#region Next Tab
        
       // Find and select the next Tab on our Navigation TabStrip
       private void GoToNextTab()
       {
           RadTabStrip tabStrip = (RadTabStrip)this.NamingContainer.FindControl("BillPayNavigationRadTabStrip");
           RadTab providerTab = tabStrip.FindTabByText("Provider");
           providerTab.Enabled = true;
           providerTab.Selected = true;
            
           RadTab paymentTab = tabStrip.FindTabByText("Payment");
           RadTab confirmationTab = tabStrip.FindTabByText("Confirmation");
           RadTab receiptTab = tabStrip.FindTabByText("Receipt");
           paymentTab.Enabled = confirmationTab.Enabled = receiptTab.Enabled = false;
       }
        
       #endregion
        
       #region Next Page
        
       //Find and load the next page in our MultiPage control
       private void GoToNextPageView()
       {
           RadMultiPage multiPage = (RadMultiPage)this.NamingContainer.FindControl("BillPayRadMultiPage");
           RadPageView providerPageView = multiPage.FindPageViewByID("Provider");
           if (providerPageView == null)
           {
               providerPageView = new RadPageView();
               providerPageView.ID = "Provider";
               multiPage.PageViews.Add(providerPageView);
           }
           providerPageView.Selected = true;
       }
        
       #endregion


User Control 2 Button Click event that calls methods, depending on conditions...
protected void Step2SubmitButton_Click(object sender, EventArgs e)
        {
            bool failed = false;
            string providerCode = string.Empty;
            try
            {
                if (Session["ProviderBillType"].ToString() == "medic")
                {
                    if (MedicProviderOfServiceTextBox.Text != null)
                    {
                        providerCode = MedicProviderOfServiceTextBox.Text;
                        if (providerCode != null)
                        {
                            ConfirmProviderNameLabel.Text = CompanyNameByPC.GetCompanyNameByProviderCode(providerCode);
 
                            Step2ConfirmProviderPanel.Visible = true;
                        }
                        else
                        {
                            Step2ConfirmProviderPanel.Visible = false;
                        }
                    }
 
                    // did the user enter a provider code but not check the confirmation box?
                    if (!ConfirmProviderCheckbox.Checked)
                    {
                        failed = true;
                        UserMessageRadWindowManager.RadAlert("You must confirm your Provider before proceeding.", 330, 180, "Submission Error", "");
                    }
 
                    // if we failed then bail
                    if (failed)
                    {
                        return;
                    }
 
                    // we passed.  is the company using this new payment processor?  if not, redirect to
                    // the old payment page else set vars and move on.
                    if (!NppCheck.IsCompanyUsingNewPaymentProcessor(providerCode))
                    {
                        Session["ProviderCode"] = providerCode;
                        Session["PaymentStep"] = 1;
                        Response.Redirect("default2.aspx");
                        //Response.Redirect("https://www.qmacsmso.com/billpay.aspx?pc=" + providerCode + "&bt=" + Session["ProviderBillType"].ToString(), true);
                        return;
                    }
                    Session["ProviderName"] = ConfirmProviderNameLabel.Text;
                    Session["ProviderCode"] = providerCode;
 
                    // Go to the next PageView
                    GoToNextTab();
                    GoToNextPageView();
                }
                else if (Session["ProviderBillType"].ToString() == "myway")
                {
// The rest of the code follows the same pattern with "if else statements"
// I've replaced the methods here with a simple popup window for testing and I've also replaced the method code with //  another popup to see if it is being called. Somehow, my NextTab and NextPage methods are unresponsive.

User Control 2 Methods...

#region Next Tab
 
// Find and select the next Tab on our Navigation TabStrip
private void GoToNextTab()
{
    RadTabStrip tabStrip = (RadTabStrip)this.NamingContainer.FindControl("BillPayNavigationRadTabStrip");
    RadTab paymentTab = tabStrip.FindTabByText("Payment");
    paymentTab.Enabled = true;
    paymentTab.Selected = true;
}
 
#endregion
 
#region Next Page
 
//Find and load the next page in our MultiPage control
private void GoToNextPageView()
{
    RadMultiPage multiPage = (RadMultiPage)this.NamingContainer.FindControl("BillPayRadMultiPage");
    RadPageView paymentPageView = multiPage.FindPageViewByID("Payment");
    if (paymentPageView == null)
    {
        paymentPageView = new RadPageView();
        paymentPageView.ID = "Payment";
        multiPage.PageViews.Add(paymentPageView);
    }
    paymentPageView.Selected = true;
}
 
#endregion
Cody
Top achievements
Rank 1
 answered on 01 Apr 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?