Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
192 views
Hi,

I am trying to export the data in the grid using Radgrid export excel feature. Export works fine. But when i trying to do custom formting the rows it is throwing error when opening the excel "Prorblem came up in the following area during load" dialog of excel shows.

Below is the code i am using for custom formating. I  found the same code in Radgrid help too. It is working at the sample project present online in Radcontros site. Any help would be appreciated.

protected void rgGrid_ExcelMLExportRowCreated(object source, Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowCreatedArgs e)

{

 if (e.RowType == Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLRowType.DataRow)
 {
 if (e.Row.Cells[5] != null && (e.Row.Cells[5].Data.DataItem).Equals("I")){
 e.Row.Cells[0].StyleValue = "InsertStyle";
 }

 if (e.Row.Cells[5] != null && (e.Row.Cells[5].Data.DataItem).Equals("U")){
 e.Row.Cells[0].StyleValue = "UpdateStype";
 }

 if (e.Row.Cells[5] != null && (e.Row.Cells[5].Data.DataItem).Equals("D")){
 e.Row.Cells[0].StyleValue = "DeleteStyle";
 }
 }

}

 

 

protected void rgGrid_ExcelMLExportStylesCreated(object source, Telerik.Web.UI.GridExcelBuilder.GridExportExcelMLStyleCreatedArgs e){

    foreach (Telerik.Web.UI.GridExcelBuilder.StyleElement style in e.Styles){
      if (style.Id == "headerStyle"){
 style.FontStyle.Bold = true;
        style.FontStyle.Color = System.Drawing.Color.Gainsboro;
         style.InteriorStyle.Color = System.Drawing.Color.Wheat;
        style.InteriorStyle.Pattern = Telerik.Web.UI.GridExcelBuilder.InteriorPatternType.Solid;

        }
         else if (style.Id == "itemStyle")
         {
          style.InteriorStyle.Color = System.Drawing.Color.WhiteSmoke;
          style.InteriorStyle.Pattern =     Telerik.Web.UI.GridExcelBuilder.InteriorPatternType.Solid;
       }
 else if (style.Id == "alternatingItemStyle")
 {
 style.InteriorStyle.Color = System.Drawing.Color.LightGray;
 style.InteriorStyle.Pattern = Telerik.Web.UI.GridExcelBuilder.InteriorPatternType.Solid;
 }

    }

    Telerik.Web.UI.GridExcelBuilder.StyleElement myStyle = new Telerik.Web.UI.GridExcelBuilder.StyleElement("InsertStyle");
    myStyle.FontStyle.Bold = true;
    myStyle.FontStyle.Italic = true;
    myStyle.InteriorStyle.Color = System.Drawing.Color.Gray;
    myStyle.InteriorStyle.Pattern = Telerik.Web.UI.GridExcelBuilder.InteriorPatternType.Solid;
    e.Styles.Add(myStyle);

    Telerik.Web.UI.GridExcelBuilder.StyleElement upStyle = new Telerik.Web.UI.GridExcelBuilder.StyleElement("UpdateStyle");
    upStyle.FontStyle.Bold = true;
    upStyle.FontStyle.Italic = true;
    upStyle.InteriorStyle.Color = System.Drawing.Color.Aqua;
    upStyle.InteriorStyle.Pattern = Telerik.Web.UI.GridExcelBuilder.InteriorPatternType.Solid;
    e.Styles.Add(upStyle);

    Telerik.Web.UI.GridExcelBuilder.StyleElement delStyle = new Telerik.Web.UI.GridExcelBuilder.StyleElement("DeleteStyle");
    delStyle.FontStyle.Bold = true;
    delStyle.FontStyle.Italic = true;
    delStyle.InteriorStyle.Color = System.Drawing.Color.Brown;
    delStyle.InteriorStyle.Pattern = Telerik.Web.UI.GridExcelBuilder.InteriorPatternType.Solid;
    e.Styles.Add(delStyle);

}

Maria Ilieva
Telerik team
 answered on 23 Sep 2008
2 answers
132 views
Hi,
       I am using radchart in my project.In  this  chart i am binding the datasource,assigning values for X and Y axis all in the runtime.The view of the chart is Bar.Here i have the problem is the y axis value is show correctly but in the x axis i am binding the month value.So actually it want to show the month name but in the x axis only the numbers will show like 1,2 etc......Here my codings are........


 Dim strsql As String

                Dim ds As New DataSet
                Dim conn As String = ConfigurationManager.ConnectionStrings("ConnectionString").ConnectionString
                Dim sqlconn As New SqlConnection(conn)
                strsql = "SELECT Month, QtyProduced FROM vw_productionyr WHERE year = " & Date.Today.Year
                Dim da As SqlDataAdapter = New SqlDataAdapter(strsql, sqlconn)
                da.Fill(ds)
              
                RadChart1.Series(0).Clear()
                RadChart1.Series(0).DataXColumn = "Month"
                RadChart1.Series(0).DataYColumn = "QtyProduced"
                             
                RadChart1.DataSource = ds
                RadChart1.DataBind()

                For i As Integer = 1 To RadChart1.Series.Count - 1
                    RadChart1.Series(i).Clear()
                Next

Help me to solve this problem and all i want to do in the runtime only.
Ves
Telerik team
 answered on 23 Sep 2008
1 answer
126 views
I just found out that the RadDatePicker does not seem to support dates earlier than 1980 (it throws an exception if it is set to earlier).

Can this be true?

This means that we cannot use RadDatePicker for birthdays, employment start days, anniveries, or practically any other date that I can think of that occured in the past.

Certainly I am missing the option that enables all dates.

Thanks.
Missing User
 answered on 23 Sep 2008
2 answers
95 views
Hi,

I have an issue while trying to display chinese characters in title of radchart control.Junk code is displayed in the title while other telerik controls are working fine.Could you try to help me on this.If any more details are need to be known , please let me know at the earliest.

Thanks,
Dileep.
Vladimir Milev
Telerik team
 answered on 23 Sep 2008
3 answers
158 views

i am actually trying to draw a line chart from the center of a pie chart but for this i will have to
find the center of a pie chart. i found the diameter but couldn't locate the center points. is there a way
to find the center so that i can then draw a line chart upto the circumference starting from that point? any help will
be highly appreciated.

Regards

Sanchit

Vladimir Milev
Telerik team
 answered on 23 Sep 2008
1 answer
109 views
hi,
i have one ".aspx" page and  rad chart control i have placed in this page,

Once i have loged in my application, this page will display but,
there is  some problem with the rad chart  rendering or rad chart images creation.
because of this my page does not show anything.
its not giving any error but process continusly running.
according to me there is some problem with creating the rad chart temporary image.

please give me if any one have solution for that.

Thank & Regards,
Rupal





Vladimir Milev
Telerik team
 answered on 23 Sep 2008
4 answers
158 views
Hello
I have a RadGrid (with detailtable) which I would like to hide the expandcollapseColumn. I tried the example that I found at this link:
http://www.telerik.com/help/aspnet-ajax/grdpreventgroupsexpansion.html

But it doesn't work for me. Maybe I'm missing something.
Please help!
Here is my code

<telerik:RadGrid DataSourceID="CustomerSource"

ID="RadGrid1"

autogeneratecolumns=False

runat="server" GridLines="None" ShowHeader=false OnColumnCreated="RadGrid1_ColumnCreated" OnPreRender="RadGrid1_PreRender">

<MasterTableView datasourceid="CustomerSource" HierarchyDefaultExpanded=true DataKeyNames="NO_FOURNISSEUR">

<RowIndicatorColumn Visible="False">

<HeaderStyle Width="20px"></HeaderStyle>

</RowIndicatorColumn>

<Columns >

<telerik:GridBoundColumn SortExpression="NO_FOURNISSEUR"

HeaderText="NO_FOURNISSEUR"

DataField="NO_FOURNISSEUR"

UniqueName="NO_FOURNISSEUR"

ReadOnly="true"

Visible="false">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="NOM"

HeaderText="NOM"

DataField="NOM"

UniqueName="NOM"

ReadOnly="true"

Visible="true">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="ADRESSE"

HeaderText="ADRESSE"

DataField="ADRESSE"

UniqueName="ADRESSE"

ReadOnly="true"

Visible="true">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="VILLE"

HeaderText="VILLE"

DataField="VILLE"

UniqueName="VILLE"

ReadOnly="true"

Visible="true">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="CODE_POSTAL"

HeaderText="CODE_POSTAL"

DataField="CODE_POSTAL"

UniqueName="CODE_POSTAL"

ReadOnly="true"

Visible="true">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="NO_TEL1"

HeaderText="NO_TEL1"

DataField="NO_TEL1"

UniqueName="NO_TEL1"

ReadOnly="true"

Visible="true">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="NO_FAX1"

HeaderText="NO_FAX1"

DataField="NO_FAX1"

UniqueName="NO_FAX1"

ReadOnly="true"

Visible="true">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="COURRIEL"

HeaderText="COURRIEL"

DataField="COURRIEL"

UniqueName="COURRIEL"

ReadOnly="true"

Visible="true">

</telerik:GridBoundColumn>

</Columns>

<DetailTables>

<telerik:GridTableView DataKeyNames="No_fournisseur_produit" ShowHeader=true DataSourceID="PanierItemSource" Name="Detail" >

<ParentTableRelation>

<telerik:GridRelationFields DetailKeyField="NO_FOURNISSEUR" MasterKeyField="NO_FOURNISSEUR" />

</ParentTableRelation>

<RowIndicatorColumn Visible="False">

<HeaderStyle Width="20px"></HeaderStyle>

</RowIndicatorColumn>

<Columns>

<telerik:GridButtonColumn ButtonType=LinkButton UniqueName="LkConfirmer" CommandName="ConfirmerUnItem" Text="Confirmer">

</telerik:GridButtonColumn>

<telerik:GridBoundColumn

HeaderText="NO_PANIER"

DataField="NO_PANIER"

UniqueName="NO_PANIER"

ReadOnly="true"

Visible="true">

</telerik:GridBoundColumn>

<telerik:GridBoundColumn SortExpression="CONFIRM"

HeaderText="CONFIRM"

DataField="CONFIRM"

UniqueName="CONFIRM"

ReadOnly="true"

Visible="true">

</telerik:GridBoundColumn>

<telerik:GridTemplateColumn HeaderText="Temp2" UniqueName="Temp2"></telerik:GridTemplateColumn>

</Columns>

<EditFormSettings>

<PopUpSettings ScrollBars="None"></PopUpSettings>

</EditFormSettings>

</telerik:GridTableView>

</DetailTables>

<EditFormSettings>

<PopUpSettings ScrollBars="None"></PopUpSettings>

</EditFormSettings>

<ExpandCollapseColumn Visible=false Resizable=false></ExpandCollapseColumn>

</MasterTableView>

<ClientSettings>

<Resizing AllowColumnResize="True" />

</ClientSettings>

</telerik:RadGrid>

Protected Sub RadGrid1_ColumnCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridColumnCreatedEventArgs) Handles RadGrid1.ColumnCreated

If TypeOf e.Column Is GridGroupSplitterColumn Then

e.Column.HeaderStyle.Width = Unit.Pixel(0)

e.Column.HeaderStyle.Font.Size = FontUnit.Point(0)

e.Column.ItemStyle.Width = Unit.Pixel(0)

e.Column.ItemStyle.Font.Size = FontUnit.Point(0)

e.Column.Resizable =

False

End If

End Sub 'RadGrid1_ColumnCreated



Protected Sub RadGrid1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.PreRender

For Each column As GridColumn In RadGrid1.MasterTableView.RenderColumns

If (TypeOf column Is GridGroupSplitterColumn) Then

column.HeaderStyle.Width = Unit.Pixel(0)

column.HeaderStyle.Font.Size = FontUnit.Point(0)

column.ItemStyle.Width = Unit.Pixel(0)

column.ItemStyle.Font.Size = FontUnit.Point(0)

column.Resizable =

False

End If

Next

End Sub

Shinu
Top achievements
Rank 2
 answered on 23 Sep 2008
1 answer
139 views
Stange, I cant seem to change the editform width :$0$0$0$0$0$0        <EditFormSettings EditFormType="Template"  FormStyle-Width="600px">$0$0             <EditColumn UniqueName="EditCommandColumn1">$0$0             </EditColumn>$0$0             <FormStyle Height="400px" Width="600px" />$0$0             <FormTemplate    >$0$0$0$0$0$0regardless of the width setting my popup form is always the same width, am I looking at the wrong property?$0$0$0$0$0thanks$0$0$0$0$0
Shinu
Top achievements
Rank 2
 answered on 23 Sep 2008
1 answer
799 views
On selectedindexchanged - i want to get the selected row and each column values and assign them to labels.

I can get the value of one of the column's of the selected row:        rgMain.SelectedItems[0].OwnerTableView.DataKeyValues[rgMain.SelectedItems[0].ItemIndex]["id"];

I need to get all the column values for the selected row.

Isn't there a way to get the values based on rgMain.SelectedItems[0].ItemIndex and the column names?

So if i have 3 columns: id, name, desc

I want to get the values of name and desc using the selectedrow on selectedindexchanged


Shinu
Top achievements
Rank 2
 answered on 23 Sep 2008
3 answers
95 views
Hi!

I have tried to use this written function in java

function SetFirstRowActive() 

  var grid = window["<%= RadGrid1.ClientID %>"]; 
  grid.SetActiveRow(grid.MasterTableView.Rows[0]); 
}

but with an example that I have carried out it does not work you can kindly give a complete example to me working with this function?.

Thanks I attend a your answer.
Princy
Top achievements
Rank 2
 answered on 23 Sep 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?