Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
139 views
In my page,there are 2 web user controls,and I used the RadAjaxManager as well.
Every controls had been bind with RequiredFieldValidator.
The validation works when I clicke the submit button for the first time.
I mean,after I chosen a item from a combobox ,autopostback enabled,the validation would not work any more.
I think ,there must be something wrong with  RadAjaxManager.
coz it works fine without RadAjaxManager.but I must use it in the page.
Thanks in advance.
Nencho
Telerik team
 answered on 13 Sep 2013
6 answers
216 views
Hi Team,
I have an editable radgrid and I want to export it to excel.

This is my aspx:
 

<telerik:RadAjaxPanel ID="rjxPanel" runat="server" LoadingPanelID="RadAjaxLoadingPanel1">

        <asp:UpdatePanel ID="updtPanel" runat="server">

<ContentTemplate>

<telerik:RadButton ID="btnExport" runat="server" OnClick="btnExport_Click" Text="Export" />


<telerik:RadGrid ID="rgCostAllocation" runat="server"  OnNeedDataSource="rgCostAllocation_NeedDataSource"

                                OnItemDataBound="rgCostAllocation_ItemDataBound" OnDeleteCommand="rgCostAllocation_DeleteCommand"

                                ShowFooter="true">

                                <ExportSettings Excel-Format="ExcelML" ExportOnlyData="true" IgnorePaging="true" HideStructureColumns="true"></ExportSettings>

                                <MasterTableView CommandItemDisplay="Top">

                                    <CommandItemSettings ExportToExcelText="Export" ShowExportToExcelButton="true" />

                                    <Columns>

<telerik:GridBoundColumn DataField="CostAllocationId" HeaderText="CostAllocationId"

                                            UniqueName="CostAllocationId" Display="false">

                                        </telerik:GridBoundColumn>

                                        <telerik:GridTemplateColumn DataField="AllocationLevel" HeaderText="Level" UniqueName="AllocationLevel"

                                            AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" Display="false">

                                            <ItemTemplate>

                                                <telerik:RadNumericTextBox ID="txtLevel" runat="server" Text='<%# DataBinder.Eval(Container,"DataItem.AllocationLevel") %>'

                                                    NumberFormat-AllowRounding="false" NumberFormat-DecimalDigits="0" />

                                            </ItemTemplate>

                                            <FooterTemplate>

                                                <telerik:RadNumericTextBox ID="txtFLevel" runat="server" NumberFormat-AllowRounding="false"

                                                    NumberFormat-DecimalDigits="0" />

                                            </FooterTemplate>

                                        </telerik:GridTemplateColumn>

                                        <telerik:GridTemplateColumn DataField="SenderDescription" HeaderText="Sender" UniqueName="SenderCostCenterId" AllowFiltering="true"

                                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains">

                                            <ItemTemplate>

                                                 <telerik:RadComboBox ID="rcbSender" runat="server"

                                                              MarkFirstMatch="True" AutoPostBack="true"

                                                              Width="170px" OnItemsRequested ="rcbSender_ItemsRequested"

                                                              height="200px" EnableLoadOnDemand="True" 

                                                              ItemRequestTimeout ="500"   DropDownWidth="280px"

                                                              DataTextField="CostCentreDescription"

                                                              DataValueField="CostCentreID"  ExpandEffect="pixelate">

                                                      <headertemplate>

                                                        <table width="92%">

                                                            <tr>                                                                

                                                                <td style="font-weight:bold; width:50%;">&nbsp; Cost Centre Description</td>

                                                                <td style="font-weight:bold; width:50%;">Cost Centre Code</td>

                                                               

                                                          </tr>

                                                        </table>                                

                                                      </headertemplate>

                                                      <itemtemplate>

                                                        <table width="100%">

                                                            <tr>

                                                                <td style="width: 50%; font-size: 8pt; font-family: Arial;" align="left">

                                                                    &nbsp;

                                                                    <%# DataBinder.Eval(Container, "Attributes['DataValue']") %>

                                                                </td>

                                                                <td align="left" style="font-size: 8pt; width: 50%; font-family: Arial;">

                                                                    <%# DataBinder.Eval(Container, "Attributes['DataText']")%>

                                                                </td>

                                                            </tr>

                                                        </table>

                                                    </itemtemplate>

                                            </telerik:RadComboBox>

                                            </ItemTemplate>

                                            <FooterTemplate>

                                              

                                             <telerik:RadComboBox ID="rcbFSender" runat="server"

                                                              MarkFirstMatch="True" AutoPostBack="true"

                                                              Width="170px" OnItemsRequested ="rcbFSender_ItemsRequested"

                                                              height="200px" EnableLoadOnDemand="True"  ItemRequestTimeout ="500"

                                                              DataTextField="CostCentreDescription"

                                                              DataValueField="CostCentreID"

                                                              DropDownWidth="280px"

                                                              ExpandEffect="pixelate" >

                                                      <headertemplate>

                                                        <table width="92%">

                                                            <tr>                                                               

                                                                <td style="font-weight:bold; width:50%;">&nbsp; Cost Centre Description</td>

                                                                <td style="font-weight:bold; width:50%;">Cost Centre Code</td>

                                                               

                                                          </tr>

                                                        </table>                               

                                                      </headertemplate>

                                                      <itemtemplate>

                                                        <table width="100%">

                                                             <tr>

                                                                <td style="width: 50%; font-size: 8pt; font-family: Arial;" align="left">

                                                                    &nbsp;

                                                                    <%# DataBinder.Eval(Container, "Attributes['DataValue']") %>

                                                                </td>

                                                                <td align="left" style="font-size: 8pt; width: 50%; font-family: Arial;">

                                                                    <%# DataBinder.Eval(Container, "Attributes['DataText']")%>

                                                                </td>

                                                            </tr>

                                                            </tr>

                                                        </table>

                                                    </itemtemplate>

                                            </telerik:RadComboBox>

                                           

                                            </FooterTemplate>

                                        </telerik:GridTemplateColumn>

<telerik:GridTemplateColumn DataField="AllocationPercentage" HeaderText="Percentage"

                                            UniqueName="AllocationPercentage" AutoPostBackOnFilter="true" CurrentFilterFunction="Contains">

                                            <ItemTemplate>

                                                <telerik:RadNumericTextBox Width="60px" ID="txtPercentage" runat="server" Text='<%# DataBinder.Eval(Container,"DataItem.AllocationPercentage") %>'

                                                    Type="Percent" />

                                            </ItemTemplate>

                                            <FooterTemplate>

                                                <asp:Label ID="lblSumPercentage" runat="server" />

                                             

                                                <telerik:RadNumericTextBox Width="60px" ID="txtFPercentage" runat="server" Type="Percent" />

                                                <telerik:RadButton ID="btnAddNew" runat="server" OnClick="btnAddNew_Click" Text="Add New" />

                                            </FooterTemplate>

                                            <ItemStyle Width="15%" />

                                        </telerik:GridTemplateColumn>

                                        <telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" UniqueName="DeleteCommandColumn"

                                            HeaderText="Delete" ConfirmText="Are you sure you want to delete?" Text="Delete">

                                            <ItemStyle HorizontalAlign="Center" Width="3%" />

                                            <HeaderStyle HorizontalAlign="Center" Width="3%" />

                                        </telerik:GridButtonColumn>

                                    </Columns>

                                </MasterTableView>

                            </telerik:RadGrid>

     

</ContentTemplate>

        </asp:UpdatePanel>

</telerik:RadAjaxPanel>


 This is my .cs

protected void btnExport_Click(object sender, EventArgs e)

{

            try

            {

                rgCostAllocation.MasterTableView.ExportToExcel();

            }

            catch (Exception ex)

            {

                XITingExceptionProcessor.ProcessException(this, ex);

            }

}


I have a master page with RadAjaxManager.
When I try to export to excel, it doesn't work because of RadAjaxPanel.
So when I try to export by commenting the RadAjaxPanel, it exports to excel but with no data, a totally blank sheet.

Could you please help me with this?

Thanks,
Lok..
Lokesh
Top achievements
Rank 1
 answered on 13 Sep 2013
1 answer
109 views
 Hi,
I would like to set the datasource of RadTimepIcker.TimeView using javascript.


var MRTimePicker= $find("<%= MRTimePicker.ClientID %>");
MRTimePicker.TimeView.DataList.DataSource = null;  //set avalilable time using javascript

Is it possible?

Thanks,
Prava
Shinu
Top achievements
Rank 2
 answered on 13 Sep 2013
1 answer
101 views

I have the following markup on my aspx page:

<
telerik:RadAjaxManagerProxy runat="server" ID="MyAjaxManagerProxy">
       <AjaxSettings>
           <telerik:AjaxSetting AjaxControlID="MyRadGrid1">
               <UpdatedControls>
                   <telerik:AjaxUpdatedControl ControlID="MyRadGrid1" LoadingPanelID="AjaxLoadingPanel1" />
               </UpdatedControls>
           </telerik:AjaxSetting>
       </AjaxSettings>
   </telerik:RadAjaxManagerProxy>
   <telerik:RadAjaxLoadingPanel ID="AjaxLoadingPanel1" runat="server" Transparency="20">
       <telerik:RadCodeBlock ID="VpLaborHourlyRadCodeBlock1" runat="server">
           <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>'
               style="border: 0;" />
       </telerik:RadCodeBlock>
   </telerik:RadAjaxLoadingPanel>

My radgrid declaration immediately follows.

I have a delete button in each row of my radgrid. The delete event handler is implemented in ItemCommand as so:

protected void MyRadGrid_ItemCommand(object sender, GridCommandEventArgs e)
   {
     if (e.CommandName == RadGrid.InitInsertCommandName)
     {
      // Save the row into database.
     }
     else if (e.CommandName == RadGrid.DeleteCommandName)
     {
      // Delete the row from the database.
     }
   }
The delete function works fine, that is, the row does get deleted from the database.  There is only one problem as described below.

The first time I delete a row, ajax works perfectly, no full postback, the grid stays where it is and get rebound nicely after delete completes.

The second time I delete a row, it still successfully deletes the row from the database, but it does a full postback, and the entire page reloads, totally without the nice ajax feature.

What's wrong? Any hint please?









Princy
Top achievements
Rank 2
 answered on 13 Sep 2013
1 answer
203 views
I have a multiple selection checkbox combobox, i've seen threads that say i should be using selectedIndexChanged but also threads that say i should be using TextChanged. Essentially both events are doing the same thing for me, is there one that i should/should not be using? 
Shinu
Top achievements
Rank 2
 answered on 13 Sep 2013
5 answers
719 views
I have a master page where I integrated 6 telerik:RadMenu inside a <table></table> tag. and I would like to align these menus to the right. I try to add the align="right" property to the table. when I execute the page with 1024*768 resolution it works but if i changed the resolution, it does not work.

here is my code :
<table cellspacing="0" cellpadding="0" width="95%" style="text-align:right" border="1"
                                            <tr> 
                                                <td style="width:auto"></td> 
                                                <td> 
                                                    <telerik:RadMenu ID="mnuRootTop" runat="server" DataSourceID="sitemapWto" Skin="WtoRootTop" 
                                                        EnableEmbeddedSkins="false" /> 
                                                    <asp:SiteMapDataSource ID="sitemapWto" runat="server" SiteMapProvider="wtoTopMenu" /> 
                                                </td> 
                                                <td> 
                                                    <img alt="" src="../Images/separator.gif" /> 
                                                </td> 
                                                <td> 
                                                    <telerik:RadMenu ID="mnuNewsTop" runat="server" DataSourceID="sitemapNews" Skin="WtoNewsTop" 
                                                        EnableEmbeddedSkins="false" EnableAutoScroll="true" /> 
                                                    <asp:SiteMapDataSource ID="sitemapNews" runat="server" SiteMapProvider="newsTopMenu" /> 
                                                </td> 
                                                <td> 
                                                    <img alt="" src="../Images/separator.gif" /> 
                                                </td> 
                                                <td> 
                                                    <telerik:RadMenu ID="mnuTradeTop" runat="server" DataSourceID="sitemapTrade" Skin="WtoTradeTop" 
                                                        EnableEmbeddedSkins="false" /> 
                                                    <asp:SiteMapDataSource ID="sitemapTrade" runat="server" SiteMapProvider="tradeTopMenu" /> 
                                                </td> 
                                                <td> 
                                                    <img alt="" src="../Images/separator.gif" /> 
                                                </td> 
                                                <td> 
                                                    <telerik:RadMenu ID="mnuRessTop" runat="server" DataSourceID="sitemapRess" Skin="WtoRessTop" 
                                                        EnableEmbeddedSkins="false" /> 
                                                    <asp:SiteMapDataSource ID="sitemapRess" runat="server" SiteMapProvider="ressTopMenu" /> 
                                                </td> 
                                                <td> 
                                                    <img alt="" src="../Images/separator.gif" /> 
                                                </td> 
                                                <td> 
                                                    <telerik:RadMenu ID="mnuDocsTop" runat="server" DataSourceID="sitemapDocs" Skin="WtoDocsTop" 
                                                        EnableEmbeddedSkins="false" /> 
                                                    <asp:SiteMapDataSource ID="sitemapDocs" runat="server" SiteMapProvider="docsTopMenu" /> 
                                                </td> 
                                                <td> 
                                                    <img alt="" src="../Images/separator.gif" /> 
                                                </td> 
                                                <td> 
                                                    <telerik:RadMenu ID="mnuForumsTop" runat="server" DataSourceID="sitemapForum" Skin="WtoForumsTop" 
                                                        EnableEmbeddedSkins="false" /> 
                                                    <asp:SiteMapDataSource ID="sitemapForum" runat="server" SiteMapProvider="forumTopMenu" /> 
                                                </td>                                                
                                            </tr> 
                                        </table> 

And Thnks
Shinu
Top achievements
Rank 2
 answered on 13 Sep 2013
3 answers
98 views
Hello

I am using an old version of RadCalendar (q3 2007) but i hope you can help me. I think the picture says it all - the calendar displays days that are not in the month. Please can you advise how to fix this

thanks
Shinu
Top achievements
Rank 2
 answered on 13 Sep 2013
0 answers
119 views
Here is a nice little trick I found for dealing with data-type DateTime?

I was recently tasked with replacing a different venders UI toolset with yours and had a hard time dealing with nullable dates in existing code.
I finally created an extension method that allows me to quickly grab the text-field's value whether it has been set or not.
I hope this can save someone else time down the road.
          
public static string outputDate(this Telerik.Web.UI.RadDateTimePicker radPicker, string formatter)
{
    if (radPicker.IsEmpty || radPicker.SelectedDate == null) { return String.Empty; }
    switch (formatter.ToLower())
    {
        case "text":
        case "date": return radPicker.SelectedDate.Value.ToShortDateString();
        case "value":
        case "datetime": return radPicker.SelectedDate.Value.ToString();
        default:
            try {return radPicker.SelectedDate.Value.ToString(formatter); }
            catch {return String.Empty; }
    }           
}
Don
Top achievements
Rank 2
 asked on 13 Sep 2013
0 answers
66 views
I have a user control A in which a RadTreeview is added and another user control B which hold a RadListView. I am looking a way to implement drag items from B to A   I used the onitemdrop event of listview, but the same is showing destinationhtmlelement as null when dropped on to the treeview of A. Also the onnodedropped event of treeview in A is not firing when i dropped from B to A. Can some one explain how can I implement this?
Smash
Top achievements
Rank 1
 asked on 12 Sep 2013
1 answer
66 views
Hello, Im basically trying to duplicate the Scheduler Overview sample. I have the scheduler loading all the appointments but the resource filter is not updating the scheduler. In debug I see that the clientside rebind is correctly calling the asmx GetAppointments when I click to uncheck or check a resource but nothing happens. I move between days and still the appointments will not filter. I have Scheduler inside a panel and the panel is setup correctly with RadAjaxManager. Not sure if it matters but I have this setup on a page in my Sitefintiy site. All the other controls on the this page are inside the same panel and working correctly so I don't thing it is an Ajax setup issue. Again the scheduler seems to load perfect but just cant use the resource filter.

My Telerik version is: 2012.2.607.40. Below are my ajaxManager settings (set on the code behind).

Thank you,
manager = RadAjaxManager.GetCurrent(Page);
manager.AjaxSettings.AddAjaxSetting(this.pnlTop, this.pnlTop, this.RadAjaxLoadingPanel1);
manager.AjaxRequest += this.ajaxManager_AjaxRequest;


Kate
Telerik team
 answered on 12 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?