Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
124 views
Hello, 

I have a problem with my RadMenu, the text in the RadMenu Item is centered but the item itself isn't centered.

Please take a look at the attached file for more info.

I obviously tried putting CSS on the different classes in the skin but I havent been able to move that 'blue/green' block to the center. 

Thanks !
Mark
Top achievements
Rank 1
 answered on 10 Oct 2014
8 answers
479 views
Hi Sir,

i Want to Create Dynamic RadScheduler Context Menu.

Like In Blank Row Of Scheduler Context Menu Appear New and Disable Paste Menu.

And Where Appointment is given Then There Context Menu Appear Like Edit, Copy, Paste, Cut etc. When I Copy Any Appointment and then Again go to blank Row then Context menu appear New And Paste Option. How can Achive this type of Condition. Please Help Me.


Thanks
Chandan Kumar.
Hristo Valyavicharski
Telerik team
 answered on 10 Oct 2014
17 answers
245 views
radasyncupload doesn't work in IE 9. does anybody have any idea?
Hristo Valyavicharski
Telerik team
 answered on 10 Oct 2014
1 answer
72 views
Hi,

It is a very simple and specific requirement in attached image. Please help according to image

Want to show Project name in column than in scheduler i want to show in which stage a specific project on specific date.


Please help.
Hristo Valyavicharski
Telerik team
 answered on 10 Oct 2014
1 answer
440 views
Hi all,

Using VS 2010 with UI for ASP.NET AJAX Q2 2014 SP1. 

My intentions are:

1) Export only Parent Grid and 2 Child Grid Rows in Each page.
2) Repeat the Parent Grid Column Header in each New Page.
3) Bottom of PDF export, show page count (i.e. 1 of n etc.).
4) If Last Page has only 1 child row, export it with Parent Grid.Below are my codes and attached is desired PDF export.

Thanks

gc_0620

_______________

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
 
<%@ Register TagPrefix="telerik" Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head id="Head1" runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager runat="server" ID="ScriptManager1" />
    <div>
        <telerik:RadGrid Skin="Web20" ID="RadGrid1" ShowStatusBar="True" DataSourceID="SqlDataSource1"
            runat="server" AutoGenerateColumns="False" AllowPaging="True"
            AllowMultiRowEdit="True" AllowAutomaticDeletes="True" AllowAutomaticInserts="True"
            AllowAutomaticUpdates="True" EnableLinqExpressions="False" AutoGenerateDeleteColumn="True"
            AutoGenerateEditColumn="True" OnPdfExporting="RadGrid1_PdfExporting"
            OnItemCreated="RadGrid1_ItemCreated"
            onitemdatabound="RadGrid1_ItemDataBound" ResolvedRenderMode="Classic">
            <ExportSettings>
                <Pdf PageTitle="Rad Grid Selected Customers Export" />
            </ExportSettings>
            <PagerStyle Mode="NumericPages"></PagerStyle>
            <MasterTableView DataSourceID="SqlDataSource1" Name="Master" DataKeyNames="CustomerID"
                CommandItemDisplay="Top">
                <DetailTables>
                    <telerik:GridTableView Name="Orders" DataKeyNames="OrderID" CommandItemDisplay="Top"
                        DataSourceID="SqlDataSource2" Width="100%" runat="server">
                        <ParentTableRelation>
                            <telerik:GridRelationFields DetailKeyField="CustomerID" MasterKeyField="CustomerID" />
                        </ParentTableRelation>
                        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                        <Columns>
                            <telerik:GridBoundColumn SortExpression="OrderID" HeaderText="OrderID" HeaderButtonType="TextButton"
                                DataField="OrderID" UniqueName="OrderID">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="OrderDate" HeaderText="Date Ordered" HeaderButtonType="TextButton"
                                DataField="OrderDate" UniqueName="OrderDate" DataFormatString="{0:D}">
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn SortExpression="Freight" HeaderText="Freight" HeaderButtonType="TextButton"
                                DataField="Freight" UniqueName="Freight">
                            </telerik:GridBoundColumn>
                        </Columns>
                        <EditFormSettings EditFormType="Template">
                            <FormTemplate>
                                <table id="ChildTableMain" class="form-controls" cellspacing="2" cellpadding="1"
                                    width="99.9%" border="0" rules="none" style="border-collapse: collapse; background: #DCDCDC; border-width:0px;">
                                    <colgroup>
                                        <col />
                                    </colgroup>
                                    <tr>
                                        <td>
                                            <asp:Label ID="OrderDetailLabel" CssClass="form-edit_Update" runat="server" Text="Order details"
                                                Font-Underline="True"></asp:Label>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <table id="ChildTableDetail" border="0" style="border-width: 0px;" class="form-controls"
                                                width="99.9%">
                                                <colgroup>
                                                    <col />
                                                    <col />
                                                    <col />
                                                    <col />
                                                </colgroup>
                                                <tr>
                                                    <td style="font-size: 11px">
                                                        Order ID:
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TxtOrderID" runat="server" Text='<%# Bind( "OrderID") %>' TabIndex="1" />
                                                    </td>
                                                    <td style="font-size: 11px">
                                                        Date Ordered:
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TxtOrderDate" runat="server" Width="200px" Text='<%# Bind( "OrderDate","{0:D}") %>'
                                                            TabIndex="2" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td style="font-size: 11px">
                                                        Freight:
                                                    </td>
                                                    <td>
                                                        <asp:TextBox ID="TxtFreight" Width="300px" runat="server" Text='<%# Bind( "Freight") %>'
                                                            TabIndex="3">
                                                        </asp:TextBox>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </FormTemplate>
                        </EditFormSettings>
                        <SortExpressions>
                            <telerik:GridSortExpression FieldName="OrderDate"></telerik:GridSortExpression>
                        </SortExpressions>
                    </telerik:GridTableView>
                </DetailTables>
                <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
                <ExpandCollapseColumn Visible="True">
                </ExpandCollapseColumn>
                <Columns>
                    <telerik:GridBoundColumn SortExpression="CustomerID" HeaderText="CustomerID" DataField="CustomerID"
                        UniqueName="CustomerID" ReadOnly="True">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="CompanyName" HeaderText="CompanyName" DataField="CompanyName"
                        UniqueName="CompanyName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn SortExpression="ContactName" HeaderText="ContactName" DataField="ContactName"
                        UniqueName="ContactName">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Address" HeaderText="Address" SortExpression="Address"
                        UniqueName="Address">
                    </telerik:GridBoundColumn>
                </Columns>
                <EditFormSettings EditFormType="Template">
                    <FormTemplate>
                        <table id="Table2" class="form-controls" cellspacing="2" cellpadding="1" width="99.9%"
                            border="0" rules="none" style="border-collapse: collapse; background: #DCDCDC; border-width:0px;">
                            <colgroup>
                                <col />
                            </colgroup>
                            <tr>
                                <td>
                                    <asp:Label ID="CustDetailLabel" CssClass="form-edit_Update" runat="server" Text="Customer details"
                                        Font-Underline="True"></asp:Label>
                                </td>
                            </tr>
                            <tr>
                                <td>
                                    <table id="TableDetail" border="0" class="form-controls" style="border-width: 0px"
                                        width="99.9%">
                                        <colgroup>
                                            <col />
                                            <col />
                                            <col />
                                            <col />
                                        </colgroup>
                                        <tr>
                                            <td style="font-size: 11px">
                                                Customer Id:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtCustomer" runat="server" Text='<%# Bind( "CustomerID") %>' TabIndex="1" />
                                            </td>
                                            <td style="font-size: 11px">
                                                Contact Name:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtContact" runat="server" Width="200px" Text='<%# Bind( "ContactName") %>'
                                                    TabIndex="2" />
                                            </td>
                                        </tr>
                                        <tr>
                                            <td style="font-size: 11px">
                                                Company:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtCompany" Width="200px" runat="server" Text='<%# Bind( "CompanyName") %>'
                                                    TabIndex="3">
                                                </asp:TextBox>
                                            </td>
                                            <td style="font-size: 11px">
                                                Address:
                                            </td>
                                            <td>
                                                <asp:TextBox ID="TxtAddress" Width="300px" runat="server" Text='<%# Bind( "Address") %>'
                                                    TabIndex="3">
                                                </asp:TextBox>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                            <tr visible="false">
                                <td align="right" colspan="2">
                                    <asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>'
                                        runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'>
                                    </asp:Button>
                                    <asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False"
                                        CommandName="Cancel"></asp:Button>
                                </td>
                            </tr>
                        </table>
                    </FormTemplate>
                </EditFormSettings>
            </MasterTableView>
            <ClientSettings>
                <Selecting AllowRowSelect="true" />
            </ClientSettings>
        </telerik:RadGrid>
        <br />
        <asp:Button ID="Button1" runat="server" Text="Export selected items with child items"
            OnClick="Button1_Click" />
        <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            SelectCommand="SELECT [CustomerID], [CompanyName], [ContactName], [Address] FROM [Customers] WHERE ([CustomerID] <= @CustomerID)"
            runat="server" DeleteCommand="DELETE FROM [Customers] WHERE [CustomerID] = @CustomerID"
            InsertCommand="INSERT INTO [Customers] ([CustomerID], [CompanyName], [ContactName], [Address]) VALUES (@CustomerID, @CompanyName, @ContactName, @Address)"
             
            UpdateCommand="UPDATE [Customers] SET [CompanyName] = @CompanyName, [ContactName] = @ContactName, [Address] = @Address WHERE [CustomerID] = @CustomerID">
            <DeleteParameters>
                <asp:Parameter Name="CustomerID" Type="String" />
            </DeleteParameters>
            <SelectParameters>
                <asp:Parameter DefaultValue="BLAUS" Name="CustomerID" Type="String" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="CompanyName" Type="String" />
                <asp:Parameter Name="ContactName" Type="String" />
                <asp:Parameter Name="Address" Type="String" />
                <asp:Parameter Name="CustomerID" Type="String" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="CustomerID" Type="String" />
                <asp:Parameter Name="CompanyName" Type="String" />
                <asp:Parameter Name="ContactName" Type="String" />
                <asp:Parameter Name="Address" Type="String" />
            </InsertParameters>
        </asp:SqlDataSource>
        <asp:SqlDataSource ID="SqlDataSource2" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>"
            ProviderName="System.Data.SqlClient" SelectCommand="SELECT * FROM Orders Where CustomerID = @CustomerID"
            runat="server">
            <SelectParameters>
                <asp:SessionParameter Name="CustomerID" SessionField="CustomerID" Type="string" />
            </SelectParameters>
        </asp:SqlDataSource>
    </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;
using System.Data;
using Telerik.Web.UI;
using System.Data.SqlClient;
using Telerik.Web.UI.GridExcelBuilder;
using System.Collections.Specialized;
using System.Collections;
using System.IO;
using System.Text;
using System.Globalization;
using System.Threading;
 
public partial class _Default : System.Web.UI.Page
{
    private void Set_Export_Options()
    {
        //Landscape  
        RadGrid1.ExportSettings.Pdf.PageHeight = Unit.Parse("8.5in");
        RadGrid1.ExportSettings.Pdf.PageWidth = Unit.Parse("11in");
 
        //// 1/2 inch margins  
        RadGrid1.ExportSettings.Pdf.PageLeftMargin = Unit.Parse(".5in");
        RadGrid1.ExportSettings.Pdf.PageRightMargin = Unit.Parse(".5in");
        RadGrid1.ExportSettings.Pdf.PageTopMargin = Unit.Parse(".5in");
        RadGrid1.ExportSettings.Pdf.PageBottomMargin = Unit.Parse(".5in");
 
        RadGrid1.ExportSettings.OpenInNewWindow = true;
        RadGrid1.ExportSettings.IgnorePaging = true;
        RadGrid1.ExportSettings.ExportOnlyData = true;
        RadGrid1.MasterTableView.HierarchyDefaultExpanded = true;
    }
    public void Configure_Selected_Row_Pdf_Export(GridItem item)
    {
        if (item.IsInEditMode)
        {
            item.OwnerTableView.BorderWidth = Unit.Pixel(0);
 
            item.Style["border-width"] = "0px";
            item.Style["text-align"] = "center";
            item.Style["font-family"] = "Arial";
            if (item.OwnerTableView.Name == "Master")
            {
                item.Style["background-color"] = "#555";
                item.Style["color"] = "#fff";
            }
 
            else
            {
                item.Style["background-color"] = "#aaa";
            }
        }
    }
 
    bool isExport = false;
    string selectedItem = "";
    protected void Button1_Click(object sender, EventArgs e)
    {
        Set_Export_Options();
        isExport = true;
        selectedItem = RadGrid1.SelectedIndexes[0];
        RadGrid1.MasterTableView.ExportToPdf();
    }
 
    protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
    {
        if (isExport)
        {
            if (e.Item.OwnerTableView.Name == "Master" && e.Item.ItemIndexHierarchical != selectedItem)
            {
                e.Item.Display = false;
                e.Item.Expanded = false;
            }
            else if (e.Item is GridDataItem || e.Item is GridHeaderItem)
            {
                e.Item.Edit = true;
                e.Item.Display = false;
                e.Item.Style.Add("display", "none");
            }
 
           
        }
    }
 
    protected void RadGrid1_PdfExporting(object sender, GridPdfExportingArgs e)
    {
        e.RawHTML = e.RawHTML.Replace("99.9%", "696px");
 
        
    }
    protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
    {
        if(isExport)
            Configure_Selected_Row_Pdf_Export(e.Item); 
    }
}

Kostadin
Telerik team
 answered on 10 Oct 2014
1 answer
84 views
This isn't so much a question as feedback since I'm not able to post code due to the nature of my job, but I have a page where I'm using a RadTabStrip and RadMultiPage and on one of those pages I have a RadGrid being filled with data from an ObjectDataSource in an n-Tier application.  The RadGrid works great, it fills with all my GridBound columns, I've set OverrideDataSourceControlSorting to allow it to sort my custom object with no problems.

However, when I attempted to use CommandItemTemplate I ran into a pretty significant formatting issue.  The default CommandItemDisplay (add and refresh) appear fine, but as soon as I add the CommandItemTemplate all my columns and data formatting disappear.  The columns don't show up at all and everything is on a single line without formatting, including the CommandItemDisplay area.  I was using the skin "WebBlue" and even that wasn't showing, it was a big white box with everything crammed together.

I spent quite a bit of time attempting to find a solution including copying your CommandItemTemplate demo code into a new page and what I found is that the ObjectDataSource seems to be causing an issue.  I don't know what it is (custom object maybe?) but it was frustrating to not be able to find any solution or anyone using the same structure as I am. 

Is there something I'm missing about using an ObjectDataSource that the RadGrid would be handling differently than an SQLDataSource?  It seems to me that it should just be looking for the column information and not care where it's coming from...
Konstantin Dikov
Telerik team
 answered on 10 Oct 2014
13 answers
824 views
Hi All,

I used RadAjaxManager,RadAjaxLoadingPanel,RadTabstrip,RadGrid..scriptmanager

In pageveiw contain grid ,dropdown and button. 
When i click on one control before it's processing done i click on another control it gives me the error as

Microsoft JScript runtime error: Sys.InvalidOperationException: A control is already associated with the element.

Slav
Telerik team
 answered on 10 Oct 2014
5 answers
682 views
Hi,

I have an EditFormSettings section in my RadGrid control which uses a FormTemplate. The FormTemlate contains multiple of RadTextBox controls and currently the only way to navigate through the controls is using the Tab key. Is there anyway to change the Enter key to behave like the Tab key in edit mode?

i.e. OnClientKeyPressing:
if (window.event.keyCode == 13) {
window.event.keyCode = 9;
}


Thank you!


Marius
Top achievements
Rank 1
 answered on 10 Oct 2014
1 answer
124 views
I have a enabled DropDownAutoWidth on my combobox but it seems to stay fixed width.  As you can see in the snapshot attached, the description in the last column word wraps instead of extending all the way.  Am I missing some settings?
<asp:Label ID="Label8" runat="server" Width="100px" Style="padding-left:22px" Text="Market:"  />
    <telerik:RadComboBox ID="RadMarketComboBox" runat="server" Width="80px" Height="150px" DataSourceID="SqlDataSourceMarket" DataTextField="market_cd" DataValueField="market_cd" EnableScreenBoundaryDetection="true" DropDownAutoWidth="Enabled"
        HighlightTemplatedItems="true" MarkFirstMatch="true" SelectedValue='<%# DataBinder.Eval(Container, "DataItem.market").ToString().Trim() %>'  >
        <HeaderTemplate>
            <table>
                <tr>
                    <td class="col1">Market</td>
                    <td class="col2">Desc</td>
                </tr>
            </table>
        </HeaderTemplate>
        <ItemTemplate>
            <table>
                <tr>
                    <td class="col1">
                        <%# DataBinder.Eval(Container.DataItem, "market_cd") %>
                    </td>
                    <td class="col2">
                        <%# DataBinder.Eval(Container.DataItem, "market_desc") %>
                    </td>
                </tr>
            </table>
        </ItemTemplate>
    </telerik:RadComboBox>
    <asp:SqlDataSource ID="SqlDataSourceMarket" runat="server"
        ConnectionString="<%$ ConnectionStrings:OSS %>"
        SelectCommand="SELECT rtrim(ltrim(market_cd)) as market_cd, rtrim(ltrim(market_desc)) as market_desc, market_id
            FROM market
            ORDER BY market_cd">
    </asp:SqlDataSource><br />

Thank you,

Helen


Magdalena
Telerik team
 answered on 10 Oct 2014
2 answers
482 views
Hi,

I am using 2 level telerik radgrid to display information for purchase order(PO) and purchase order(PO) line items. I already have export to excel which exports the data into an excel sheet including the filters applied on the grid. i.e when we apply a filter on grid and click on export it only exports the data present in the filtered grid.

I have a new requirement to export the grid data into multiple worksheet in the single excel file. i.e. PO information should be exported to 1st worksheet in the excel file and PO line items information should be exported to 2nd worksheet in the same excel file. I also need to change the header information in the export. e.g. PurchaseOrderId will be renamed to PoId and so on. When a filter is applied it should only export the filtered information.
Please let me know if this is feasible. If yes, it would be great if sample code can be included. Any help would be appreciated. Thanks in advance. 

Please find some more details for current implementation. 
<telerik:RadGrid ID="RadGrid1" AutoGenerateColumns="false" AllowPaging="True" AllowFilteringByColumn="true"
        runat="server" AllowSorting="true" OnNeedDataSource="RadGrid1_NeedDataSource" GroupingSettings-CaseSensitive="false"
        GridLines="None" EnableLinqExpressions="false" ExportSettings-IgnorePaging="True" ExportSettings-Excel-Format="Html"
        MasterTableView-CommandItemDisplay="Top" ExportSettings-ExportOnlyData="true" OnDetailTableDataBind="RadGrid1_DetailTableDataBind"
        OnItemCommand="RadGrid1_OnItemCommand"> 
          <MasterTableView  DataKeyNames="PurchaseOrderId">
             <DetailTables>
                 <telerik:GridTableView runat="server" DataKeyNames="PurchaseOrderItemId" Name="1" Width="100%" HierarchyLoadMode="Client" AllowSorting="False" AllowFilteringByColumn="False">
                   <Columns>
                         <telerik:GridBoundColumn ...... ></telerik:GridBoundColumn>
                         <telerik:GridBoundColumn ...... ></telerik:GridBoundColumn>
                   </Columns>
                </telerik:GridTableView>
            </DetailTables>
            <Columns>
                    <telerik:GridBoundColumn ...... ></telerik:GridBoundColumn>
                    <telerik:GridBoundColumn ...... ></telerik:GridBoundColumn>
          </Columns>
            <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false"
                ShowRefreshButton="false" />
        </MasterTableView>
        <GroupingSettings CaseSensitive="false" />
    </telerik:RadGrid>

Thanks.
Ank
Top achievements
Rank 1
 answered on 10 Oct 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Iron
Iron
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
Radek
Top achievements
Rank 2
Iron
Iron
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Richard
Top achievements
Rank 4
Bronze
Bronze
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?