Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
81 views
Hello,

I have replaced the Microsoft ScriptManager with the RadScriptManager in my SharePoint site's master page.  That part seems to work just fine.  However, when I try to use some of the advanced features of RadScriptManager like EnableScriptCombine and TelerikCdn, they do not seem to function. It's as if these setting are getting ignored entirely, so I was wondering if they are even designed to work in SharePoint 2010?  Or perhaps there's some additional configuration steps needed to make them work?

I have successfully used these settings in a stand-alone web site (not hosted in SharePoint) without problem, even on the same machine.  Any help you can offer would be appreciated.  We are desperately trying to use these features to reduce latency in a client's production site. 

I am currently using Telerik AJAX controls version 
2011.1.413.35, however the same problem seems to exist in the latest release (2012.3.1016.35) as well.


Thank you,

Chris

P.S. I tried posting this in the SharePoint forum but I'm getting no answer!
Chris
Top achievements
Rank 1
 answered on 31 Oct 2012
18 answers
1.1K+ views
Hi,

I recently upgraded our web project to Telerik version 2011.2.712 (Mvc 2, .NET 3.5). Previously we were using 2010.2.929 for Telerik.Web.UI.dll and 2010.3.1318 for Telerik.Web.Mvc.dll.

After the upgrade, images stopped loading correctly. After debugging the issue, I found that Telerik.Web.UI.RadCompression is throwing a NullReferenceException:

Message
Object reference not set to an instance of an object.
Stack Trace
   at System.Object.GetType()
   at Telerik.Web.UI.RadCompression.Compress(HttpApplication application)
   at Telerik.Web.UI.RadCompression.PreRequestHandlerExecute(Object sender, EventArgs e)
   at System.Web.HttpApplication.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)

As I temporary work-around, I have disabled compression and everything seems to be working now:
<httpModules>
  <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" />
  <!--<add name="RadCompression" type="Telerik.Web.UI.RadCompression" />-->
</httpModules>
<modules runAllManagedModulesForAllRequests="true">
  <remove name="UrlRoutingModule" />
  <remove name="ScriptModule" />
  <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  <add name="UrlRoutingModule" preCondition="" type="System.Web.Routing.UrlRoutingModule, System.Web.Routing, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" />
  <remove name="RadUploadModule" />
  <add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule" preCondition="integratedMode" />
  <!--<remove name="RadCompression" />-->
  <!--<add name="RadCompression" type="Telerik.Web.UI.RadCompression" preCondition="integratedMode" />-->
  <remove name="HttpPreprocessModule" />
  <add name="HttpPreprocessModule" type="Microsoft.Cosmos.FrontEnd.WebService.IISHost.HttpPreprocessModule, Microsoft.Cosmos.FrontEnd.IISServiceHost" />
</modules>

Is this a know issue with the latest release?

Thanks,
Alex
Martin
Telerik team
 answered on 31 Oct 2012
1 answer
95 views
Hi,

We have one senrario ,  
Is there any option to set page size in radeditor, If its exceed more than the page size we should not allow the user to enter.

The user enter the content in to the RAD Editor Content Box, If the content exceed more than 6 inches in Height (Page Size), The user trying to do Export PDF, by that time  I need to send the validation message. Your page size is more than 6 inches . 

"This Validation has to be done before Export PDF


How can handle the validation in Rad Editor. 


Regards,
Saravanan M
Rumen
Telerik team
 answered on 31 Oct 2012
1 answer
79 views
Hello,

I have a RadGrid on my page that is populated with data from a query (Entity Framework).  Each column in the grid has a filter text box for  filtering the results.  I have set the width of each FilterControl like this ==> FilterControlWidth="45px".  Each of the controls are a different width depending on what data is displayed in the column.  My problem is that when I view the RadGrid in FireFox or IE9 everything displays properly, however if I view the grid in Safari or Chrome the FilterControlWidth property is ignored and all of the columns are columns/filtercontrols are the default width, making the entire RadGrid wider (user must scroll).  What do I need to do so my filterconrol widths will be recognized by Chrome/Safari?

Thanks,
InDev
Galin
Telerik team
 answered on 31 Oct 2012
1 answer
62 views
hey guys how can i "hide" thie "blue" "Add Group" button on the RadFilter.
screen shot is attached.
thanks again
rik
rik butcher
Top achievements
Rank 1
 answered on 31 Oct 2012
1 answer
61 views
I'm using a RadEditor using "Div" ContentAreaMode, with a simple ContextMenu calling the "BackColor" command to enable word selection. 

Used to work perfectly but then I rendered my aspx Page inside a RadWindow and all of a sudden, the RadEditor's Content disappears when the ContextMenu is disaplayed.
I suspect some z-index problem (maybe content going back-ward , so behind RadWindow).

Here is the code:
<telerik:RadEditor ID="EnonceContainer" Runat="server"
                           OnClientLoad="OnRadEditorClientLoad"
                           OnClientCommandExecuting="OnClientCommandExecuting"
                           EnableResize="true" ContentAreaMode="Div"
                           AutoResizeHeight="true"
                           Height="20px"
                           EditModes="Design"
                           Skin="Web20">
               <CssFiles>
                   <telerik:EditorCssFile Value="../Styles/EditorContentArea.css" />
               </CssFiles>
               <ContextMenus>
                   <telerik:EditorContextMenu TagName="TABLE">
                       <telerik:EditorTool ShowIcon="true" ImageUrl="../Images/paint.png" Text="Ajouter surbrillace" Name="Selectionner"/>
                   </telerik:EditorContextMenu>
                   <telerik:EditorContextMenu TagName="TR">
                       <telerik:EditorTool ShowIcon="true" ImageUrl="../Images/paint.png" Text="Ajouter surbrillace" Name="Selectionner"/>
                   </telerik:EditorContextMenu>
                   <telerik:EditorContextMenu TagName="TD">
                       <telerik:EditorTool ShowIcon="true" ImageUrl="../Images/paint.png" Text="Ajouter surbrillace" Name="Selectionner"/>
                   </telerik:EditorContextMenu>
                   <telerik:EditorContextMenu TagName="SPAN">
                       <telerik:EditorTool ShowIcon="true" ImageUrl="../Images/paint.png" Text="Ajouter surbrillace" Name="Selectionner"/>
                   </telerik:EditorContextMenu>
                   <telerik:EditorContextMenu TagName="DIV">
                       <telerik:EditorTool ShowIcon="true" ImageUrl="../Images/paint.png" Text="Ajouter surbrillace" Name="Selectionner"/>
                   </telerik:EditorContextMenu>
                   <telerik:EditorContextMenu TagName="P">
                       <telerik:EditorTool ShowIcon="true" ImageUrl="../Images/paint.png" Text="Ajouter surbrillace" Name="Selectionner"/>
                   </telerik:EditorContextMenu>
                   <telerik:EditorContextMenu TagName="BODY">
                       <telerik:EditorTool ShowIcon="true" ImageUrl="../Images/paint.png" Text="Ajouter surbrillace" Name="Selectionner"/>
                   </telerik:EditorContextMenu>
                   <telerik:EditorContextMenu TagName="FONT">
                       <telerik:EditorTool ShowIcon="true" ImageUrl="../Images/paint.png" Text="Ajouter surbrillace" Name="Selectionner"/>
                   </telerik:EditorContextMenu>
                   <telerik:EditorContextMenu TagName="HTML">
                       <telerik:EditorTool ShowIcon="true" ImageUrl="../Images/paint.png" Text="Ajouter surbrillace" Name="Selectionner"/>
                   </telerik:EditorContextMenu>
                   <telerik:EditorContextMenu TagName="IMG">
                       <telerik:EditorTool ShowIcon="false" Text="Aucune surbrillance pour les images" Enabled="false" />
                   </telerik:EditorContextMenu>
               </ContextMenus>
               <Tools>
                   <telerik:EditorToolGroup>
                       <telerik:EditorTool Name="BackColor" />
                   </telerik:EditorToolGroup>
               </Tools>
       </telerik:RadEditor>
       <script type="text/javascript">
           Telerik.Web.UI.Editor.CommandList["Selectionner"] = function (commandName, editor, args) {
               editor.fire("BackColor", { value: "Yellow", commandName: "BackColor" });
           };
       </script>

Here's the javascript code:
        function OnClientCommandExecuting(editor, args) {
            // Bloquer la toucher ENTER (Annuler l'évenement du RadEditor
            // !args.value --> On ne veut pas annuler l'évenement "BackColor:Yellow" (son argument ne dispose pas de la méthode get_commandName())
            if (!args.value && ("EnterNewLine" == args.get_commandName() || "ShiftEnterSafari" == args.get_commandName()))
                args.set_cancel(true);
        }
           function OnRadEditorClientLoad(editor, args) {
            //Disable Drag'n'Drop à l'interieur du RadEditor(Éviter de déplacer les images)
            var element = document.all ? editor.get_document().body : editor.get_document();
            var eventHandler = document.all ? "drop" : "dragstart";
            $telerik.addExternalHandler(element, "drop", function (e) {
                $telerik.cancelRawEvent(e);
                return false;
            });
            $telerik.addExternalHandler(element, "dragstart", function (e) {
                $telerik.cancelRawEvent(e);
                return false;
            });
            $telerik.addExternalHandler(element, "dragend", function (e) {
                $telerik.cancelRawEvent(e);
                return false;
            });
 
            //Disable la saisie de texte dans le RadEditor
            editor.attachEventHandler("onkeydown", function (e) {
                $telerik.cancelRawEvent(e);
                return false;
            });
 
            RefreshCalculatriceContent();
 
            editor.get_element().style.width = (getDocWidth() - 40) + "px";
 
        }

It might be since I added the RadWindow or it might also be since I dynamically set the RadEditor's width using this line:
    editor.get_element().style.width = (getDocWidth() - 40) + "px";
The line simply set's the RadEditor's width OnClientLoad the same way it it resized when the "window.resize" event is called.

The code works perfectly in Chrome and Firefox. Haven't tested with older IE versions. So only observed in IE9.

Thanks for the help.
Marin Bratanov
Telerik team
 answered on 31 Oct 2012
7 answers
105 views
Hi,

I have a radeditor with id="RadEditor1" on the page and a dropdown of numbers from 1-10. If i select a number from the dropdown i get those many radeditors with id= " RadEditor2" on the page(repeater is used to generate dynamically). I am using the Radspell button which should check the spellings of RadEditor1 as well as all the dynamically generated RadEditor2. How Can i do that? I want to use it for both static and dynamic controls of the page. If i assign controlstocheck property of the RadEditor as RadEditor1 and RadEditor2, and when i click Radspell button, if there are no RadEditor2 on the page,  it throws an error.
Rumen
Telerik team
 answered on 31 Oct 2012
2 answers
77 views
I just upgraded to Q3 (I had to uninstall Kendo to stop VS2012 from crashing)

I noticed my dock now has a scroll bar, I tried to add overflow: hidden; but that broke all of the form decorations in the dock.

I am dynamically creating the form elements. The dock height cannot be fixed, the height varies.
It worked fine in Q2.

I need to remove the unwanted scroll bar in IE9.

thanks, Marty
Slav
Telerik team
 answered on 31 Oct 2012
2 answers
108 views
With regard to Atchut's thread: http://www.telerik.com/community/forums/aspnet-ajax/grid/datakeynames.aspx

Please clarify.  I needed to access the value of a bound column so I added it to DataKeyNames as suggested.  The grid still appears to be working normally and I'm getting the data I need. 

However, this column is not a key field in the database sense, not in this table.  Does this matter?
Boris
Top achievements
Rank 1
 answered on 31 Oct 2012
8 answers
505 views
I have the following markup to create a grid with a nested view template and I cannot get the DetailTableDataBind event to fire.  Could someone please review my code and walk me through the steps needed to get the detail tables to bind programmatically?

Here is my .aspx markup and code behind:

 

<telerik:RadGrid ID="RadGrid" OnItemCreated="RadGrid_ItemCreated" OnItemCommand="RadGrid_ItemCommand" OnPreRender="RadGrid_PreRender" runat="server" AllowSorting="true" AllowPaging="false" AutoGenerateColumns="false" AllowFilteringByColumn="true" OnNeedDataSource="RadGrid_NeedDataSource" OnDetailTableDataBind="RadGrid_DetailTableDataBind">
        <MasterTableView AutoGenerateColumns="false" HierarchyLoadMode="ServerBind" AllowFilteringByColumn="true" ShowFooter="true" AllowPaging="false" AllowMultiColumnSorting="true" DataKeyNames="UnitId">
             
            <NestedViewSettings>
                <telerik:ParentTableRelation>
                    <telerik:GridRelationFields MasterKeyField="UnitId" DetailKeyField="UnitId" />
                </telerik:ParentTableRelation>
            </NestedViewSettings>
            <NestedViewTemplate>
                <asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false">
                    <telerik:RadTabStrip runat="server" ID="TabStip1" MultiPageID="Multipage1" SelectedIndex="0">
                        <Tabs>
                            <telerik:RadTab runat="server" Text="Orders" PageViewID="PageView1">
                            </telerik:RadTab>
 
                        </Tabs>
                    </telerik:RadTabStrip>
                    <telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false">
                        <telerik:RadPageView runat="server" ID="PageView1">
                            <telerik:RadGrid runat="server" ID="Orders" ShowFooter="true"
                                AllowSorting="true" EnableLinqExpressions="false" OnDetailTableDataBind="RadGrid_DetailTableDataBind">
                                <MasterTableView HierarchyLoadMode="ServerOnDemand" ShowHeader="true" DataKeyNames="UnitId" AutoGenerateColumns="false" AllowFilteringByColumn="true" ShowFooter="true" AllowPaging="false" AllowMultiColumnSorting="true">
                                    <Columns>
                                        <telerik:GridBoundColumn SortExpression="UnitId" HeaderText="UnitId" HeaderButtonType="TextButton"
                                            DataField="UnitId" UniqueName="UnitId">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="Date" HeaderText="Date" HeaderButtonType="TextButton"
                                            DataField="Date" UniqueName="Date">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="BillNumber" HeaderText="Bill Number" HeaderButtonType="TextButton"
                                            DataField="BillNumber" UniqueName="BillNumber">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="Status" HeaderText="Status" HeaderButtonType="TextButton"
                                            DataField="Status" UniqueName="Status">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="Origin" HeaderText="Origin" HeaderButtonType="TextButton"
                                            DataField="Origin" UniqueName="Origin">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="Destination" HeaderText="Destination" HeaderButtonType="TextButton"
                                            DataField="Destination" UniqueName="OrDestinationigin">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridNumericColumn NumericType="Currency" Aggregate="Sum" FooterAggregateFormatString="{0:C}" DataField="XCharges" HeaderText="Acc. Charges" SortExpression="XCharges" UniqueName="XCharges" DataType="System.Decimal"  />
                                        <telerik:GridNumericColumn NumericType="Currency" Aggregate="Sum" FooterAggregateFormatString="{0:C}" DataField="TotalCharge" HeaderText="Total Charges" SortExpression="TotalCharge" UniqueName="TotalCharge" DataType="System.Decimal"  />
                                    </Columns>
                                </MasterTableView>
                            </telerik:RadGrid>
                             
                        </telerik:RadPageView>
                    </telerik:RadMultiPage>
                </asp:Panel>
            </NestedViewTemplate>
            <Columns>
                <telerik:GridBoundColumn HeaderStyle-Width="10" DataField="Division" HeaderText="Division" SortExpression="Division" UniqueName="Division" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" />
                <telerik:GridBoundColumn DataField="Subdivision" HeaderText="Subdivision" SortExpression="Subdivision" UniqueName="Subdivision" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" />
                <telerik:GridBoundColumn DataField="UnitId" HeaderText="Unit" SortExpression="UnitId" UniqueName="UnitId" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" />
                <telerik:GridNumericColumn NumericType="Currency" Aggregate="Sum" FooterAggregateFormatString="{0:C}" DataField="GrossRevenue" HeaderText="Revenue" SortExpression="GrossRevenue" UniqueName="GrossRevenue" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" DataType="System.Decimal"  />
                <telerik:GridNumericColumn NumericType="Currency" Aggregate="Sum" FooterAggregateFormatString="{0:C}" DataField="TotalPay" HeaderText="Driver Pay" SortExpression="TotalPay" UniqueName="TotalPay" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" DataType="System.Decimal"  />
                <telerik:GridNumericColumn NumericType="Currency" Aggregate="Sum" FooterAggregateFormatString="{0:C}" DataField="TotalFuel" HeaderText="Fuel Cost" SortExpression="TotalFuel" UniqueName="TotalFuel" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" DataType="System.Decimal"  />
                <telerik:GridNumericColumn NumericType="Currency" Aggregate="Sum" FooterAggregateFormatString="{0:C}" DataField="TotalMaintenance" HeaderText="Maint. Cost" SortExpression="TotalMaintenance" UniqueName="TotalMaintenance" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" DataType="System.Decimal"  />
                <telerik:GridNumericColumn NumericType="Currency" Aggregate="Sum" FooterAggregateFormatString="{0:C}" DataField="Contribution" HeaderText="Contribution" SortExpression="Contribution" UniqueName="Contribution" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" DataType="System.Decimal"  />
                <telerik:GridNumericColumn NumericType="Currency" Aggregate="Avg" FooterAggregateFormatString="{0:C}" DataField="TotalCPM" HeaderText="Total CPM" SortExpression="TotalCPM" UniqueName="TotalCPM" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" DataType="System.Decimal"  />
                <telerik:GridNumericColumn NumericType="Currency" Aggregate="Avg" FooterAggregateFormatString="{0:C}" DataField="PayCPM" HeaderText="Pay CPM" SortExpression="PayCPM" UniqueName="PayCPM" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" DataType="System.Decimal"  />
                <telerik:GridNumericColumn NumericType="Currency" Aggregate="Avg" FooterAggregateFormatString="{0:C}" DataField="FuelCPM" HeaderText="Fuel CPM" SortExpression="FuelCPM" UniqueName="FuelCPM" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" DataType="System.Decimal"  />
                <telerik:GridNumericColumn NumericType="Currency" Aggregate="Avg" FooterAggregateFormatString="{0:C}" DataField="MaintenanceCPM" HeaderText="Maint. CPM" SortExpression="MaintenanceCPM" UniqueName="MaintenanceCPM" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" DataType="System.Decimal"  />
                <telerik:GridNumericColumn NumericType="Number" DataFormatString="{0:N2}" Aggregate="Sum" FooterAggregateFormatString="{0:N2}" DataField="TotalMiles" HeaderText="Total Miles" SortExpression="TotalMiles" UniqueName="TotalMiles" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" DataType="System.Decimal"  />
                <telerik:GridNumericColumn NumericType="Number" DataFormatString="{0:N2}" Aggregate="Avg" FooterAggregateFormatString="{0:N2}" DataField="MPG" HeaderText="MPG" SortExpression="MPG" UniqueName="MPG" AutoPostBackOnFilter="true" CurrentFilterFunction="EqualTo" ShowFilterIcon="true" DataType="System.Decimal"  />
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
public partial class UtilizationReport : System.Web.UI.Page
    {
        private BTReports.Repository.UnitUtilizationRepository rep = new Repository.UnitUtilizationRepository();
 
        protected void Page_Load(object sender, EventArgs e)
        {          
            
        }
        protected void RadGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {
            if (Cache["UtilzationData"] == null)
            {
                if (StartDatePicker.SelectedDate.HasValue && EndDatePicker.SelectedDate.HasValue)
                {
                    RadGrid.DataSource = rep.GetUnitUtilization(StartDatePicker.SelectedDate.Value, EndDatePicker.SelectedDate.Value);
                }
            }
            else
            {
                RadGrid.DataSource = Cache["UtilzationData"];
            }
        }
 
 
        protected void GenerateButton_Click(object sender, EventArgs e)
        {
            Cache.Remove("UtilzationData");
            Cache["UtilzationData"] = rep.GetUnitUtilization(StartDatePicker.SelectedDate.Value, EndDatePicker.SelectedDate.Value);
             
            RadGrid.DataSource = rep.GetUnitUtilization(StartDatePicker.SelectedDate.Value, EndDatePicker.SelectedDate.Value);
            RadGrid.DataBind();
             
        }
 
        protected void RadGrid_DetailTableDataBind(object source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
        {
            GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
            switch (e.DetailTableView.Name)
            {
                case "Orders":
                    {
                        DataTable table = new DataTable();
                        table.Columns.Add("UnitId", typeof(string));
                        table.Columns.Add("Date", typeof(DateTime));
                        table.Columns.Add("BillNumber", typeof(string));
                        table.Columns.Add("Status", typeof(string));
                        table.Columns.Add("Origin", typeof(string));
                        table.Columns.Add("Destination", typeof(string));
                        table.Columns.Add("XCharge", typeof(decimal));
                        table.Columns.Add("TotalCharges", typeof(decimal));
 
                        string UnitId = dataItem.GetDataKeyValue("UnitId").ToString();
                        IQueryable<UnitUtilization> data = (IQueryable<UnitUtilization>)Cache["UtilzationData"];
                        var results = from i in data
                                      where i.UnitId == UnitId
                                      select i.Orders;
 
                        foreach (var order in results)
                        {
                            foreach (Order o in order)
                            {
                                table.Rows.Add(o.UnitId, o.Date, o.BillNumber, o.Status, o.Origin, o.Destination, o.XCharges, o.TotalCharges);
                            }
                        }
                        e.DetailTableView.DataSource = table;
                        break;
                    }
 
            }
        }
 
        protected void RadGrid_PreRender(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                //RadGrid.MasterTableView.Items[0].Expanded = true;
                //RadGrid.MasterTableView.Items[0].ChildItem.FindControl("InnerContainer").Visible = true;
            }
        }
 
        protected void RadGrid_ItemCommand(object source, GridCommandEventArgs e)
        {
            if (e.CommandName == RadGrid.ExpandCollapseCommandName && e.Item is GridDataItem)
            {
                ((GridDataItem)e.Item).ChildItem.FindControl("InnerContainer").Visible =
                    !e.Item.Expanded;
            }
        }
 
        protected void RadGrid_ItemCreated(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridNestedViewItem)
            {
                e.Item.FindControl("InnerContainer").Visible = ((GridNestedViewItem)e.Item).ParentItem.Expanded;
                 
            }
        }
 
        protected void ExportButton_Click(object sender, System.EventArgs e)
        {
            RadGrid.MasterTableView.ExportToExcel();
        }
 
        protected void ChartButton_Click(object sender, EventArgs e)
        {
            foreach (GridDataItem item in RadGrid.MasterTableView.Items)
            {
                string UnitId = item["UnitId"].ToString();
            }
        }
    }
Angel Petrov
Telerik team
 answered on 31 Oct 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?