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

Just looking for some clarification here. Would it be true to say that the main difference between RadMenu and RadNavigation is the Responsive behavior of the RadNavigation control? 

 I am trying to figure out which control to use, and am just in the beginning of my research into the new PageLayour and related parts of the Responsive infrastructure that Telerik offers. Is it possible to use the RadNavigation with images or templates? Furthermore, can those templates be turned on or off depending on the browser type it is being viewed with?

I would like to have a rich template based menu when viewed on a desktop client and the simple text-based menu on tablet or smartphone browsers.

 Any feedback would be greatly appreciated as I try to wrap my brain around all this!

Plamen
Telerik team
 answered on 13 Apr 2015
4 answers
263 views
I get below form RadGrid.MasterVradGrid.MasterTableView.FilterExpression
filterExpression="(RequiredDate = DateTime.Parse("1/27/2015 12:00:00 AM"))"
if (!string.IsNullOrWhiteSpace(filterExpression))
{
      query = query.Where(filterExpression);
}

Happen Exception.
======================================================================================================
An exception of type 'System.NotSupportedException' occurred in EntityFramework.SqlServer.dll but was not handled in user code

Additional information: LINQ to Entities does not recognize the method 'System.DateTime Parse(System.String)' method, and this method cannot be translated into a store expression.
======================================================================================================

Because I use EF6 it no support 'System.DateTime.Parse' method

I want change filter expression ,I hope result below example.
query = query.Where("(RequiredDate >= DateTime(2015,1,29))");

How Override Filter Pattern from RadGrid?
小章
Top achievements
Rank 1
 answered on 13 Apr 2015
5 answers
153 views
I'm using the RadGrid with a LinqDataSource and keep getting "The state information is invalid for this page and might be corrupted." error

What am I doing wrong?

The problem only occurs on the production server.
Windows Server 2008 setup in a web farm of 3 computers.

The following code generates an error. on the production server on postbacks (e.g. sorting, filtering or paging)... but not every single postback (about 1 in 3).
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="page2.aspx.cs" Inherits="site_admin_page2" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
    <div> 
        <asp:LinqDataSource ID="LinqDataSource1" runat="server"  
            onselecting="LinqDataSource1_Selecting"
        </asp:LinqDataSource> 
        <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
        </telerik:RadScriptManager> 
        <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True"  
            AllowPaging="True" AllowSorting="True" DataSourceID="LinqDataSource1"  
            GridLines="None"
            <MasterTableView DataSourceID="LinqDataSource1"
            <RowIndicatorColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
            </RowIndicatorColumn> 
 
            <ExpandCollapseColumn> 
            <HeaderStyle Width="20px"></HeaderStyle> 
            </ExpandCollapseColumn> 
            </MasterTableView> 
        </telerik:RadGrid> 
    </div> 
    </form> 
</body> 
</html> 
 

using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
 
public partial class site_admin_page2 : System.Web.UI.Page 
    protected void Page_Load(object sender, EventArgs e) 
    { 
 
    } 
    protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e) 
    { 
        DynamicData01DataContext dc = new DynamicData01DataContext(); 
 
        var products = from p in dc.tbl_Products 
                       select new 
                       { 
                           p.ProductID, 
                           p.ProductName, 
                           p.ProductPrice, 
                           p.ProductActive 
                       }; 
 
        e.Result = products; 
    } 
 

here is the complete error
Server Error in '/site' Application. 
The state information is invalid for this page and might be corrupted. 
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.Web.HttpException: The state information is invalid for this page and might be corrupted. 
 
Source Error: 
 
[No relevant source lines] 
 
 
Source File: c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\site\f1255035\ee4d6829\App_Web_page2.aspx.c2099ada.oslnjh5d.0.cs    Line: 0 
 
Assembly Load Trace: The following information can be helpful to determine why the assembly 'App_Web_page2.aspx.c2099ada.phfinkbb, Version=0.0.0.0, Culture=neutralPublicKeyToken=null' could not be loaded. 
 
WRN: Assembly binding logging is turned OFF. 
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. 
Note: There is some performance penalty associated with assembly bind failure logging. 
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. 
 
 
Stack Trace: 
 
[FileNotFoundException: Could not load file or assembly 'App_Web_page2.aspx.c2099ada.phfinkbb, Version=0.0.0.0, Culture=neutralPublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.] 
   System.RuntimeTypeHandle._GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, Boolean loadTypeFromPartialName) +0 
   System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +64 
   System.RuntimeType.PrivateGetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark) +58 
   System.Type.GetType(String typeName, Boolean throwOnError) +59 
   System.Web.UI.ObjectStateFormatter.DeserializeType(SerializerBinaryReader reader) +153 
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +8625890 
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +291 
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +291 
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +291 
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +784 
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +392 
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +291 
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +404 
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +291 
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +404 
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +404 
   System.Web.UI.ObjectStateFormatter.DeserializeValue(SerializerBinaryReader reader) +392 
   System.Web.UI.ObjectStateFormatter.Deserialize(Stream inputStream) +135 
 
[ArgumentException: The serialized data is invalid.] 
   System.Web.UI.ObjectStateFormatter.Deserialize(Stream inputStream) +199 
   System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +291 
   System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) +4 
   System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37 
   System.Web.UI.HiddenFieldPageStatePersister.Load() +113 
 
[ViewStateException: Invalid viewstate.  
    Client IP: 122.111.98.153 
    Port: 57393 
    User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.1.3) Gecko/20090824 Firefox/3.5.3 (.NET CLR 3.5.30729) 
    ViewState: /wEPDwUJMTU0NjY3OTgxD2QWAgIDD2QWBAIBDw9kPCsABgBkAgUPPCsADQIAFCsAAg8WCB4LXyFJdGVtQ291bnQCAR4LXyFEYXRhQm91bmRnHhdFbmFibGVBamF4U2tpblJlbmRlcmluZ2geC0VkaXRJbmRleGVzFgBkFwEFD1NlbGVjdGVkSW5kZXhlcxYAARYCFgpkFCsABBQrAAUWEB4KSGVhZGVyVGV4dAUJUHJvZHVjdElEHglEYXRhRmllbGQFCVByb2R1Y3RJRB4DX3NlBQlQcm9kdWN0SUQeCFJlYWRPbmx5Zx4IRGF0YVR5cGUZKwEeBG9pbmQCAh4EX2NmdmQeBF9jZmZkZGRkBQlQcm9kdWN0SUQUKwAFFhAfBAULUHJvZHVjdE5hbWUfBQULUHJvZHVjdE5hbWUfBgULUHJvZHVjdE5hbWUfB2cfCBkrAh8JAgMfCmQfC2RkZGQFC1Byb2R1Y3ROYW1lFCsABRYQHwtkHwpkHwYFDFByb2R1Y3RQcmljZR8EBQxQcm9kdWN0UHJpY2UfBQUMUHJvZHVjdFByaWNlHwgZKVtTeXN0ZW0uRGVjaW1hbCwgbXNjb3JsaWIsIFZlcnNpb249Mi4wLjAuMCwgQ3VsdHVyZT1uZXV0cmFsLCBQdWJsaWNLZXlUb2tlbj1iNzdhNWM1NjE5MzRlMDg5HwdnHwkCBGRkZAUMUHJvZHVjdFByaWNlFCsABRYQHwQFDVByb2R1Y3RBY3RpdmUeA19kZgUNUHJvZHVjdEFjdGl2ZR8GBQ1Qcm9kdWN0QWN0aXZlHwdnHwgZKwMfCQIFHwpkHwtkZGRkBQ1Qc...] 
 
[HttpException (0x80004005): The state information is invalid for this page and might be corrupted.] 
   System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +106 
   System.Web.UI.ViewStateException.ThrowViewStateError(Exception inner, String persistedState) +14 
   System.Web.UI.HiddenFieldPageStatePersister.Load() +217 
   System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +105 
   System.Web.UI.Page.LoadAllState() +43 
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6785 
   System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +242 
   System.Web.UI.Page.ProcessRequest() +80 
   System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +21 
   System.Web.UI.Page.ProcessRequest(HttpContext context) +49 
   ASP.site_admin_page2_aspx.ProcessRequest(HttpContext context) in c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\site\f1255035\ee4d6829\App_Web_page2.aspx.c2099ada.oslnjh5d.0.cs:0 
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +181 
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75 
 
 
Version Information: Microsoft .NET Framework Version:2.0.50727.4016; ASP.NET Version:2.0.50727.4016  

I've looked everywhere to see what the problem to this is... the following link is the closest to help identify the problem that I've come across even though it's an old post seems to be the same sort of problem
http://www.telerik.com/community/forums/aspnet-ajax/grid/does-current-futures-build-support-linq-datasources.aspx

To test I've created the same page but linked the LinqDataSource to a GridView and don't get the error paging and sorting work fine.
<html xmlns="http://www.w3.org/1999/xhtml"
<head runat="server"
    <title></title
</head> 
<body> 
    <form id="form1" runat="server"
    <div> 
        <asp:LinqDataSource ID="LinqDataSource1" runat="server"  
            onselecting="LinqDataSource1_Selecting"
        </asp:LinqDataSource> 
         
        <asp:GridView ID="GridView1" runat="server" AllowPaging="True"  
            AllowSorting="True" DataSourceID="LinqDataSource1"
        </asp:GridView> 
    </div> 
    </form> 
</body> 
</html> 
 

also if I just change the LinqDataSource1_Selecting to not use "select new { ... } I also don't get the error... e.g.
    protected void LinqDataSource1_Selecting(object sender, LinqDataSourceSelectEventArgs e) 
    { 
        DynamicData01DataContext dc = new DynamicData01DataContext(); 
 
        var products = from p in dc.tbl_Products 
                       select p; 
 
        e.Result = products; 
    } 


Please help... I really need to fix this problem.
Have I missed something obvious?
Could this have something to do with the Production server running as a webfarm?
Has anyone else experienced this problem?



Peter
Top achievements
Rank 1
 answered on 13 Apr 2015
4 answers
871 views
Hi, I am able to export radgrid to excel and pdf. But for excel exporting my grouped column is not exported. Could you please let me know how that works.
I am attaching my radgrid code. Also, i just want HA rollout as group header column and not HAtype. how to do that?
<telerik:RadGrid ID="rgCurrentPromo" runat="server"   Skin="Windows7" OnBiffExporting="rgCurrentPromo_BiffExporting" PageSize="30"  AllowPaging="true" AllowSorting="True">
           <%-- <telerik:RadGrid ID="rgCurrentPromo" runat="server" GridLines="None" AllowSorting="true" Skin="Windows7" Width="745px"  OnItemCreated="rgCurrentPromo_ItemCreated" AutoGenerateColumns="False" AllowPaging="true"> --%>
           <ExportSettings IgnorePaging="true" OpenInNewWindow="true">
         <Pdf PageHeight="210mm" PageWidth="330mm" DefaultFontFamily="Arial Unicode MS" PageTopMargin="30mm" 
              BorderStyle="Medium" BorderColor="#666666"
          </Pdf>
                      
      </ExportSettings>
          <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>
              <MasterTableView AutoGenerateColumns="False"  CommandItemDisplay="Top" UseAllDataFields="true">
                  <CommandItemSettings ShowExportToExcelButton="true"   ShowExportToPdfButton="true" />
                  <CommandItemTemplate>
                       <asp:Button ID="ExporttoExcel" runat="server" Text="Export To Excel" CommandName="ExporttoExcel"   OnClick="b1_Click"/>
                     <asp:Button ID="ExportoPDF" runat="server" CommandName="ExporttoPDF" Text="Export To PDF" OnClick="b2_Click" />
                     <%--<asp:ImageButton ID="DownloadPDF" runat="server" OnClick="DownloadPDF_Click" ImageUrl="~/Grid/Examples/Functionality/Exporting/Export-Word-CSV/images/file-extension-pdf-icon.png"
      CssClass="pdfButton"></asp:ImageButton>--%>
                  </CommandItemTemplate>
                     <GroupByExpressions>
              <telerik:GridGroupByExpression>
                  <SelectFields>
                      <telerik:GridGroupByField FieldName="HA" FieldAlias="HAType" />
                  </SelectFields>
                  <GroupByFields>
                      <telerik:GridGroupByField FieldName="HA" />
                  </GroupByFields>
              </telerik:GridGroupByExpression>
          </GroupByExpressions>
          <GroupHeaderItemStyle Font-Bold="true" Font-Size="120%" />
              <Columns>
                    <telerik:GridBoundColumn DataField="CUSTOMER_NAME"  FilterControlAltText="Filter CUSTOMER_NAME column" HeaderText="Customer" ReadOnly="True" SortExpression="CUSTOMER_NAME" UniqueName="CUSTOMER_NAME">
                      <ColumnValidationSettings>
                          <ModelErrorMessage Text="" />
                      </ColumnValidationSettings>
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="PROMO_NO" DataType="System.Int32" FilterControlAltText="Filter PROMO_NO column" HeaderText="PN" ReadOnly="True" SortExpression="PROMO_NO" UniqueName="PROMO_NO">
                      <ColumnValidationSettings>
                          <ModelErrorMessage Text="" />
                      </ColumnValidationSettings>
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="PROMO_NM" FilterControlAltText="Filter PROMO_NM column" HeaderText="Promo Name" SortExpression="PROMO_NM" UniqueName="PROMO_NM">
                      <ColumnValidationSettings>
                          <ModelErrorMessage Text="" />
                      </ColumnValidationSettings>
                  </telerik:GridBoundColumn>
                  
                  <telerik:GridBoundColumn DataField="PROMO_DATE" DataType="System.DateTime" FilterControlAltText="Filter PROMO_DATE column" HeaderText="Start Dt" SortExpression="PROMO_DATE"  UniqueName="PROMO_DATE"  DataFormatString="{0:dd/MM/yyyy}">
                      <ColumnValidationSettings>
                          <ModelErrorMessage Text="" />
                      </ColumnValidationSettings>
                  </telerik:GridBoundColumn
                 <telerik:GridBoundColumn DataField="HA" FilterControlAltText="Filter HA column" HeaderText="HA" SortExpression="HA" UniqueName="HA">
                      <ColumnValidationSettings>
                          <ModelErrorMessage Text="" />
                      </ColumnValidationSettings>
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="PROMO_DESC" FilterControlAltText="Filter PROMO_DESC column" HeaderText="Description" SortExpression="PROMO_DESC" UniqueName="PROMO_DESC">
                      <ColumnValidationSettings>
                          <ModelErrorMessage Text="" />
                      </ColumnValidationSettings>
                  </telerik:GridBoundColumn>
                  <telerik:GridBoundColumn DataField="PROMO_END_DT" DataType="System.DateTime" FilterControlAltText="Filter PROMO_END_DT column" HeaderText="End Dt" SortExpression="PROMO_END_DT" UniqueName="PROMO_END_DT" DataFormatString="{0:dd/MM/yyyy}">
                      <ColumnValidationSettings>
                          <ModelErrorMessage Text="" />
                      </ColumnValidationSettings>
                  </telerik:GridBoundColumn>
                </Columns>
          </MasterTableView>
          <ClientSettings AllowDragToGroup="true" />
  <GroupingSettings ShowUnGroupButton="true" />
      </telerik:RadGrid>
Protected Sub rgCurrentPromo_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles rgCurrentPromo.NeedDataSource
     Using dbContext As New AthenaModel.EntitiesModel()
         Dim firstDate As Date = New DateTime(Now.Year, Now.Month, 1)
         'Select
         'Case when AUTH_CODE is  null Then 'Non-HA Rollout' Else 'HA Rollout' End  AS HA,CUSTOMER.CUSTOMER_NAME, PLUTO.TBLPROMOTIONCODE.PROMO_NO, PLUTO.TBLPROMOTIONCODE.PROMO_NM, PLUTO.TBLPROMOTIONCODE.PROMO_DATE, PLUTO.TBLPROMOTIONCODE.PROMO_END_DT, PLUTO.TBLPROMOTIONCODE.PROMO_DESC
         'FROM PLUTO.TBLPROMOTIONCODE INNER JOIN CUSTOMER ON PLUTO.TBLPROMOTIONCODE.CUSTOMER_ID = CUSTOMER.CUSTOMER_ID
         'WHERE PLUTO.TBLPROMOTIONCODE.PROMO_END_DT>=TRUNC (SYSDATE, 'month') Or PLUTO.TBLPROMOTIONCODE.PROMO_END_DT Is Null;
         Dim query = (From p In dbContext.TBLPROMOTIONCODEs
                 Join c In dbContext.CUSTOMERs On p.CUSTOMER_ID Equals c.CUSTOMER_ID
                 Where p.PROMO_END_DT >= firstDate Or p.PROMO_END_DT Is Nothing
                 Select c.CUSTOMER_NAME, p.PROMO_NO, p.PROMO_NM, p.PROMO_END_DT, p.PROMO_DATE, p.PROMO_DESC, HA = If(p.AUTH_CODE Is Nothing, "Non-HA Rollout", "HA Rollout")).ToList()
         ' Select c.CUSTOMER_NAME, p.PROMO_NO, p.PROMO_NM, promo_enddt = String.Format("{0:MM/dd/yyyy}", p.PROMO_END_DT), promo_dt = String.Format("{0:MM/dd/yyyy}", p.PROMO_DATE), p.PROMO_DESC, HA = IIf(p.AUTH_CODE Is Nothing, "Non-HA Rollout", "HA Rollout")).ToList()
         rgCurrentPromo.DataSource = query
         'rgCurrentPromo.DataBind()
     End Using
 End Sub
 Private isPdfExport As Boolean = False
 Protected Sub rgCurrentPromo_ItemCreated(sender As Object, e As GridItemEventArgs)
     If isPdfExport Then
         FormatGridItem(e.Item)
     End If
     'If TypeOf e.Item Is GridHeaderItem Then
     '    Dim row As RowElement = New RowElement()
     '    Dim cell As CellElement = New CellElement()
     '    cell.MergeAcross = e.Row.Cells.Count - 1
     '    cell.Data.DataItem = "VETS-100A Detail Report from " & AsofReportFromDate & " To " & AsofReportToDate & "  Reporting Time : " & Date.Now.ToString("MM-dd-yyyy H:mm:ss")
     '    cell.StyleValue = "headStyle"
     '    row.Cells.Add(cell)
     '    e.Worksheet.Table.Rows.Insert(0, row)
     '    e.Worksheet.AutoFilter.Range = e.Worksheet.AutoFilter.Range.Replace("R1", "R2")
     'End If
 End Sub
 Protected Sub FormatGridItem(item As GridItem)
     item.Style("color") = "#eeeeee"
     If TypeOf item Is GridDataItem Then
         item.Style("vertical-align") = "middle"
         item.Style("text-align") = "center"
     End If
     Select Case item.ItemType
         'Mimic RadGrid appearance for the exported PDF file 
         Case GridItemType.Item
             item.Style("background-color") = "#4F4F4F"
             Exit Select
         Case GridItemType.AlternatingItem
             item.Style("background-color") = "#494949"
             Exit Select
         Case GridItemType.Header
             item.Style("background-color") = "#2B2B2B"
             Exit Select
         Case GridItemType.CommandItem
             item.Style("background-color") = "#000000"
             Exit Select
     End Select
     If TypeOf item Is GridCommandItem Then
         'needed to span the image over the CommandItem cells 
         item.PrepareItemStyle()
     End If
 End Sub
 'Protected Sub rgCurrentPromo_ItemCommand(ByVal sender As Object, ByVal e As GridCommandEventArgs) Handles rgCurrentPromo.ItemCommand
 '    If e.CommandName = RadGrid.ExportToPdfCommandName Then
 '        isPdfExport = True
 '        rgCurrentPromo.MasterTableView.GetColumn("CUSTOMER_NAME").HeaderStyle.Width = Unit.Pixel(120)
 '        rgCurrentPromo.MasterTableView.GetColumn("PROMO_NO").HeaderStyle.Width = Unit.Pixel(100)
 '        rgCurrentPromo.MasterTableView.GetColumn("PROMO_NM").HeaderStyle.Width = Unit.Pixel(100)
 '        rgCurrentPromo.MasterTableView.GetColumn("PROMO_END_DT").HeaderStyle.Width = Unit.Pixel(100)
 '        rgCurrentPromo.MasterTableView.GetColumn("PROMO_DATE").HeaderStyle.Width = Unit.Pixel(100)
 '        rgCurrentPromo.MasterTableView.GetColumn("PROMO_DESC").HeaderStyle.Width = Unit.Pixel(100)
 '        rgCurrentPromo.MasterTableView.GetColumn("HA").HeaderStyle.Width = Unit.Pixel(120)
 '    End If
 'End Sub
 Protected Sub DownloadPDF_Click(sender As Object, e As EventArgs)
     isPdfExport = True
     rgCurrentPromo.MasterTableView.ExportToPdf()
 End Sub
 Protected Sub rgCurrentPromo_ItemCommand(sender As Object, e As Telerik.Web.UI.GridCommandEventArgs)
     If e.CommandName = RadGrid.ExportToExcelCommandName Then
         rgCurrentPromo.ExportSettings.HideStructureColumns = False
         rgCurrentPromo.Rebind()
     End If
 End Sub
 Private isExporting As Boolean = False
 Protected Sub b1_Click(ByVal sender As Object, ByVal e As EventArgs)
     isExporting = True
     rgCurrentPromo.ExportSettings.Excel.Format = GridExcelExportFormat.Biff
     rgCurrentPromo.ExportSettings.IgnorePaging = True
     rgCurrentPromo.ExportSettings.ExportOnlyData = False
     rgCurrentPromo.MasterTableView.AllowPaging = False
     ' rgCurrentPromo.ExportSettings.
     rgCurrentPromo.ExportSettings.FileName = "Current_Promotions"
     rgCurrentPromo.ExportSettings.OpenInNewWindow = True
     rgCurrentPromo.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None
     rgCurrentPromo.MasterTableView.HierarchyDefaultExpanded = True
     rgCurrentPromo.ExportSettings.HideStructureColumns = "false"
     ' rgCurrentPromo.MasterTableView.GroupHeaderTemplate.
  
     'Response.Clear()
     'Response.Buffer = True
     'Response.ContentType = "application/vnd.ms-excel"
     'Response.Charset = ""
     'Me.EnableViewState = False
     'Dim oStringWriter As New System.IO.StringWriter()
     'Dim oHtmlTextWriter As New System.Web.UI.HtmlTextWriter(oStringWriter)
     'rgCurrentPromo.RenderControl(oHtmlTextWriter)
     'Response.Write(oStringWriter.ToString())
     'Response.End()
     rgCurrentPromo.Rebind()
     rgCurrentPromo.MasterTableView.ExportToExcel()
 End Sub
 Protected Sub b2_Click(ByVal sender As Object, ByVal e As EventArgs)
     isExporting = True
     rgCurrentPromo.ExportSettings.ExportOnlyData = False
     rgCurrentPromo.ExportSettings.FileName = "Current_Promotions"
     rgCurrentPromo.ExportSettings.OpenInNewWindow = True
     rgCurrentPromo.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None
     rgCurrentPromo.MasterTableView.HierarchyDefaultExpanded = True
     rgCurrentPromo.ExportSettings.Pdf.PageHeader.LeftCell.Text = headerLeftCell
     rgCurrentPromo.ExportSettings.Pdf.PageHeader.LeftCell.TextAlign = GridPdfPageHeaderFooterCell.CellTextAlign.Center
     rgCurrentPromo.MasterTableView.GroupHeaderItemStyle.BackColor = Drawing.Color.Red
     rgCurrentPromo.MasterTableView.ExportToPdf()
 End Sub
 Protected Sub rgCurrentPromo_ItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles rgCurrentPromo.ItemDataBound
     If isExporting Then
         If e.Item.ItemType = GridItemType.Header Then
             e.Item.BackColor = System.Drawing.Color.White
             e.Item.ForeColor = System.Drawing.Color.Blue
             ' e.Item.Font.Bold = True
             e.Item.Height = Unit.Point(20)
             e.Item.Font.Size = 11
             e.Item.HorizontalAlign = HorizontalAlign.Left
         End If
         If e.Item.ItemType = GridItemType.Item Then
             e.Item.HorizontalAlign = HorizontalAlign.Left
         End If
         If e.Item.ItemType = GridItemType.AlternatingItem Then
             e.Item.HorizontalAlign = HorizontalAlign.Left
         End If
         If e.Item.ItemType = GridItemType.GroupHeader Then
             e.Item.ForeColor = System.Drawing.Color.Red
         End If
     End If
 End Sub
 Protected Sub rgCurrentPromo_BiffExporting(ByVal sender As Object, ByVal e As GridBiffExportingEventArgs)
Daniel
Telerik team
 answered on 10 Apr 2015
1 answer
42 views

Hi,

 

When i in multirowselect true environment i cant highlight cell value and copy

I want both multirowselect and single cell selection facility. How can i keep both facility3

 

lakmal

 

 

 

Pavlina
Telerik team
 answered on 10 Apr 2015
3 answers
78 views

Hi!

I need to make context menu for whole tree. I have context menues for nodes. I need to have context menu in case of user clicking on tree and not on some node. How to make it?

Ivan Danchev
Telerik team
 answered on 10 Apr 2015
1 answer
101 views

I have a screen with several fields, the async upload control and a submit button.

I don't want the upload to take place until the submit button is clicked, as I cannot get the values of the fields on the screen until this time. These fields need to be stored on the same record as the image. The 'handler' is called when you 'select' the file and at this time I am storing a record in the database with the image.

I am able to store the image, get the key from the database, and then do an update to the data once 'submit' is pressed, but I would like to do just one insert command.

If the user decides to exit out of the screen, I have a record stored that is not complete with the rest of the screens information.

Thanks.

Hristo Valyavicharski
Telerik team
 answered on 10 Apr 2015
1 answer
462 views

Hi,

I'm a new to using telerik i want to associate my column to one header text 

in the first pic i have 2 colomn ID STATION adn TIME TAG

i want have                            

                              STATION XXX

              ID STATION              TIME TAG

and in the seconde pic i have create 2 column programmatically 

plz help me

Regards,

Essoufi

Konstantin Dikov
Telerik team
 answered on 10 Apr 2015
1 answer
62 views

Hi,

I am trying to apply my own custom CSS on one of our SharePoint page but I can't seem to make it work. It's for the ContentArea editor when editing a text area. Based on my research, I've read that I have to declare the CSS in the ConfigFile.xml. Also, I've put the actual CSS file under this path:

​

C:\Program Files\Common Files\microsoft shared\Web Server Extensions\wpresources\RadEditorSharePoint\7.2.1.0__1f131a624888eeed\Resources

 

The ConfigFile.xml looks something like this:

<configuration>
<!--<property name="ContentAreaMode">Div</property>-->
<property name="ContentAreaCssFile">
<item>CssEditorCustom.css</item>
</property>
<property name="ToolbarMode">ShowOnFocus</property>
<property name="ToolsWidth">640px</property>  
<property name="ImagesPaths">
<item>/SiteCollectionDocuments</item>
<item>/SiteCollectionImages</item>
</property>
<property name="MaxImageSize">10485760</property>
</configuration>

 

After doing the above, the CSS seems to be not working (i.e. font size, margin, padding, etc.) I haven't noticed any difference.

Am I missing something? Can you please point me to the right direction?

 

Hoping to hear from you soon.

Cheers,
Arnelio

 

 

Marin Bratanov
Telerik team
 answered on 10 Apr 2015
1 answer
100 views

Hi

My Grid is in Batch mode and Has Template column.

 How we can save all changes from external button from server side?

 Thanks

 

 

Pavlina
Telerik team
 answered on 10 Apr 2015
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Iron
Iron
Iron
Atul
Top achievements
Rank 1
Iron
Iron
Alexander
Top achievements
Rank 1
Veteran
Iron
Serkan
Top achievements
Rank 1
Iron
Shawn
Top achievements
Rank 1
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?