Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
384 views
Sorry if this is a duplicate post. The other one did not show up in the list so I assume it got lost somehow.

telerik version: 2011.1.315.40
browser: FF
.net 4.0
VS 2010.

I have a radgrid with a nestedviewtemplate containing another radgrid. I am exporting to excel using a button in the radtoolbar control.
I am using advanced databinding for the master and child grids. The grids render the data with no errors. However, when exporting this error is raised: I have researched many posts on various binding techniques and am wondering if its related to that. I had the export working before when I used client side binding. Attached below are the aspx and .cs files. Please Help and Thanks in Advance.
Object reference not set to an instance of an object.
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.NullReferenceException: Object reference not set to an instance of an object.
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
 
Stack Trace:
 
[NullReferenceException: Object reference not set to an instance of an object.]
   Telerik.Web.UI.GridTableView.PrepareExport() +17
   Telerik.Web.UI.Grid.Export.TableViewExporter.PrepareForExportInternal(GridTableView tableView, Boolean ignorePaging, Boolean dataOnly) +321
   Telerik.Web.UI.GridTableView.ClearTableViewControls(Control control, TableViewExporter exporter, GridTableView ownerTable) +583
   System.EventHandler.Invoke(Object sender, EventArgs e) +0
   System.Web.UI.Control.PreRenderRecursiveInternal() +112
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4184
ASPX:
<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">
    var currentLoadingPanel = null;
    var currentUpdatedControl = null;
    function OnDateSelected(sender, e) {
        var monthPicker = $find("<%= RadMonthYearPicker.ClientID %>");
        var startDatePicker = $find("<%= RadDatePickerStartDate.ClientID %>");
        var endDatePicker = $find("<%= RadDatePickerEndDate.ClientID %>");
        var selectedMonth = monthPicker.get_selectedDate();
 
        //set start date default, min and max
        var year = selectedMonth.getFullYear();
        var month = selectedMonth.getMonth();
        var minDate = new Date(year, month, 1);
        var maxDate = new Date(year, month + 1, 0);
        startDatePicker.set_minDate(minDate);
        startDatePicker.set_maxDate(maxDate);
        startDatePicker.set_selectedDate(minDate);
 
        //set end date default, min and max
        endDatePicker.set_minDate(minDate);
        //need to be sure we dont go into the future
        endDatePicker.set_maxDate(maxDate);
        endDatePicker.set_selectedDate(maxDate);
    }
</script>
</telerik:RadCodeBlock>
 
 
<div  class="filter2-single-column-layout">
    <div  class="section">
      <div  class="content">
          <table>
                <tr>
                   <td>
                       Custom Date Range:
                   </td>
                   <td>
                       <asp:CheckBox ID="CheckBoxCustomDateRange" runat="server" AutoPostBack="true" OnCheckedChanged="CheckBoxCustomDateRange_CheckedChanged"></asp:CheckBox>
                   </td>
                <td>  Or Select Month:</td>
                <td><telerik:RadMonthYearPicker ID="RadMonthYearPicker" Width="125px" runat="server"  >
                       <ClientEvents OnDateSelected="OnDateSelected"></ClientEvents>
                    </telerik:RadMonthYearPicker></td>
                   <td >
                      Start:
                   </td>
                   <td>
                       <telerik:RadDateTimePicker ID="RadDatePickerStartDate" Width="155px" runat="server" ShowPopupOnFocus="False"></telerik:RadDateTimePicker>
                   </td>
                   <td >
                      <asp:RequiredFieldValidator ID="RequiredFieldValidatorStartDate" runat="server" ErrorMessage="*" ForeColor="Red" ControlToValidate="RadDatePickerStartDate"></asp:RequiredFieldValidator>
                   </td>
                   <td>
                       End:
                   </td>
                   <td>
                       <telerik:RadDateTimePicker ID="RadDatePickerEndDate" Width="155px" runat="server" ShowPopupOnFocus="False"></telerik:RadDateTimePicker>
                        
                   </td>
                   <td>
                   <asp:RequiredFieldValidator ID="RequiredFieldValidatorEndDate" runat="server" ErrorMessage="*"  ForeColor="Red" ControlToValidate="RadDatePickerEndDate"></asp:RequiredFieldValidator>
                       <asp:CompareValidator ID="CompareValidator1" ControlToValidate="RadDatePickerStartDate" Operator="LessThanEqual" ControlToCompare="RadDatePickerEndDate" runat="server" ForeColor="Red" ErrorMessage="*"></asp:CompareValidator>
                   </td>
 
                   <td>
                   <telerik:RadToolBar runat="server" ID="RadToolBar" EnableRoundedCorners="True" OnButtonClick="RadToolBar_ButtonClick" AutoPostBack="true">
                     <Items >
                       <telerik:RadToolBarButton Text="Search" ToolTip="Search (Alt+S)" CommandName="search" ></telerik:RadToolBarButton>
                     </Items>
                   </telerik:RadToolBar>
                   </td>
                   <td>
                        <telerik:RadComboBox runat="server" ID="CustomerSelector"  Width="100px">
                            <Items>
                                <telerik:RadComboBoxItem Text="1001005" Value="1001005" />
                            </Items>
                        </telerik:RadComboBox>
                   </td>
                </tr>
             </table>
           </div>
     </div>
</div>
 
<div class="column-full">
<telerik:RadToolBar ID="gridtemplateButtons" runat="server" EnableEmbeddedBaseStylesheet="false" EnableEmbeddedSkins="false" OnButtonClick="gridtemplateButtons_ButtonClick" AutoPostBack="true" Height="22px">
<Items>
    <telerik:RadToolBarButton Text="Manage Cards..." ToolTip="" CommandName="ManageCards"></telerik:RadToolBarButton>
    <telerik:RadToolBarButton IsSeparator="true" />
    <telerik:RadToolBarDropDown Text="Export" AccessKey="e" ToolTip="Export (Alt+E)">
        <Buttons>
            <telerik:RadToolBarButton IsSeparator="true">
            </telerik:RadToolBarButton>
            <telerik:RadToolBarButton ImageUrl="~/Images/stratos_icon_16x16_settings3.gif" ImagePosition="Left" Text="Export MS Excel"  CommandName="ExportToExcel">
            </telerik:RadToolBarButton>
        </Buttons>
    </telerik:RadToolBarDropDown>
</Items>
</telerik:RadToolBar>
 
<telerik:RadGrid ID="RadGridTrafficSummary" EnableViewState="true" runat="server"
Visible="true" GroupingEnabled="true" AllowSorting="True" AllowPaging="True"
AllowFilteringByColumn="true" AllowMultiRowSelection="False" ShowStatusBar="true" AutoGenerateColumns="False"
 OnNeedDataSource="RadGridTrafficSummary_NeedDataSource"
 OnPreRender="RadGridTrafficSummary_PreRender"
 ShowFooter="true">
 <MasterTableView AutoGenerateColumns="False" DataKeyNames="imsi" Width="100%">
<PagerStyle Mode="NextPrevNumericAndAdvanced" />
<Columns>
        <telerik:GridBoundColumn FilterControlWidth="45px" HeaderStyle-Width="40px" ItemStyle-Width="20px" AllowFiltering="true" AllowSorting="false" HeaderTooltip="" DataType="System.String" DataField="accountnr" HeaderText="Acct #"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn FilterControlWidth="45px" HeaderStyle-Width="50px" ItemStyle-Width="40px" HeaderTooltip=""  DataType="System.String" DataField="customerId" HeaderText="Customer #"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn HeaderStyle-Width="80px" ItemStyle-Width="80px" HeaderTooltip="" DataField="cname"  DataType="System.String" HeaderText="Name"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn FilterControlWidth="40px" HeaderStyle-Width="40px" ItemStyle-Width="40px" HeaderTooltip=""  DataType="System.String" DataField="product" HeaderText="Product"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn HeaderStyle-Width="80px" ItemStyle-Width="80px" HeaderTooltip="" DataField="imsi" DataType="System.String" HeaderText="IMSI"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn HeaderStyle-Width="100px" ItemStyle-Width="100px" HeaderTooltip="" DataField="ICCID" DataType="System.String" HeaderText="ICCID"></telerik:GridBoundColumn>
        <telerik:GridNumericColumn FilterControlWidth="60px" HeaderStyle-Width="50px" ItemStyle-Width="50px" AllowFiltering="true" FooterStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" Aggregate="Sum" DataType="System.Decimal" HeaderStyle-HorizontalAlign="Right" HeaderTooltip="" DataField="MBsIn" HeaderText="MBs In"></telerik:GridNumericColumn >
        <telerik:GridNumericColumn FilterControlWidth="60px" HeaderStyle-Width="50px" ItemStyle-Width="50px" AllowFiltering="true"  FooterStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" Aggregate="Sum" DataType="System.Decimal" HeaderStyle-HorizontalAlign="Right" HeaderTooltip="" DataField="MBsOut" HeaderText="MBs Out"></telerik:GridNumericColumn >
        <telerik:GridNumericColumn FilterControlWidth="60px" HeaderStyle-Width="50px"  ItemStyle-Width="50px" AllowFiltering="true"  FooterStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" Aggregate="Sum" DataType="System.Decimal" HeaderStyle-HorizontalAlign="Right" HeaderTooltip="" DataField="MBsTotal" HeaderText="MBs Total" ></telerik:GridNumericColumn >
        <telerik:GridBoundColumn FilterControlWidth="35px" HeaderStyle-Width="35px" ItemStyle-Width="35px"  DataType="System.String" HeaderTooltip="To Unsubscribe, use the Manage Cards button." DataField="subscription" HeaderText="Subscribed"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn visible="false" DataType="System.String" DataField="startdate"></telerik:GridBoundColumn>
        <telerik:GridBoundColumn visible="false" DataType="System.String" DataField="enddate"></telerik:GridBoundColumn>
</Columns>
<NestedViewTemplate>
        <telerik:RadGrid runat="server" ID="RadGridTrafficImsiDetails" EnableViewState="true" GroupingEnabled="true" ShowFooter="true"
                    AllowFilteringByColumn="true" AllowSorting="true" >
                    <MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true" PageSize="7" >
                    <PagerStyle Mode="NextPrevNumericAndAdvanced" />
                            <Columns>
                            <telerik:GridBoundColumn visible="false" HeaderTooltip="" DataField="imsi" HeaderText="IMSI"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn visible="false" HeaderTooltip="" DataField="iccid" HeaderText="ICCID"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn FilterControlWidth="30px"  HeaderStyle-Width="20px" ItemStyle-Width="20px"    DataField="service" HeaderText="Service"></telerik:GridBoundColumn>
                            <telerik:GridNumericColumn  FilterControlWidth="60px" HeaderStyle-Width="40px" ItemStyle-Width="40px"  AllowFiltering="true"  FooterStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" Aggregate="Sum" DataType="System.Decimal" HeaderStyle-HorizontalAlign="Right" HeaderTooltip="" DataField="MBsIn" HeaderText="MBs In" HeaderStyle-Wrap="false"></telerik:GridNumericColumn>
                            <telerik:GridNumericColumn  FilterControlWidth="60px" HeaderStyle-Width="40px" ItemStyle-Width="40px" AllowFiltering="true"  FooterStyle-HorizontalAlign="Right" ItemStyle-HorizontalAlign="Right" Aggregate="Sum" DataType="System.Decimal" HeaderStyle-HorizontalAlign="Right" HeaderTooltip="" DataField="MBsOut" HeaderText="MBs Out"  HeaderStyle-Wrap="false"></telerik:GridNumericColumn>
                            <telerik:GridBoundColumn HeaderStyle-Width="30px"  ItemStyle-Width="30px"  HeaderTooltip="" DataField="srcip" HeaderText="Source IP"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn  HeaderStyle-Width="30px" ItemStyle-Width="30px"  HeaderTooltip="" DataField="dstip" HeaderText="Dest IP"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn  HeaderStyle-Width="60px" ItemStyle-Width="60px"  HeaderTooltip="" DataField="domain" HeaderText="Domain"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn FilterControlWidth="30px" HeaderStyle-Width="20px" ItemStyle-Width="20px"  HeaderTooltip="" DataField="Port" HeaderText="Port"></telerik:GridBoundColumn>
                            <telerik:GridDateTimeColumn FilterControlWidth="130px" HeaderStyle-Width="120px"  ItemStyle-Width="120px"  HeaderTooltip="" DataField="dstamp" HeaderText="Date"></telerik:GridDateTimeColumn>
                            <telerik:GridBoundColumn FilterControlWidth="30px" HeaderStyle-Width="20px"  ItemStyle-Width="20px"  HeaderTooltip="" DataField="Denied" HeaderText="Denied"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn  HeaderStyle-Width="30px" ItemStyle-Width="30px"  HeaderTooltip="" DataField="reason" HeaderText="Reason"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn  Visible="false" DataType="System.String"  DataField="subscription"></telerik:GridBoundColumn>
                            </Columns>            
                    </MasterTableView>
        </telerik:RadGrid>
</NestedViewTemplate>
</MasterTableView>      
</telerik:RadGrid>
</div>
CS codebehind:
using System;
using System.Data;
using System.Data.SqlClient;
using System.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Drawing;
using System.Web.UI;
using System.Web.UI.WebControls;
using Stratos.Libraries.Data;
using Telerik.Charting;
using Telerik.Web.UI;
using Telerik.Web.UI.Calendar;
 
namespace Stratos.Web.Portal.Reports
{
    public partial class TrafficDashboard_01_export : System.Web.UI.Page
    {
        TimeSpan allowableTimeSpan = new TimeSpan(365, 0, 0, 0); //1 full year
 
        private void SetStartEndDateRange()
        {
            this.RadMonthYearPicker.MinDate = DateTime.Now.Subtract(allowableTimeSpan);
            this.RadMonthYearPicker.MaxDate = DateTime.Now;
            this.RadMonthYearPicker.SelectedDate = DateTime.Now;
 
            //set start/end date min/max
            this.RadDatePickerStartDate.MinDate = DateTime.Now.Subtract(allowableTimeSpan);
            this.RadDatePickerStartDate.MaxDate = DateTime.Now;
            this.RadDatePickerEndDate.MinDate = DateTime.Now.Subtract(allowableTimeSpan);
            this.RadDatePickerEndDate.MaxDate = DateTime.Now;
 
            this.RadDatePickerStartDate.Clear();
            this.RadDatePickerEndDate.Clear();
            this.RadDatePickerStartDate.SelectedDate = new DateTime(RadMonthYearPicker.SelectedDate.Value.Year, RadMonthYearPicker.SelectedDate.Value.Month, 1);
            this.RadDatePickerEndDate.SelectedDate = DateTime.Now.Subtract(new TimeSpan(0, 0, 1));
 
 
 
        }
 
        protected void Page_Init(object sender, System.EventArgs e)
        {
            if (!IsPostBack)
            {
                SetStartEndDateRange();
            }
        }
 
        public void Page_Load(object sender, System.EventArgs e)
        {
            //if sdate edate strings are null. Load page as if we came from menu
            if (String.IsNullOrEmpty(Request.QueryString["StartDate"]) || String.IsNullOrEmpty(Request.QueryString["EndDate"]))
            {
            }
            //if sdate edate strings are not null, we came from somewhere with dates, load data with them.
            else
            {
                this.RadDatePickerStartDate.SelectedDate = DateTime.Parse((Request.QueryString["StartDate"].ToString())); //ToString("dd-MMM-yyyy HH:mm:ss");
                this.RadDatePickerEndDate.SelectedDate = DateTime.Parse((Request.QueryString["EndDate"].ToString()));
            }
 
        }
 
 
        protected void CheckBoxCustomDateRange_CheckedChanged(object sender, System.EventArgs e)
        {
            SetStartEndDateRange();
            if (CheckBoxCustomDateRange.Checked)
            {
                this.RadMonthYearPicker.Enabled = false;
            }
            else
            {
                this.RadMonthYearPicker.Enabled = true;
            }
 
        }
 
 
        protected void RadToolBar_ButtonClick(object sender, Telerik.Web.UI.RadToolBarEventArgs e)
        {
            RadToolBarButton buttons = e.Item as RadToolBarButton;
            if (buttons.CommandName.ToString().ToLower() == "search")
            {
                RadGridTrafficSummary.Rebind();
            }
        }
 
 
        protected void gridtemplateButtons_ButtonClick(object sender, RadToolBarEventArgs e)
        {
            RadToolBarButton gridtemplateButtons = e.Item as RadToolBarButton;
            if (gridtemplateButtons.CommandName.ToString().ToLower() == "exporttoexcel")
            {
                ConfigureExport(RadGridTrafficSummary);
                RadGridTrafficSummary.MasterTableView.ExportToExcel();
            }
        }
 
        protected void RadGridTrafficSummary_PreRender(object sender, EventArgs e)
        {
            foreach (GridDataItem gridDataItem in (sender as RadGrid).MasterTableView.Items)
            {
                if (gridDataItem.Expanded)
                {
                    GridNestedViewItem gridNestedViewItem = gridDataItem.ChildItem;
                    if (gridNestedViewItem != null)
                    {
                        RadGrid RadGridTrafficImsiDetails = (RadGrid)gridNestedViewItem.FindControl("RadGridTrafficImsiDetails");
                        RadGridTrafficImsiDetails.DataSource = NetStats.GetImsiDetailTraffic(GetScopeLimitation(), (DateTime)RadDatePickerStartDate.SelectedDate, (DateTime)RadDatePickerEndDate.SelectedDate, gridDataItem["imsi"].Text);
                        RadGridTrafficImsiDetails.DataBind();
                    }
                }
            }
        }
 
 
        private void ConfigureExport(object sender)
        {
            (sender as RadGrid).ExportSettings.ExportOnlyData = true;
            (sender as RadGrid).ExportSettings.IgnorePaging = true;
            (sender as RadGrid).MasterTableView.HierarchyDefaultExpanded = true;
 
        }
 
        protected void RadGridTrafficSummary_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            RadGridTrafficSummary.DataSource = NetStats.GetCustomerTrafficSummary(GetScopeLimitation(), (DateTime)RadDatePickerStartDate.SelectedDate, (DateTime)RadDatePickerEndDate.SelectedDate);
        }
 
        private String GetScopeLimitation()
        {
            //TODO build the users scope limitation, a list of customer and sub customers that they can view.
            String scopeLimitation = " customerid in ( "; // ConfigurationManager.AppSettings["TDB_ScopeLimitation"];
            scopeLimitation = scopeLimitation + "'" + GetSelectedCustomer() + "'";
            scopeLimitation = scopeLimitation + GetSelectedCustomerSubCustomers(GetSelectedCustomer()) + " ) ";
            return scopeLimitation;
        }
 
        private String GetSelectedCustomer()
        {
            return CustomerSelector.SelectedValue;
        }
 
        private String GetSelectedCustomerSubCustomers(String customer)
        {
            if (customer == "1001005")
                return " , '1004515', '1004516', '1005417','1004517', '1005301', '1005578', '1005579', '1005580', '1007909', '1008578', '1010285', '1010834'";
            else
                return "";
        }
    }
}


Daniel
Telerik team
 answered on 13 May 2011
1 answer
82 views
I borrowed heavily from the dynamic portal sample http://demos.telerik.com/aspnet-ajax/dock/examples/myportal/defaultcs.aspx  .. I noticed that when a user "deletes" a dock, dock.close() fires, and the dock remains in the dockstate collection  (with Closed=true). 

Is there a best practice or sample for how to remove it from the dockstate collection as well?
Dobromir
Telerik team
 answered on 13 May 2011
1 answer
149 views
Hi

Is there way to enable an horizontal scroll bar on the tree list. I have a tree list with auto generated column.  The columns at the end does not show up if it exceeds certain number. If I reduce the column width manually than I can see those missing columns.

Is there a way where  I can have the screen scroll horizontally automatically.

Thanks
Shabbir
Veli
Telerik team
 answered on 13 May 2011
3 answers
72 views
I have a page with horizontal scrolling.  The page has either one or two frozen columns along with an arbitrary number of other columns.  The page renders fine in FF, IE, and Chrome.  In Opera, however, I have a scrolling problem.  When I scroll, half of the non-frozen columns stay in place.  The other non-frozen columns get bunched up like a sock pushed down to the ankle.  Is this a bug in Opera? Am I doing something wrong?
Pavlina
Telerik team
 answered on 13 May 2011
1 answer
70 views
Hello, 

I'm having a small problem...

In fact, my RadScheduler is parametred like this : 

<telerik:RadScheduler ID="RSPlanning" runat="server"
            DataSourceID="ODSCalendar" Culture="fr-FR"
            DataKeyField="IdCalendar"
            DataEndField="DateFin"
            DataStartField="DateDebut"
            DataSubjectField="Commentaire"
            SelectedView="MonthView"
            ShowViewTabs="False"
            OverflowBehavior="Expand"
            FirstDayOfWeek="Monday" LastDayOfWeek="Saturday"
            MonthView-VisibleAppointmentsPerDay="100"
            StartEditingInAdvancedForm="False"
            CustomAttributeNames="IsValider,IsSaisie,CodeHeure,CodeHeureLibelle,IdAffaire,NumAffaire,LibelleAffaire,Temps,IdUser"
            OnFormCreating="RSPlanning_FormCreating"
            OnNavigationComplete="RSPlanning_NavigationComplete"
            OnTimeSlotCreated="RSPlanning_TimeSlotCreated"
            OnTimeSlotContextMenuItemClicking="RGPlanning_TimeSlotContextMenuItemClicking">
<MonthView VisibleAppointmentsPerDay="100"></MonthView>
            <TimeSlotContextMenus>
                <telerik:RadSchedulerContextMenu ID="RSCMTS" runat="server">
                    <Items>
                        <telerik:RadMenuItem Text="Valider la semaine" ImageUrl="http://static.isi.eud.schneider-electric.com/images/famfamfam/accept.png" />
                        <telerik:RadMenuItem Text="Dévalider la semaine" ImageUrl="http://static.isi.eud.schneider-electric.com/images/famfamfam/cross.png" />
                    </Items>
                </telerik:RadSchedulerContextMenu>
            </TimeSlotContextMenus>
        </telerik:RadScheduler>

And every thing is working well.

But, when RGPlanning_TimeSlotContextMenuItemClicking is fired, I can't ReBind my RadScheduler... Do you have an idea?

In This methode, in fact I change the categorie of each appointment of the week... That's why I would like to Rebind all my Appointements... (To see visualy the changes...)

Thank you to help me


Jean-Yves
Peter
Telerik team
 answered on 13 May 2011
1 answer
80 views
hi

i am getting this type of error when i build the demo of sales dashboard project.
"Trial license for OpenAccess found. To obtain a valid license visit http://www.telerik.com . Enhanced assemblies expire after 1 day, please recompile your project."
please help me out how i can resolve this.
Alexander
Telerik team
 answered on 13 May 2011
3 answers
230 views
Hi all,

I wish to load the ASPX file to the pageview on the client site. Can anybody show me the example?

Thanks.

Regards,
Bryan Tan
Veronica
Telerik team
 answered on 13 May 2011
1 answer
61 views
Hi,

I try to use RadPanelBar into an other RadPanelBar and I have a problem with the level2 RadPanelBar.
This is my code :
<telerik:RadPanelBar ID="RadPanelBar1" runat="server" Width="100%">
            <Items>
                <telerik:RadPanelItem Text="PanelItem1">
                    <ContentTemplate>
                        <telerik:RadPanelBar ID="PanelBar2" runat="server" Width="100%">
                            <Items>
                                <telerik:RadPanelItem Text="Title1">
                                    <HeaderTemplate><table style="width:100%;"><tr><td>Title1</td><td style="text-align:right;"><asp:ImageButton ID="ImgBtnRemoveContact1" runat="server" ImageUrl="~/images/cancel.png" /></td></tr></table></HeaderTemplate>
                                    <ContentTemplate>
                                        1iere ligne
                                        <br/>
                                        <br/>
                                        <br/>
                                        <br/>
                                        <br/>
                                        <br/>
                                        <br/>
                                        <br/>
                                        10ieme ligne
                                    </ContentTemplate>
                                </telerik:RadPanelItem>
                                <telerik:RadPanelItem Text="Title2">
                                    <HeaderTemplate><table style="width:100%;"><tr><td>Title2</td><td style="text-align:right;"><asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/cancel.png" /></td></tr></table></HeaderTemplate>
                                    <ContentTemplate>
                                        1st line
                                        <br/>
                                        <br/>
                                        <br/>
                                        <br/>
                                        <br/>
                                        <br/>
                                        <br/>
                                        <br/>
                                        10th line
                                    </ContentTemplate>
                                </telerik:RadPanelItem>
                            </Items>
                        </telerik:RadPanelBar>
                    </ContentTemplate>
                </telerik:RadPanelItem>
            </Items>
        </telerik:RadPanelBar>

With this code, I can't expand the level 2 RadPanelItem (or it expand but I can't see the content)
Is it possible to solve this ?

Sorry for my poor english.
Vincent
Top achievements
Rank 1
 answered on 13 May 2011
3 answers
270 views
Can someone help me how t set invalid style in server side.  My code as as following.  When validate through client side, textbox style is set to invalid style(CssClass="InvalidTextBox") if validation fails.  Similarlly I want to do the validation in server side just in case client side validation does not go through.  How to set to Invalid style in server side ?

<

 

telerik:RadTextbox ID="Email" runat="server">

 

    <

 

EmptyMessageStyle CssClass="EmptyTextBox" />

 

 

 

 

 

    <EnabledStyle CssClass="EnabledTextBox" />

 

 

 

 

 

    <FocusedStyle CssClass="FocusedTextBox" />

 

 

 

 

 

    <HoveredStyle CssClass="HoveredTextBox" />

 

 

 

 

 

    <InvalidStyle CssClass="InvalidTextBox" />

 

 

 

</telerik:RadTextbox>
<

 

asp:CustomValidator runat="server" EnableClientScript="true" controltovalidate="Email" id="ev" ClientValidationFunction="ClientValidate" OnServerValidate="ServerValidate" />

 


function

 

ClientValidate(sender, args)
{

 

 

     var email = $find("<%= email.ClientID %>");

 

 

        if (! validate(email.get_value())) 
       {

 

            email._invalid =

true;

 

            email.updateCssClass();

            args.IsValid =

false;

 

        }

}


 

protected void ServerValidate(object source, ServerValidateEventArgs args)

 

{

 

    args.IsValid = validate(email.Text);

 

 

    if (!args.IsValid)

 

    {

 

        //how to set invalid style for email RadTextBox ????

 

 

    }
}

 

Tsvetina
Telerik team
 answered on 13 May 2011
4 answers
78 views
I am using the RadScriptManager1, RadAjaxManager1 and  RadAjaxLoadingPanel in order to have the "loading" graphics kick in while oading my web pages .. filling in data in rsponse to user input. This is ties to a button and I get the overlay everyother time.

 

<telerik:RadScriptManager ID="RadScriptManager1" Runat

="server"> 

</telerik:RadScriptManager> 

 

<telerik:RadAjaxManager ID="RadAjaxManager1" runat

="server"> 

<AjaxSettings >

 

 

<telerik:AjaxSetting AjaxControlID ="Panel2">

 

 

 

<UpdatedControls >

 

 

 

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

 

 

 

</UpdatedControls >

 

 

 

</telerik:AjaxSetting >

 

 

 

</AjaxSettings >

 

 

 

</telerik:RadAjaxManager >

 

 

 

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

 

 

<img alt="Loading Cycle Count ..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0;" />

 

 

</telerik:RadAjaxLoadingPanel>

 

 

Why is this? I am developing under VS 2008 and using the RadControls for ASP.NET AJAX Q1 2011 NET 35

any help ???

Thanks

gollnick

 

 

Maria Ilieva
Telerik team
 answered on 13 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?