Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
458 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
101 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
843 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
700 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
135 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
496 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
1 answer
182 views

Hi,I have created a button to simulate clicking the arrow on a combobox.
Basically I hide the combobox and call the javascript to triggers the dropdown behavior of the combobox when a user clicks on the button.
The user will be able to select an item from the dropdown and then the code-behind will populate the selected address into the textboxes accordingly.Everything works ok up to this point. The problem starts after the postback, data in the dropdown list is gone.
I found a few posts on the forum which says we need to load the data on each post back or in the ItemsRequested event but that didn't work for me.
I must be missing something obvious, but just can't spot it.  Please help~

javascript :
     Since the combobox is in a user control, I load the javascript using ScriptManager.

code-behind:
protected void Page_Load(object sender, EventArgs e)
{
 
    //  Load script dynamically for user control
    StringBuilder script = new StringBuilder();
    script.Append("function ShowDropDownFunction() {");
    script.Append("var combo = $find('" + RadLogixBuildingComboBox.ClientID + "');");
    script.Append("combo.showDropDown(); }");
    ScriptManager.RegisterStartupScript(Page, typeof(Page), "script1", script.ToString(), true);
 
    SALTLeadDetailsBLL _detailBLL = new SALTLeadDetailsBLL();
    SALTLeadDetailsDAL.sbms_bldgDataTable dt = _detailBLL.GetLogixBuildings(SalesID);
    RadLogixBuildingComboBox.DataSource = dt;
    RadLogixBuildingComboBox.DataBind();
}
 
protected void RadLogixBuildingComboBox_ItemDataBound(object sender, RadComboBoxItemEventArgs e)
{
    DataRowView dataItem = (DataRowView)e.Item.DataItem;
 
    e.Item.Text = dataItem["bldgstreet1"].ToString().Trim() + "; " + dataItem["bldgcity"].ToString().Trim() + "; " + dataItem["bldgstate"].ToString().Trim() + "; " + dataItem["bldgzip"].ToString().Trim() + "; " + dataItem["market"].ToString().Trim();
    e.Item.Value = dataItem["bldgstreet1"].ToString().Trim() + "; " + dataItem["bldgcity"].ToString().Trim() + "; " + dataItem["bldgstate"].ToString().Trim() + "; " + dataItem["bldgzip"].ToString().Trim() + "; " + dataItem["market"].ToString().Trim();
}
 
 
protected void RadLogixBuildingComboBox_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
{
    //  When loadondemand is turned on, SelectedItem is not available : http://www.telerik.com/forums/combobox-selecteditem-getting-null-even-when-it-is-selected-from-the-list
    //  Use e.item.text and e.item.value in ItemDataBound event
    String selectedItemValues = RadLogixBuildingComboBox.SelectedValue;
    List<string> itemValues = selectedItemValues.Split(';').ToList();
 
    string[] zipCode = itemValues[3].Trim().Split('-');
    string zip = zipCode[0].ToString().Trim();
    string zipExt = zipCode[1].ToString().Trim();
    Address1TextBox.Text = itemValues[0].ToString().Trim();
    CityTextBox.Text = itemValues[1].ToString().Trim();
    StateTextBox.Text = itemValues[2].ToString().Trim();
    ZipTextBox.Text = zip;
    ZipExtTextBox.Text = zipExt;
    RadMarketComboBox.SelectedValue = itemValues[4].ToString().Trim();
 
 
}
 
protected void RadLogixBuildingComboBox_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
{
    SALTLeadDetailsBLL _detailBLL = new SALTLeadDetailsBLL();
    SALTLeadDetailsDAL.sbms_bldgDataTable dt = _detailBLL.GetLogixBuildings(SalesID);
    RadLogixBuildingComboBox.DataSource = dt;
    RadLogixBuildingComboBox.DataBind();
}

ascx :

<telerik:RadButton ID="LogixBuildingImageButton" AutoPostBack="false" runat="server"  Image-ImageUrl="~/images/building16.png" ToolTip="Logix Buildings" Width="16px" Height="16px" OnClientClicked="ShowDropDownFunction" />
<telerik:RadComboBox ID="RadLogixBuildingComboBox" runat="server" AutoPostBack="true"   MarkFirstMatch="false" ItemsPerRequest="5" ShowMoreResultsBox="true"
        EnableAutomaticLoadOnDemand="true" EnableVirtualScrolling="true"
        DropDownAutoWidth="Disabled" DropDownWidth="700px" Width="0" Height="150px" HighlightTemplatedItems="true"  EnableScreenBoundaryDetection="true"
        OnItemDataBound="RadLogixBuildingComboBox_ItemDataBound"  OnSelectedIndexChanged="RadLogixBuildingComboBox_SelectedIndexChanged" OnItemsRequested="RadLogixBuildingComboBox_ItemsRequested" >
    <HeaderTemplate>
        <table>
            <tr>
                <td class="logixbuildingcol1">Building Street</td>
                <td class="logixbuildingcol2">City</td>
                <td class="logixbuildingcol3">State</td>
                <td class="logixbuildingcol4">Zip</td>
                <td class="logixbuildingcol5">Status</td>
                <td class="logixbuildingcol6">Address Type</td>
            </tr>
        </table>
    </HeaderTemplate>
    <ItemTemplate>
        <table>
            <tr>
                <td class="logixbuildingcol1"><%# DataBinder.Eval(Container.DataItem, "bldgstreet1") %> </td>
                <td class="logixbuildingcol2"><%# DataBinder.Eval(Container.DataItem, "bldgcity") %></td>
                <td class="logixbuildingcol3"><%# DataBinder.Eval(Container.DataItem, "bldgstate") %></td>
                <td class="logixbuildingcol4"><%# DataBinder.Eval(Container.DataItem, "bldgzip") %></td>
                <td class="logixbuildingcol5"><%# DataBinder.Eval(Container.DataItem, "buildingStatus") %></td>
                <td class="logixbuildingcol6"><%# DataBinder.Eval(Container.DataItem, "addressTypeDesc") %></td>
            </tr>
        </table>
 
    </ItemTemplate>
    <FooterTemplate>
        <table>
            <tr>
                <td class="logixbuildingcol1"><telerik:RadButton ID="RadCloseButton" runat="server" AutoPostBack="false" Text="Close" Icon-PrimaryIconUrl="~/images/exit_16x16.png" OnClientClicking="HideDropDownFunction()" /></td>
            </tr>
        </table>
    </FooterTemplate>
</telerik:RadComboBox>

Thank you,

Helen










     
Peter Filipov
Telerik team
 answered on 10 Oct 2014
3 answers
172 views
I have a RadGrid that has a RadAsyncUpload control int  the edit item template :

   <telerik:GridTemplateColumn DataField="Data" HeaderText="Image" UniqueName="Upload">
                                    <ItemTemplate>
                                        <telerik:RadBinaryImage runat="server" ID="RadBinaryImage1" DataValue='<%#Eval("Data") %>'
                                            AutoAdjustImageControlSize="false" Height="40px" ImageUrl="~/images/icons/PDF.png"></telerik:RadBinaryImage>
                                    </ItemTemplate>
                                    <EditItemTemplate>
                                        <telerik:RadAsyncUpload runat="server" ID="AsyncUpload1" OnClientFileUploaded="OnClientFileUploaded"
                                            AllowedFileExtensions="jpg,jpeg,png,gif,pdf,tiff,tif" MaxFileSize="1048576" OnFileUploaded="AsyncUpload1_FileUploaded"  MaxFileInputsCount="1" ChunkSize="0">
                                        </telerik:RadAsyncUpload>
                                    </EditItemTemplate>
                                </telerik:GridTemplateColumn>

When testing through Visual Studio it performs like a charm.  However as soon as I publish it for UAT the input field of the upload control is duplicated. See attached screenshots. I have tried all edit modes... Any ideas out there?
Angel Petrov
Telerik team
 answered on 10 Oct 2014
2 answers
89 views
Hi

I use the radSlider but I dont understand the use of Skin PBS, The slider is not show the style,  the follow code

<link href="Skins/PlayBallSkin/Slider.PBS.css" rel="stylesheet" type="text/css" />


My question where is this file? or Where add this fie


Thanks & regards
Gustavo
Top achievements
Rank 1
 answered on 09 Oct 2014
3 answers
364 views
Hi everyone,

I'm having an issue trying to add rich content to a RadNotification created dynamically. I'm developing ASP.NET Composite Server Controls that nests Telerik controls and it is imposible to add any control to the RadNotification's ContentTemplate/ContentContainer. This is my code:

protected override void CreateChildControls()
{
    var _notification = new RadNotification
    {
        ID = "Notification",
        Position = NotificationPosition.Center,
        Height = Unit.Pixel(160),
        Width = Unit.Pixel(330),
        TitleIcon = "ok",
        Animation = NotificationAnimation.Slide,
        AutoCloseDelay = 0,
        ShowCloseButton = false,
    };
    var div = new HtmlGenericControl("div");
    div.Controls.Add(new LiteralControl("<br />"));
    div.Controls.Add(new Literal { Text = Resources.MyControl_TextMessage });
    div.Controls.Add(new LiteralControl("<br />"));
    div.Controls.Add(new RadButton { Text = Resources.MyControl_ButonText });
    _notification .ContentContainer.Controls.Add(div);
    this.Controls.Add(_notification);
}

BTW, this is not the full method, full method contains a lot of more controls, this is just a sample.

Hope anyone knows how can I achieve it.

Thanks,
Nefi
Meera
Top achievements
Rank 1
 answered on 09 Oct 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?