Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
111 views
I have 2 Radgrid ,1st Radgrid shows detail data with grouping and 2nd Radgrid shows total count ,i want to export data from both Radgrid to one excel file ,dataset for both Radgrid are different.

for this i have taken one another Parent Radgrid inside the div tag and above 2 Radgrids are inserted into the ItemTemplate column of
Parent RadGrid,data for both child Radgrid  binds on the Item_DataBound event of Parent Radgrid.Visibilty of div tag for Parnt Grid set to hidden.

I have used  "GridGroupByExpression" and " GridGroupByField" for grouping of 1st Child grid

Data successully bind to both child Radgrid and for export to excel i have used "RadGrid.MasterTableView.ExportToExcel()"syntax
Data for both child Radgrid shows in one excel file

but my issue is that after exporting  "grey colour patches"  are shown in excel sheet for 1child Radgrid with grouping .
due to which data is not properly visible and overlapped by the grey colur patches.please find the attached file "Report1.xls" for reference.

on removing the grouping "grey colour patches"  are not visible.

Any help or suggetion on  how to remove "grey colur patches " will be Grateful.

setting for Parent  Radgrid  OpenInNewWindow="True" IgnorePaging="True" ExportOnlyData = "false"

code snippet for Grouping:

GridGroupByExpression expression = new GridGroupByExpression();
            GridGroupByField gridGroupByField;

            gridGroupByField = new GridGroupByField();
            gridGroupByField.FieldName = ApplicationConstants.Reports.Name;
            gridGroupByField.HeaderText = "Report";
            gridGroupByField.HeaderValueSeparator = " : ";
            gridGroupByField.FormatString = "<strong>{0}</strong>";
            expression.SelectFields.Add(gridGroupByField);

         
            gridGroupByField = new GridGroupByField();
            gridGroupByField.FieldName = ApplicationConstants.Reports.Name;
            expression.GroupByFields.Add(gridGroupByField);



Code snippet for Export to excel:

            RadGrid.ExportSettings.OpenInNewWindow = true;
            RadGrid.Page.Response.ClearHeaders();
            RadGrid.Page.Response.Cache.SetCacheability(HttpCacheability.Private);

            RadGrid.ExportSettings.ExportOnlyData = false;
            RadGrid.ExportSettings.Excel.Format = GridExcelExportFormat.Html;
            RadGrid.MasterTableView.ExportToExcel();


   Environment details:

   Asp.Net  3.5 version
  OS : Windows server 2003
  Internet explorer : ie 6.0







Daniel
Telerik team
 answered on 21 Apr 2010
1 answer
52 views
Hi all,
  I haven't found any thread about common mistakes and pitfalls when using RAD controls.
Does such list exsist somewhere, if not I think it would be a nice thing to have.

Yours
    Bjössi
Sebastian
Telerik team
 answered on 21 Apr 2010
1 answer
121 views
Hello,

It seems I am having an issue with the grid adding un-needed functionality to my grid.  Specifically, I am trying to create an list of news articles, sorted by month (Jan, Feb, etc.) with the articles listed within each month.  I am NOT using skins for the control, and instead, using standard HTML code to format the list since our site is not using anything fancy at this moment.

What I would like to do is not have the button to allow the expanding/collapsing of the categories (see attached screen shot).  I tried using the documentation at this link (http://www.telerik.com/help/aspnet-ajax/grdpreventgroupsexpansion.html)  but it seems as though the code behind is not being read at runtime.  I am putting my code below so you can see how I have done this.  A quick response is greatly appreciated.  Thank you!

Kevin

The HTML:
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
    </telerik:RadScriptManager> 
        <telerik:RadGrid  
        ID="gridNews" 
        runat="server"  
        AutoGenerateColumns="false"  
        ShowHeader="false" EnableEmbeddedSkins="False"
<HeaderContextMenu EnableEmbeddedSkins="False"></HeaderContextMenu> 
 
        <MasterTableView DataKeyNames="NewsID" GroupLoadMode="Server"
                <GroupByExpressions>         
                    <telerik:GridGroupByExpression> 
                        <SelectFields> 
                            <telerik:GridGroupByField FieldName="MonthYear" HeaderText=" " SortOrder="None"></telerik:GridGroupByField>                                                         
                        </SelectFields> 
                        <GroupByFields> 
                            <telerik:GridGroupByField FieldName="MonthYear" HeaderText=" " SortOrder="Descending"></telerik:GridGroupByField>                            
                        </GroupByFields> 
                    </telerik:GridGroupByExpression>            
                </GroupByExpressions> 
            <Columns> 
            <telerik:GridTemplateColumn HeaderText="Date" GroupByExpression="Month Date Group By Month" DataType="System.DateTime" > 
            <ItemTemplate> 
            <b> 
                <asp:Label ID="Label1" runat="server" Text='<%# Eval("dtNewsDate") %>' DataType="System.DateTime" ></asp:Label></b
                <p> 
                    <b> 
                        <asp:Label ID="lblPublication" runat="server" Text='<%# Eval("strPublication") %>'></asp:Label></b><br /> 
                    <b> 
                        <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# Eval("strArticleLink") %>' 
                            Target="_blank"
                            <asp:Label ID="lblArticleTitle" runat="server" Text='<%# Eval("strArticleTitle") %>'></asp:Label> 
                        </asp:HyperLink></b
                    <br /> 
                    <asp:Label ID="lblArticleSynopsis" runat="server" Text='<%# Eval("strArticleSynopsis") %>'></asp:Label> 
                    <br /> 
                </p> 
            </ItemTemplate> 
            </telerik:GridTemplateColumn> 
            </Columns> 
 
<EditFormSettings> 
<EditColumn InsertImageUrl="Update.gif" UpdateImageUrl="Update.gif" EditImageUrl="Edit.gif" CancelImageUrl="Cancel.gif"></EditColumn> 
</EditFormSettings> 
        </MasterTableView> 
 
            <ClientSettings AllowExpandCollapse="False"
                <Resizing AllowColumnResize="True" /> 
            </ClientSettings> 
 
<FilterMenu EnableEmbeddedSkins="False"></FilterMenu> 
    </telerik:RadGrid> 

The code-behind:
using System; 
using System.Collections.Generic; 
using System.Linq; 
using System.Web; 
using System.Web.UI; 
using System.Web.UI.WebControls; 
using Telerik.Web.UI; 
 
public partial class AboutUs_NewsRoom_News : System.Web.UI.Page 
    protected void Page_Load(object sender, EventArgs e) 
    { 
        Master.imgHeroTitle = "~/img/hero-news.gif"
        Master.HeroClass = "hero_"
        ucAboutNav1.NewsPanel = true
 
        if (!IsPostBack) 
        { 
            LoadGrid(); 
        } 
 
    } 
    public void LoadGrid() 
    { 
        gridNews.DataSource = new List<string>(0); 
        gridNews.DataBind(); 
        gridNews.DataSource = MainName.core.CMS.News.GetNewsList(); 
        gridNews.DataBind(); 
 
        MainName.core.CMS.News n = new MainName.core.CMS.News(); 
        n.dtNewsDate.Month.ToString(); 
    } 
 
    protected void gridNews_ColumnCreated(object sender, GridColumnCreatedEventArgs e) 
    { 
        if (e.Column is GridGroupSplitterColumn) 
        { 
            e.Column.HeaderStyle.Width = Unit.Pixel(1); 
            e.Column.HeaderStyle.Font.Size = FontUnit.Point(1); 
            e.Column.ItemStyle.Width = Unit.Pixel(1); 
            e.Column.ItemStyle.Font.Size = FontUnit.Point(1); 
            e.Column.Resizable = false
        } 
    } 
    protected void gridNews_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridGroupHeaderItem) 
        { 
            (e.Item as GridGroupHeaderItem).Cells[0].Controls.Clear(); 
        } 
    } 

Pavlina
Telerik team
 answered on 21 Apr 2010
1 answer
125 views
I have the following code on item command

 

protected void RadGrid_ItemCommand(object source, GridCommandEventArgs e)

 

{

 

if (e.CommandName == RadGrid.InitInsertCommandName)

 

{

 

// cancel the default operation

 

e.Canceled =

true;

 

 

//Prepare an IDictionary with the predefined values

 

System.Collections.Specialized.

ListDictionary newValues = new System.Collections.Specialized.ListDictionary();

 

 

//set default checked state for the checkbox inside the EditItemTemplate

 

newValues[

"SET0"] = false;

 

 

//Insert the item and rebind

 

e.Item.OwnerTableView.InsertItem(newValues);

}

}

This sets the dafault value of a checkbox to false on an insert.
When there is data in the table already this works but if the table is empty I get
"Sys.WebForms.PageRequestManagerServerErrorException: Collection was modified; enumeration operation may not execute."
any suggestions?

Nikolay Rusev
Telerik team
 answered on 21 Apr 2010
5 answers
137 views
Hi there,

We have a grid that uses resize= true and context menu = true
The problem is that when hide columns and resize the column the column goes wild.. i mean if we go to the left, its column goes to the right and vice versa......

I found out the hiding columns can ruin your grid resizing property...

Is there a workaround to make it work... I would like to hide and show columns in my grid and i can resize my grid column at the same time

Thanks,
Nikolay Rusev
Telerik team
 answered on 21 Apr 2010
1 answer
126 views
Hi,

Can I use SSL with RAD upload control ? Does the certificate have to be installed on the web page using this control?

Thanks
T. Tsonev
Telerik team
 answered on 21 Apr 2010
2 answers
285 views
Hi ,

            i am Popluating my radCombobox using databinding ,after populating it ,i want a sppecfic value to be shown as default value , so using
        RadComboBox.Selectedvalue = "Apple" ; 

But  using the Selectedvalue( ) Property i couldnt change the value . 

Thanks,
LijiJose
        
Liji Jose
Top achievements
Rank 1
 answered on 21 Apr 2010
1 answer
82 views
I have a Telerik RadGrid that is bound to a Linq Datasource. On the intial page load, the data shows up fine in the RadGrid. If I remain on Page 1 and filter the data, it shows correctly. However, if I go to page 2 or 3 or any page but the first 1 and filter the data, it does not display in the RadGrid. I examined the sql that linq is generating in the immediate window and it is generating the proper sql and bringing back results, but it is not displaying in the radgrid when I page to any page but the first.
Pavlina
Telerik team
 answered on 21 Apr 2010
4 answers
97 views
What attributes make combobox float left, thank you
Dimo
Telerik team
 answered on 21 Apr 2010
4 answers
538 views
How can I support data-binding in a user control (ascx) when I am using Page.LoadControl to load a page into a MultiPage PageView which I am creating at runtime? 

The Tabstrip / Load on Demand RadPageView demo does use a datasource but Eval() or Bind() methods are not being used.

I don't want to move my FormView into the user control as there a additional user controls, one for each tab infact.  Must I do all my data binding in code-behind and not do anything declaratively in the user controls?  If so, is this best placed in the PageView OnLoad event or in an event of my user control?

What I am trying to achieve would make for a great demonstration: A fully-featured tabstrip of pages across a single, two-way databound form in which the code for each tab is stored in seperate files (user controls) instead of a single, large file.

Can you suggest other ways to achieve this?

I also understand that this question is more about data binding in user controls than it is about RadTabStrip however I suspect that anyone using RadMultiPage is likely to have addressed this problem before.

Thanks.
AdrianTaylor
Top achievements
Rank 1
 answered on 21 Apr 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?