Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
369 views
I have a radgrid which includes a customized gridtemplatecolumn.  When I export to Excel, it leaves out the customized column.  Can someone show me how to export the column?  I am attaching my front and backend code and a screenshot.  The column name is "Open Items by Age" and includes three data elements.  Also, it there a way to clean up the column so it does not have the weird lines showing in the table.  I set table border to zero.  Thank in advance!

<telerik:RadGrid ID="grdCurrentandPrior" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                            GridLines="Horizontal" Skin="Web20" Style="margin-right: 0px" Width="897px" Height="252px"
                            OnNeedDataSource="grdCurrentandPrior_NeedDataSource" OnExcelMLExportRowCreated="grdCurrentandPrior_ExcelMLExportRowCreated"
                            OnSortCommand="grdCurrentandPrior_SortCommand">
                            <exportsettings filename="OpenItemsCurrentInventory" ignorepaging="True" openinnewwindow="True"
                                exportonlydata="true" excel-format="ExcelML">
                            </exportsettings>
                            <mastertableview commanditemdisplay="Bottom" allownaturalsort="false" usealldatafields="true">
                                <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false"
                                    ShowRefreshButton="false" />
                                <Columns>
                                    <telerik:GridTemplateColumn DataField="Assignee" HeaderText="Assignee" UniqueName="Assignee"
                                        SortExpression="Assignee">
                                        <HeaderStyle Font-Bold="True" Width="150px" HorizontalAlign="Center" Font-Names="Arial" />
                                        <ItemTemplate>
                                            <asp:Label ID="lbAssignee" runat="server" Text='<%# Eval("Assignee") %>'></asp:Label>
                                        </ItemTemplate>
                                        <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="State" HeaderText="State" UniqueName="State"
                                        SortExpression="State" Visible="false">
                                        <HeaderStyle Font-Bold="True" Width="150px" HorizontalAlign="Center" Font-Names="Arial" />
                                        <ItemTemplate>
                                            <asp:Label ID="lbState" runat="server" Text='<%# Eval("State") %>'></asp:Label>
                                        </ItemTemplate>
                                        <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="JurisdictionCount" HeaderText="Jurisdictions"
                                        UniqueName="JurisdictionCount" SortExpression="JurisdictionCount">
                                        <HeaderStyle Font-Bold="True" Width="80px" HorizontalAlign="Center" Font-Names="Arial" />
                                        <ItemTemplate>
                                            <asp:Label ID="lbJurisdiction" runat="server" Text='<%# Eval("JurisdictionCount", "{0:N0}")%>'></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                        <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                    </telerik:GridTemplateColumn>                 
             <telerik:GridTemplateColumn UniqueName="OpenItemsByAge" >
        <HeaderTemplate>
          <table id="Table1" cellspacing="0" cellpadding="0" width="300" border="0">
            <tr>
              <td colspan="3" align="center">
                <b>Open Items by Age</b>
              </td>
            </tr>
           <tr>
                                    <td align="center" style="width: 33%">
<asp:LinkButton CssClass="Button" ID="btnPrioOpen" Text="Prior" 
CommandName='Sort' CommandArgument='OpenItemsCountPrior' runat="server" /></td>
                                    <td align="center" style="width: 33%">
<asp:LinkButton CssClass="Button" ID="btnLastMonth" Text="Last Month" 
CommandName='Sort' CommandArgument='OpenItemsCountLastMonth' runat="server" /></td>
                                    <td align="center" style="width: 34%">
<asp:LinkButton CssClass="Button" ID="btnCurrentOpen" Text="Current" 
CommandName='Sort'  CommandArgument='OpenItemsCountCurrent' runat="server" /></td>
                                </tr>
          </table>
        </HeaderTemplate>
        <ItemTemplate >
          <table id="Table2" cellspacing="0" cellpadding="0" width="300" border="0">
            <tr>
              <td align="right" width="33%">
                <%# Eval("OpenItemsCountPrior", "{0:N0}") %>
              </td>
   <td align="right" width="33%">
                <%# Eval("OpenItemsCountLastMonth", "{0:N0}")%>
              </td>              
              <td align="right" width="34%">
                <%#  Eval("OpenItemsCountCurrent", "{0:N0}") %>
              </td>
            </tr>
          </table>
        </ItemTemplate>
      </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn Visible="False" DataField="OpenItemsCountPrior" HeaderText="Prior Open Items"
                                        UniqueName="OpenItemsCountPrior" SortExpression="OpenItemsCountPrior">
                                        <HeaderStyle Font-Bold="True" Width="80px" HorizontalAlign="Center" Font-Names="Arial" />
                                        <ItemTemplate>
                                            <asp:Label ID="lbPrior" runat="server" Text='<%# Eval("OpenItemsCountPrior", "{0:N0}") %>'></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                        <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn Visible="False" DataField="OpenItemsCountLastMonth" HeaderText="Last Month Items"
                                        UniqueName="OpenItemsCountLastMonth" SortExpression="OpenItemsCountLastMonth">
                                        <HeaderStyle Font-Bold="True" Width="80px" HorizontalAlign="Center" Font-Names="Arial" />
                                        <ItemTemplate>
                                            <asp:Label ID="lbLastMonth" runat="server" Text='<%# Eval("OpenItemsCountLastMonth", "{0:N0}") %>'></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                        <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn Visible="False" DataField="OpenItemsCountCurrent" HeaderText="Current Open Items"
                                        UniqueName="OpenItemsCountCurrent" SortExpression="OpenItemsCountCurrent">
                                        <HeaderStyle Font-Bold="True" Width="100px" HorizontalAlign="Center" Font-Names="Arial" />
                                        <ItemTemplate>
                                            <asp:Label ID="lbCurrent" runat="server" Text='<%# Eval("OpenItemsCountCurrent", "{0:N0}") %>'></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                        <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="TotalRemainingItems" HeaderText="Items Left to Pay"
                                        UniqueName="TotalRemainingItems" SortExpression="TotalRemainingItems">
                                        <HeaderStyle Font-Bold="True" Width="95px" HorizontalAlign="Center" Font-Names="Arial" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblTotalRemain" runat="server" Text='<%# Eval("TotalRemainingItems", "{0:N0}") %>'></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                        <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                    </telerik:GridTemplateColumn>
                                        <telerik:GridTemplateColumn DataField="CompleteCount" HeaderText="Complete"
                                        UniqueName="CompleteCount" SortExpression="CompleteCount">
                                        <HeaderStyle Font-Bold="True" Width="80px" HorizontalAlign="Center" Font-Names="Arial" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblCompleteCount" runat="server" Text='<%# Eval("CompleteCount", "{0:N0}") %>'></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                        <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridTemplateColumn DataField="PercentComplete" HeaderText="% Complete" UniqueName="clmPctComplete"
                                        SortExpression="PercentComplete">
                                        <HeaderStyle Font-Bold="True" Width="85px" HorizontalAlign="Center" Font-Names="Arial" />
                                        <ItemTemplate>
                                            <asp:Label ID="lblPctComplete" runat="server" Text='<%# Eval("PercentComplete", "{0:N2}%")%>'></asp:Label>
                                        </ItemTemplate>
                                        <ItemStyle HorizontalAlign="Right" ForeColor="Black" />
                                        <FooterStyle HorizontalAlign="Right" Font-Bold="true" />
                                    </telerik:GridTemplateColumn>
                                    <telerik:GridBoundColumn DataField="AssigneeEmployeeKey" ReadOnly="True" UniqueName="AssigneeEmployeeKey"
                                        Visible="False">
                                    </telerik:GridBoundColumn>
                                </Columns>
                            </mastertableview>
                            <headerstyle borderstyle="Solid" />
                            <clientsettings>
                                <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                            </clientsettings>
                        </telerik:RadGrid>
protected void grdCurrentandPrior_ExcelMLExportRowCreated(object source, GridExportExcelMLRowCreatedArgs e)
      {
          Int32 JurisdictionCount = 0;
          Int32 OpenItemsCountPrior = 0;
          Int32 OpenItemsCountCurrent = 0;
          Int32 TotalRemainingItems = 0;
          Int32 LastMonthItemsCount = 0;
          Int32 CompleteCount = 0;
            
      
          foreach (GridDataItem item in grdCurrentandPrior.MasterTableView.Items)
          {
              Label jc = (Label)item.FindControl("lbJurisdiction");
              JurisdictionCount += Int32.Parse(jc.Text.Replace(",", "").Trim());
              Label oipc = (Label)item.FindControl("lbPrior");
              OpenItemsCountPrior += Int32.Parse(oipc.Text.Replace(",", "").Trim());
              Label oicc = (Label)item.FindControl("lbCurrent");
              OpenItemsCountCurrent += Int32.Parse(oicc.Text.Replace(",", "").Trim());
              Label tr = (Label)item.FindControl("lblTotalRemain");
              TotalRemainingItems += Int32.Parse(tr.Text.Replace(",", "").Trim());
              Label lc = (Label)item.FindControl("lbLastMonth");
              LastMonthItemsCount += Int32.Parse(lc.Text.Replace(",", "").Trim());
              Label cc = (Label)item.FindControl("lblCompleteCount");
              CompleteCount += Int32.Parse(cc.Text.Replace(",", "").Trim());
                
          }
          if (e.Worksheet.Table.Rows.Count == grdCurrentandPrior.Items.Count + 1)
          {
              RowElement row = new RowElement();
              GridFooterItem footer = (source as RadGrid).MasterTableView.GetItems(GridItemType.Footer)[0] as GridFooterItem;
                
              foreach (GridColumn column in (source as RadGrid).MasterTableView.Columns)
              {
                  column.Visible = true;
              }
              foreach (GridColumn column in (source as RadGrid).MasterTableView.Columns)
              {
                  CellElement cell = new CellElement();
                  string cellText = "";
                    
                  if ((column.UniqueName == "Assignee") && (rdoAssignee.Checked == true))
                      cellText = "Totals";
                  else
                  {
                      if ((column.UniqueName == "State") && (rdoState.Checked == true))
                          cellText = "Totals";
                  }
                  if (column.UniqueName == "JurisdictionCount")
                      cellText = JurisdictionCount.ToString();
                  if (column.UniqueName == "OpenItemsCountPrior")
                      cellText = OpenItemsCountPrior.ToString();
                  if (column.UniqueName == "OpenItemsCountCurrent")
                      cellText = OpenItemsCountCurrent.ToString();
                  if (column.UniqueName == "TotalRemainingItems")
                      cellText = TotalRemainingItems.ToString();
                  if (column.UniqueName == "OpenItemsCountLastMonth")
                      cellText = LastMonthItemsCount.ToString();
                    
                  if (cellText != "")
                  {
                      cell.Data.DataItem = cellText == " " ? "" : cellText;
                      row.Cells.Add(cell);
                  }
              }
              e.Worksheet.Table.Rows.Add(row);
          }
      }
jenny
Top achievements
Rank 1
 answered on 03 Aug 2012
1 answer
271 views
Hi

I have seen it said that the cookie which saves the state of the open items etc is a 'session' cookie.

Does this really mean that it is stored on the server (and therefore not relevant to the EU cookie law) , or is
it stored on the visitor's hard drive (in which case I will have to get permission from the visitors at least for the first visit)?

For most of my client websites, the PanelBar cookie is the only cookie on the site, so it would be handy if I could
forget about it.

Thanks

Clive
Philip
Top achievements
Rank 1
 answered on 02 Aug 2012
4 answers
131 views
I try to open a RadWindow that will show different data by clicking a list of linkbuttons.  These linkbuttons should be created at runtime.
I made that work by the following code example
vb code
For
Each a In aList
 
                ' Dynamically create radWindows
                '************************************************************************
                Dim radWindow As New Telerik.Web.UI.RadWindow
                With radWindow
                    .ID = "radWindow" & a
                    .Modal = True
                    .NavigateUrl = "http://test.aspx?a=" & a
                End With
 
                ' Add new radWindow to radWindowManager
                Me.RadWindowManager1.Windows.Add(radWindow)
 
                ' Dynamically create linkbutton
                ' *************************************************************************
                Dim lbtnSchool As New LinkButton
                With lbtnSchool
                    .ID = "lbtn" & a
                    .OnClientClick = "openWindow('" & radWindow.ClientID & "');return false;"
                End With
                ' **************************************************************************
            Next

Javascript function
function
openWindow(id) {
       var win;
       win = $find(id);
       win.show();}

However, there is a problem. If I have 100 items to loop, there will be 100 RadWindows added to RadWindowManager. And this is not  acceptable. I want to use just one RadWindow and let all linkbuttons call this RadWindow, then pass different data to NavigateUrl . The question is how to pass data to just one RadWindow by different linkbutton?

It will be much easier If there is a server side method, like RadWindow.show() or.open(), which can allow me to open RadWindow in code behind. But seems like the only way to open the RadWindow is using javascript?

 

Tao
Top achievements
Rank 1
 answered on 02 Aug 2012
0 answers
96 views
Good afternoon,


I have a problem with compomente RadWindowManger.
I do not know if it was coincidence, but after my last update version of RadControls p / 2012-2-607, the gif loading of pages seem to be grasping, as if slow, ran quickly before the gif.


Here my code I use to open the pages.

function Baixar() {
 window.radopen("Baixa_lote_CtsReceber.aspx", "BaixaLote");
}
 
<telerik:RadWindowManager id="RadWindowManager1" ShowContentDuringLoad="false" ReloadOnShow="true" runat="server" skin="Outlook" EnableShandow="true" >
    <Windows>
        <telerik:Radwindow ID="BaixaLote" runat="server" Behaviors="Close,Move" Modal="true" Title="Baixa" Height="655px" Width="975px" />
    </Windows>
</telerik:RadWindowManager>

Leandro
Top achievements
Rank 1
 asked on 02 Aug 2012
0 answers
93 views
I have a grid

<telerik:RadGrid ID="RadGridFeedings" runat="server" AllowAutomaticInserts="True" AllowAutomaticUpdates="True"  AllowAutomaticDeletes="True" AutoGenerateColumns="false" AllowPaging="True" AllowSorting="True" PageSize="10" skin="Default">
                            <PagerStyle Mode="NumericPages" />
                            <GroupingSettings CaseSensitive="false" />
                            <MasterTableView TableLayout="Fixed" Width="100%" CommandItemDisplay="top" DataKeyNames="FeedID" AutoGenerateColumns="false">
                                <Columns>
                                    <telerik:GridDateTimeColumn HeaderText="Date" DataField="FeedDate" UniqueName="FeedDate"
                                        SortExpression="FeedDate" HeaderStyle-Width="20%" ShowFilterIcon="false" DataFormatString="{0:dd/MM/yyyy}" />
                                    <telerik:GridBoundColumn HeaderText="Type" DataField="FoodType" UniqueName="FoodType"
                                        SortExpression="FoodType" HeaderStyle-Width="23%" ShowFilterIcon="false" />
                                    <telerik:GridBoundColumn HeaderText="Size" DataField="FoodSize" UniqueName="FoodSize"
                                        SortExpression="FoodSize" HeaderStyle-Width="22%" ShowFilterIcon="false" />
                                    <telerik:GridBoundColumn HeaderText="Result" DataField="Result" UniqueName="Result"
                                        SortExpression="Result" HeaderStyle-Width="22%" ShowFilterIcon="false" />
                                    <telerik:GridButtonColumn ConfirmText="Delete this product?" ConfirmDialogType="RadWindow"
                    ConfirmTitle="Delete" ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                    UniqueName="DeleteColumn">
                    <ItemStyle HorizontalAlign="Center"/>
                </telerik:GridButtonColumn>
                                </Columns>                                
                            </MasterTableView>
                        </telerik:RadGrid>

that is being loaded using a datatable via the code behind

Dim dtFeedings As DataTable = RVSelect.SelectFeedings(-1, -1, Request.QueryString("AnimalID"), "", -1, -1, "").Tables(0)
RadGridFeedings.DataSource = dtFeedings
RadGridFeedings.DataBind()

How do I get the edit/delete buttons working in this scenario as all the examples use sqldatasources or linqdatasources?

Many thanks
Simon
Simon
Top achievements
Rank 1
 asked on 02 Aug 2012
1 answer
108 views
I am new to programming i facing a situation where i need to delete a column to find the new column count of the radgrid.

 Private Sub btnNext_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnNext.Click

        rgdGridOutput.DataSource = ds.Tables(intTableCount)
        rgdGridOutput.DataBind()
        Dim x As Integer = rgdGridOutput.MasterTableView.Columns.Count
       
        rgdGridOutput.MasterTableView.GetColumn("ServiceOutput_Id").Visible = False
        rgdGridOutput.MasterTableView.GetColumn("ServiceResponse_Id").Visible = False

        Dim y As Integer = rgdGridOutput.MasterTableView.Columns.Count
end Sub

I am getting both x and y values as 0. Actually table has 3 columns.

Thanks,
Ajay
Jayesh Goyani
Top achievements
Rank 2
 answered on 02 Aug 2012
3 answers
317 views
Hi, I'm pulling my hair out because I cannot get any image to actually display in the image editor.  I have verified that the handlers are in the web.config and that the link to the image is valid (in Firebug).  Still nothing.  I'm not sure if it's connected, but opening up an image from RadFileEditor brings up a blank window as well.

<telerik:RadFileExplorer ID="RadFileExplorer1" runat="server"
    EnableCreateNewFolder="false" 
    VisibleControls="Toolbar, ContextMenus, FileList"
    Configuration-DeletePaths="~/Images/Advertising"
    Configuration-EnableAsyncUpload="true"
    Configuration-MaxUploadFileSize="9999999"
    Configuration-UploadPaths="~/Images/Advertising"
    Configuration-ViewPaths="~/Images/Advertising" ClientIDMode="Static">
                        </telerik:RadFileExplorer>

Web.Config
<system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
    <modules runAllManagedModulesForAllRequests="true">
      <remove name="UrlRoutingModule" />
      <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, System.Web, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
    </modules>
       
    <handlers>
      <add name="Telerik_Web_UI_WebResource_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.WebResource.axd" type="Telerik.Web.UI.WebResource" />
      <add name="UrlRoutingHandler" preCondition="integratedMode" verb="*" path="UrlRouting.axd" type="System.Web.HttpForbiddenHandler, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
      <add name="Telerik_Web_UI_SpellCheckHandler_axd" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.SpellCheckHandler.axd" type="Telerik.Web.UI.SpellCheckHandler" />
      <add name="Telerik_Web_UI_DialogHandler_aspx" verb="*" preCondition="integratedMode" path="Telerik.Web.UI.DialogHandler.aspx" type="Telerik.Web.UI.DialogHandler" />
      <add name="ChartImage_axd" verb="*" preCondition="integratedMode" path="ChartImage.axd" type="Telerik.Web.UI.ChartHttpHandler" />
    </handlers>
  </system.webServer>
Nick
Top achievements
Rank 1
 answered on 02 Aug 2012
2 answers
96 views
Is it possible to highlight the letters the user types?
Like in the combobox filtering example (see screenshot)
Raphaël MANSUY
Top achievements
Rank 1
 answered on 02 Aug 2012
2 answers
73 views
Hi,

I had Trial version installed but recently upgraded to a licensed version 2012.2.724.35. Since then in some of the forms controls are overlapping (see screenshot attached). Please let me know what could be the issue ASAP.

Thanks,
ADod
AratiS
Top achievements
Rank 1
 answered on 02 Aug 2012
1 answer
149 views
Hello Telerik Team,

Really very very good control.
I really appreciate your work, Because this control are different from other third party (GRID) control.

once again thanks to all of you.

Note : i also notice that i will take so much time in changing groping.
i also know that it must take much time because first it created structure in pivot data then after it will create UI for that.
But, Can you please try to work on this in next version?


Thanks,
Jayesh Goyani
Tsvetina
Telerik team
 answered on 02 Aug 2012
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?