Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
144 views
Hi

Here's my issue: I ve a button in my content page, on click I want to upload a label in my master page with ajax.

I've read that: http://www.telerik.com/help/aspnet/ajax/ajxmasterpageupdateeverywhere.html 
and tried something like that:

In my content page: 

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load      
           Dim AjaxManager As RadAjaxManager = CType(Me.Master.FindControl("radAjaxManMaster"), RadAjaxManager)
           Dim lbl  As Label = CType(Master.FindControl("myLabel"), Label) 
           AjaxManager.AjaxSettings.AddAjaxSetting(btnAdd, lblCartItemCount, Nothing)   
    End Sub

Protected Sub btnAjouter_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnAdd.Click
    Dim lbl As Label = CType(Me.Master.FindControl("myLabel"), Label)
            lbl.Text = "New value"
End Sub

On the masterpage I ve that: 
 <telerik:RadAjaxManager ID="radAjaxManMaster" runat="server"  DefaultLoadingPanelID="RadAjaxLoadingPanel1">
 </telerik:RadAjaxManager>

<asp:Label id="myLabel"  runat="server"></asp:Label>


The loadingpanel is displayed on my label but it keeps the old value...

What I dont get its that it is rendering page cycle twice (two time page load on master page and contentpage)
...
(When I'm removing the three lines in page load of content page it works as it should (no page event called twice and label is updated but page is postback and no ajax...)) 


Could someone help me?
Iana Tsolova
Telerik team
 answered on 25 May 2012
2 answers
80 views
I am using RadSchedular with tooltips. I am updating RadSchedular with data on button click event. this is post back event.
Everything is working good. Only issue is when it postback events takes time there is no hour glass on RadSchedular.

So I added ajax support to button by adding it to AjaxManager and associating Radschedular to RadAjaxLoading panel.
This solved my issue but it broke my tooltip. ( does not work any more). Please help me to fix that.
I can send my project file. Let me know

If I remove following from RadAjaxmanager- tool tip starts working.
 <AjaxSettings>
<telerik:AjaxSetting AjaxControlID="btnViewUpdate">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="RadScheduler1" LoadingPanelID="RadAjaxLoadingPanel1" />
<telerik:AjaxUpdatedControl ControlID="lblViewName" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
Ashok
Top achievements
Rank 1
 answered on 25 May 2012
14 answers
339 views
Hello,
Below is how I initialize grid and filter

1. Page containing grid:
protected override void Page_Init(object sender, EventArgs e)
        {
            base.Page_Init(sender, e);
            Grid = new RadGrid(); // actually this is not RadGrid but descendant class I created
            Grid.Initialize(ZSheet, ForceLoad, DataSourceProvider, this); // create columns runtime
            ZSheetContainer.Controls.Add(Grid); 
            GridFilter.Initialize(ZSheet, Grid.ZTable.TableNameUser); 
            if (IsPostBack)
                GridFilter.ApplyFilter(); // create and apply filter expressions obtained from different source, see below
        }

2. Create filter expressions and editors:

public void ApplyFilter()
        {
            if (string.IsNullOrWhiteSpace(_hf.Value)) return;
            List<GridFilterItem> filterItems =
                new JavaScriptSerializer().Deserialize<List<GridFilterItem>>(_hf.Value);
            foreach (GridFilterItem item in filterItems)
            {
                ZSheetItem zitem = _table.Structure.FirstOrDefault(t => t.f_name == item.Condition.ColumnID);
                Type columnType = GetColumnType(zitem);
                Type filterExpressionType;
                Type[] types = new[] { columnType };
 
                switch (item.Condition.Operator)
                {
                    case GridKnownFunction.Contains:
                        filterExpressionType = typeof(RadFilterContainsFilterExpression);
                        break;
                    case GridKnownFunction.DoesNotContain:
                        filterExpressionType = typeof(RadFilterDoesNotContainFilterExpression);
                        break;
                    case GridKnownFunction.StartsWith:
                        filterExpressionType = typeof(RadFilterStartsWithFilterExpression);
                        break;
                    case GridKnownFunction.EndsWith:
                        filterExpressionType = typeof(RadFilterEndsWithFilterExpression);
                        break;
                    case GridKnownFunction.EqualTo:
                        filterExpressionType = typeof(RadFilterEqualToFilterExpression<>);
                        break;
                    case GridKnownFunction.NotEqualTo:
                        filterExpressionType = typeof(RadFilterNotEqualToFilterExpression<>);
                        break;
                    case GridKnownFunction.GreaterThan:
                        filterExpressionType = typeof(RadFilterGreaterThanFilterExpression<>);
                        break;
                    case GridKnownFunction.LessThan:
                        filterExpressionType = typeof(RadFilterLessThanFilterExpression<>);
                        break;
                    case GridKnownFunction.GreaterThanOrEqualTo:
                        filterExpressionType = typeof(RadFilterGreaterThanOrEqualToFilterExpression<>);
                        break;
                    case GridKnownFunction.LessThanOrEqualTo:
                        filterExpressionType = typeof(RadFilterLessThanOrEqualToFilterExpression<>);
                        break;
                    case GridKnownFunction.Between:
                        filterExpressionType = typeof(RadFilterBetweenFilterExpression<>);
                        types = new[] { columnType, columnType };
                        break;
                    case GridKnownFunction.NotBetween:
                        filterExpressionType = typeof(RadFilterNotBetweenFilterExpression<>);
                        types = new[] { columnType, columnType };
                        break;
                    case GridKnownFunction.IsEmpty:
                        filterExpressionType = typeof(RadFilterIsEmptyFilterExpression);
                        break;
                    case GridKnownFunction.NotIsEmpty:
                        filterExpressionType = typeof(RadFilterNotIsEmptyFilterExpression);
                        break;
                    case GridKnownFunction.IsNull:
                        filterExpressionType = typeof(RadFilterIsNullFilterExpression);
                        break;
                    case GridKnownFunction.NotIsNull:
                        filterExpressionType = typeof(RadFilterNotIsNullFilterExpression);
                        break;
                    default:
                        filterExpressionType = typeof(RadFilterEqualToFilterExpression<>);
                        break;
                }
 
                Type genericType = filterExpressionType.MakeGenericType(types);
                RadFilterExpression expression = (RadFilterExpression)Activator.CreateInstance(genericType, item.Condition.ColumnID);
                _filter.RootGroup.AddExpression(expression);
             }            
            _filter.FireApplyCommand();
}
 Now about the problem. When I call ApplyFilter from Page_Load() method, it raises a NullReferenceException in RadFilterDataEditor.CreateEditorFrom() method. When I call it from Page_Init() right after grid is initialized, filter won't apply. What am I doing wrong?
Thank you.
Rick
Top achievements
Rank 1
 answered on 25 May 2012
3 answers
142 views
When i click on my insert record button it is giving me an error about Conversion from type 'DBNull' to type 'Boolean' is not valid.  I would think that i knows not to use these databinding since this is for updating and not inserting the data.  I have a custom form that I am using but the same for should be used for inserting as well.

<EditFormSettings EditFormType="Template">
                               <FormTemplate>
                                   <table width="100%">
                                       <tr>
                                           <td style="width:10%" align="right">Mac Type: </td>
                                           <td style="width:15%" align="left"><asp:DropDownList ID="ddlMacType" runat="server" AutoPostBack="false" Width="205px"></asp:DropDownList></td>
                                           <td style="width:10%" align="right">SSN: </td>
                                           <td style="width:15%" align="left"><asp:TextBox ID="txtSSN" runat="server" Width="200px" Text='<%# Bind("strSSN") %>'></asp:TextBox></td>
                                           <td style="width:10%" align="right">EDIPI: </td>
                                           <td style="width:15%" align="left"><asp:TextBox ID="txtEDIPI" runat="server" Width="200px" Text='<%# Bind("strEDIPI") %>'></asp:TextBox></td>
                                           <td style="width:10%" align="right">AKO Logon: </td>
                                           <td style="width:15%" align="left"><asp:TextBox ID="txtAKO" runat="server" Width="200px" Text='<%# Bind("strAkoLogon") %>'></asp:TextBox></td>
                                       </tr>
                                       <tr>
                                           <td style="height:5px"></td>
                                       </tr>
                                       <tr>
                                           <td style="width:10%" align="right">LName: </td>
                                           <td style="width:15%" align="left"><asp:TextBox ID="txtLName" runat="server" Width="200px" Text='<%# Bind("strLName") %>'></asp:TextBox></td>
                                           <td style="width:10%" align="right">FName: </td>
                                           <td style="width:15%" align="left"><asp:TextBox ID="txtFname" runat="server" Width="200px" Text='<%# Bind("strFname") %>'></asp:TextBox></td>
                                           <td style="width:10%" align="right">MI: </td>
                                           <td style="width:15%" align="left"><asp:TextBox ID="txtMI" runat="server" Width="200px" Text='<%# Bind("strMI") %>'></asp:TextBox></td>
                                           <td style="width:10%" align="right">Gen Qual: </td>
                                           <td style="width:15%" align="left"><asp:DropDownList ID="ddlGenQual" runat="server" AutoPostBack="false" Width="205px"></asp:DropDownList></td>
                                       </tr>
                                       <tr>
                                           <td style="height:5px"></td>
                                       </tr>
                                       <tr>
                                           <td style="width:10%" align="right">Emp Type: </td>
                                           <td style="width:15%" align="left"><asp:DropDownList ID="ddlEmpType" runat="server" AutoPostBack="false" Width="205px"></asp:DropDownList></td>
                                           <td style="width:10%" align="right">Rank/Salutation: </td>
                                           <td style="width:15%" align="left"><asp:DropDownList ID="ddlSalutation" runat="server" AutoPostBack="false" Width="205px"></asp:DropDownList></td>
                                           <td style="width:10%" align="right">Job Title: </td>
                                           <td style="width:15%" align="left"><asp:TextBox ID="txtJobTitle" runat="server" Width="200px" Text='<%# Bind("strJobTitle") %>'></asp:TextBox></td>
                                           <td style="width:10%" align="right">Pick Unit: </td>
                                           <td style="width:15%" align="left"><asp:DropDownList ID="ddlunit" runat="server" AutoPostBack="false" Width="205px"></asp:DropDownList></td>
                                       </tr>
                                       <tr>
                                           <td style="height:5px"></td>
                                       </tr>
                                       <tr>
                                           <td style="width:10%" align="right">Requires Email: </td>
                                           <td style="width:15%" align="left"><asp:CheckBox ID="cbEmail" runat="server" Checked='<%# Bind("bitEmail") %>' /></td>
                                           <td style="width:10%" align="right">Military Phone: </td>
                                           <td style="width:15%" align="left"><asp:TextBox ID="txtPhone" runat="server" Width="200px" Text='<%# Bind("strPhoneNumber") %>'></asp:TextBox></td>
                                           <td style="width:10%" align="right">Requires LD: </td>
                                           <td style="width:15%" align="left"><asp:CheckBox ID="cbLD" runat="server" Checked='<%# Bind("bitLongDistance") %>' /></td>
                                           <td style="width:10%" align="right">Requires VM: </td>
                                           <td style="width:15%" align="left"><asp:CheckBox ID="cbVM" runat="server" Checked='<%# Bind("bitVoiceMail") %>' /></td>
                                       </tr>
                                       <tr>
                                           <td style="height:5px"></td>
                                       </tr>
                                       <tr>
                                           <td style="width:10%" align="right"></td>
                                           <td style="width:15%" align="left"></td>
                                           <td style="width:10%" align="right">Zero Out: </td>
                                           <td style="width:15%" align="left"><asp:TextBox ID="txtZeroOut" runat="server" Width="200px" Text='<%# Bind("strVoiceExt") %>'></asp:TextBox></td>
                                           <td style="width:10%" align="right">Notes: </td>
                                           <td style="width:15%" align="left"><asp:TextBox ID="txtNotes" runat="server" Width="260px" TextMode="MultiLine" Height="60px" Text='<%# Bind("strNotes") %>'></asp:TextBox></td>
                                           <td style="width:10%" align="right"></td>
                                           <td style="width:15%" align="left"></td>
                                       </tr>
                                         <tr>
                                           <td style="height:5px"></td>
                                       </tr>
                                   </table>
                                   <table width="100%">
                                        <tr>
                                           <td style="width:25%"></td>
                                           <td style="width:50%" align="center">
                                               <asp:LinkButton ID="lnkSubmit" runat="server" text='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "Insert", "Update") %>' 
                                               CommandName='<%# IIf((TypeOf(Container) is GridEditFormInsertItem), "PerformInsert", "Update")%>'></asp:LinkButton>
                                                     
                                               <asp:LinkButton ID="lnkCancel" runat="server" CausesValidation="false" CommandName="Cancel" Text="Cancel"></asp:LinkButton>
                                           </td>
                                           <td style="width:25%"></td>
                                       </tr>
                                   </table>
                               </FormTemplate>
                           </EditFormSettings>

I know the update protion is correct but is the insert portion correct for using the radgrid insert record button.

If (e.CommandName = RadGrid.PerformInsertCommandName) Then
       End If
       If (e.CommandName = RadGrid.UpdateCommandName AndAlso e.Item.IsInEditMode) Then
     End if


Error
Conversion from type 'DBNull' to type 'Boolean' is not valid. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 
  
Exception Details: System.InvalidCastException: Conversion from type 'DBNull' to type 'Boolean' is not valid.
  
Source Error: 
  
  
Line 85:                                         <tr>
Line 86:                                             <td style="width:10%" align="right">Requires Email: </td>
Line 87:                                             <td style="width:15%" align="left"><asp:CheckBox ID="cbEmail" runat="server" Checked='<%# Bind("bitEmail") %>' /></td>
Line 88:                                             <td style="width:10%" align="right">Military Phone: </td>
Line 89:                                             <td style="width:15%" align="left"><asp:TextBox ID="txtPhone" runat="server" Width="200px" Text='<%# Bind("strPhoneNumber") %>'></asp:TextBox></td>
  

Kevin
Top achievements
Rank 1
 answered on 25 May 2012
3 answers
241 views

I am using Radgrid  and  have the following situation.
First GroupBy is  Product and with in product it is grouped by City 

PRODUCT Part A Part B
Produc AA
City:  New York
 Conractor 1 10 20
Cotnractor 2 12 8
Cotnractor 3 22 20
City Total 44 48
City:Chicago
Cotnractor3 22 12
contractor8 11 33
Contactor 10 24 10
City Total 57 55
Prodcut Total 101 103

Eveything works fin about the total and also I am inserting the labels accordingly in the group footer.

I need to make my group footer more readble i.e it should say  NewYork City Total and Chicago City Total  in the inner group
and  it should say Product AA Total for outr group  rather that standard label

How do I access the groupby value from its Groupfooter.

Thanks for you help



Daniel
Telerik team
 answered on 25 May 2012
1 answer
108 views
When I try

AddHandler editor_Text.OnExportContent, AddressOf dynamanual_ExportContent

I keep getting:

Compiler Error Message: BC30390: 'Telerik.Web.UI.RadEditor.Protected Overridable Sub OnExportContent(e As Telerik.Web.UI.EditorExportingArgs)' is not accessible in this context because it is 'Protected'.

Marc
Rumen
Telerik team
 answered on 25 May 2012
1 answer
175 views
Hi ,

I ahve an existing application wich was working fine with Telerik.web.ui dll (version 2007.3.1314.20), but to use some new features(i.e. Schedular control) we just added the latest version of the dll( 2010.3.1317.20), but after updating to this dll we are facing lots of issues
1. We have Page which have the Update pannel control and when we add the user control which has the telerik:RadAjaxManager control it show the following exception "telerik:RadAjaxManager :-A control with id not be found for the trigger in updatepannel"

Please suggest on this.

Below is the code snippet
in CtrlPlaceholder we are loading the user control

<

 

 

asp:UpdatePanel id="pnluCompanyData" EnableViewState="true" runat="server" UpdateMode="Conditional"

 

 

 

RenderMode="Inline">

 

 

 

<contenttemplate>

 

 

 

<asp:PlaceHolder id="CtrlPlaceholder" EnableViewState="true" runat="server" ></asp:PlaceHolder>

 

</asp:UpdatePanel>

User control code

<

 

 

telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >

 

 

 

<AjaxSettings >

 

 

 

<telerik:AjaxSetting AjaxControlID="mvwDriver1" >

 

 

 

<UpdatedControls >

 

 

 

<telerik:AjaxUpdatedControl ControlID="divLoadingImageDriver" LoadingPanelID="RadAjaxLoadingPanel1" />

 

 

 

</UpdatedControls>

 

 

 

</telerik:AjaxSetting>

 

 

 

</AjaxSettings>

 

 

 

<ClientEvents OnResponseEnd="Driver_ResponseEnd" OnRequestStart="ApplyFormCssClass(dDisablescreen)" />

 

 

</

 

 

telerik:RadAjaxManager>

 

<

 

 

telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px"

 

 

 

Width="75px">

 

 

 

<img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'

 

 

 

style="border: 0px;" />

 

</

 

 

telerik:RadAjaxLoadingPanel>

 



Regards
Anurag Sharma
Iana Tsolova
Telerik team
 answered on 25 May 2012
2 answers
179 views
I have run into an issue here, i have 2 RadListBoxes on a page using the Transfer functionality.  The first RadListBox is bound on a SelectedIndexChanged event of a RadComboBox using an XML file.  I can transfer items to them with no issues.  The issue I am having is that when i hit a submit button on the page and the page posts back the transferred items are duplicating in the second RadListBox.  Has anyone seen this and overcome the issue?  I am also using the RadAjaxManager on the page and I think this is where the issue is coming from, when I remove the RadAjaxManager from the page it all seems to work.  Any ideas?
Chris Salas
Top achievements
Rank 1
 answered on 25 May 2012
1 answer
73 views
We are using AjaxManager and have several child controls on one page. We noticed on the server-side every server control's Page_Load is being called. This is causing the page to load extremely slow.

We only need 4 child controls to be reloaded.

How can this be accomplished?
Iana Tsolova
Telerik team
 answered on 25 May 2012
2 answers
118 views
I was trying out the code example using RadFilter in a RadWindow and I have over a hundred fields in my FieldEditor list.  The problem is that when I select the dropdown, the list is larger than the screen and I'm unable to scroll through the list.  Is there a fix for this or do I have to stick with the standard grid filtering?  I want to be able to present my users with a concise grid, but with the ability to filter by more fields than displayed and only show the full resultset when they export to Excel.
Julie
Top achievements
Rank 1
 answered on 25 May 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?