Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
203 views
HI,

I added a telerik radgrid in my aspx page. I specifed the SelectedMethod and the Typename, which is a business class other than the web UI class. I got the UI working but I need to pass a parameter from the web ui class to the business class. the aspx will get the parameter from the url and store it in a string. When the telerik invokes the SelectMethod, which is in another business class, what is the best practive method to pass the parameter to the SelectMethod, which gets invoke automatically?

Angel Petrov
Telerik team
 answered on 29 Nov 2012
11 answers
320 views
I'm performing a Custom Filter on a RadGrid. The filter works when my Button is pressed, I'd like to now have the button's code behind fire when the User types into the Search Textbox.

I am able to find the Grid using Javascript, but the $find to the 'btnFilter' always fails. As you can see below, I've tried multiple ways.
function doFilter(sender, e) {
        if (e.keyCode == 13) {
  
            var masterTable = $find("<%=AgreementsGrid.ClientID%>").get_masterTableView();
           //var btn = masterTable.get_dataItems()[0].findControl('btnFilter');
            var btn = $find("ctl00$MainContentPlaceHolder$AgreementsGrid$ctl00$ctl02$ctl01$btnFilter");
  
            if (btn != null) {
                e.cancelBubble = true;
                e.returnValue = false;
  
                if (e.preventDefault) {
                    e.preventDefault();
                }
  
                alert("yes!");
                //btn.click();
            } else {
                alert("no!");
            }
        }
    }

<telerik:RadGrid ID="AgreementsGrid" runat="server" CellSpacing="0" GridLines="None" EnableLinqExpressions="false"
                  AllowFilteringByColumn="true" AllowPaging="false" AllowSorting="True" EnableViewState="true"
                  AutoGenerateColumns="False" Height="240">
     <MasterTableView DataKeyNames="AgreementID" TableLayout="Auto">
         <Columns>
             <telerik:GridBoundColumn DataField="AgreementName"
                                     FilterControlAltText="Filter AgreementName column" HeaderText="Agreement" HeaderStyle-Width="350" FilterControlWidth="350"
                                      SortExpression="AgreementName" UniqueName="AgreementName" >
                 <FilterTemplate>
                     <telerik:RadTextBox ID="AgreementName" runat="server" EmptyMessageStyle-Font-Italic="true" onkeydown="doFilter(this,event)"
                                         HoveredStyle-Font-Italic="true" Width="90%">
                     </telerik:RadTextBox>                     
                     <asp:Button ID="btnFilter" runat="server" Width="20px" Text="" OnClick="FilterTextbox_Changed" CommandName="btnSearch" />
                 </FilterTemplate>
             </telerik:GridBoundColumn>  
         </Columns>
  
        <FilterItemStyle Width="10px" />
     </MasterTableView>
  
    <FilterMenu EnableImageSprites="False"></FilterMenu>
 </telerik:RadGrid>






Tim
Top achievements
Rank 1
 answered on 29 Nov 2012
1 answer
208 views
Hi,

RadEditor's SkinID property seems to be ignored when an Editor is placed in an RadGris Edit Template like:


<telerik:GridTemplateColumn UniqueName="tekst">
                    <EditItemTemplate>
                        <telerik:RadEditor SkinID="Editor" ID="RadEditor1" runat="server" content='<%# Bind("tekst") %>' />
                    </EditItemTemplate>
</telerik:GridTemplateColumn>

Any suggestions?

Marc
Fit2Page
Top achievements
Rank 2
Bronze
Iron
Iron
 answered on 29 Nov 2012
0 answers
104 views
Hello Team,

I am facing a issue where the RadComboBox SelectedIndexChange event is not firing on click of submit button.

In my previous version of code where i am using Telerik version "2011.1.519.35" 2011 Q1 , in one of my page i have a dropdown called "ddlCurrency" it is having its SelectedIndexChanged event handler. This combobox is inside "RadWindow". I also have one button called "Submit". In this version when i click on this submit button the "SelectedIndexChanged" event is getting called after page load and  before button Click event.

Now, I have upgraded my "Telerik" version to "2012.2.912.35" i.e 2012 Q2 SP2 . Here i am getting some strange difference  , After upgrading to this version the "SelectedIndexChanged" event is not getting called on click of submit button and this time it is directly calling to "Button_Click" event after page load and the call does not went to SelectedIndexChange event before Button Click event. We have exactly the same code no changes we have done in this version. This difference is not allowing the code which is inside SelectedIndexChanged event to execute .

Please refer to the following RadComboBox:

  <telerik:RadComboBox ID="ddlCurrencies" runat="server" Width="155" AutoPostBack="true"
                            OnSelectedIndexChanged="CurrencyChanged" CausesValidation="true" MaxHeight="300px"
                            DataTextField="Value" DataValueField="Key" AppendDataBoundItems="true"  MarkFirstMatch="true"    ExpandDirection="Down"
                            style="z-index:7015!important;">
                            <Items>
                                <telerik:RadComboBoxItem Value="" Text="Select Currency" />
                            </Items>
                        </telerik:RadComboBox>

Did anything got changed in the version 2012 Q2 SP2 which has changed the behavior of this radCombobox and restricting the selectedIndexChanged event to get called on  submit button click before the call reach to Button Click event. Please help me to identify the difference. I am just curious to know why the SelectedIndex event is getting called in previous version and not getting called in current version on click of button.

Any help or suggestion on this will be highly appreciated.

Thanks,
Aakansha
Aakansha
Top achievements
Rank 1
 asked on 29 Nov 2012
5 answers
239 views
Hello,

I have an ajaxified RadGrid with a single template column which contains an image, along with other data. I am required to display all search results in this grid on a single page, but because each row has a unique image, the load time for the page is unacceptable for large row counts. My solution was to load the results using a small placeholder image, and then use AJAX to replace the placeholder image with the real image for each row when the page finishes loading. It works great, except that each time one of the images is replaced, the page scrolls to the top. This is problematic for large row counts because I am unable to scroll down until all images are loaded. Is there a way I can prevent the page from scrolling to the top after every ajax request? What I'd really like to do is only update the rows individually, but I couldn't figure out how to avoid ajaxifying the entire grid. Any help would be greatly appreciated. Thanks in advance!

Here is my .aspx:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="InventorySearch.ascx.cs" Inherits="KellerBuick.UserControl.InventorySearch" %>
<style type="text/css">
    div.TelerikModalOverlay {
        opacity: 0.75 !important;
        background-color: rgb(0,0,0) !important;
        z-index: 149999;
    }

    .top {
        z-index: 150000;
    }

    .rcbSlide {
        z-index: 900000 !important;
    }

    .numericPages {
        display: inline-block;
    }

    .GridLoadingPanel {
        width: 100%;
        height: 100%;
        background-color: white;
        top: 50px;
    }
</style>
<telerik:RadScriptBlock ID="rsbCustomPagerCode" runat="server">
    <script type="text/javascript">
        var tableView = null;
        function pageLoad(sender, args) {
            tableView = $find("<%= grdSearchResults.ClientID %>").get_masterTableView();
            var arrRows = tableView.get_dataItems();
            for (var i = 0; i < arrRows.length; i++) {
                var imgCar = arrRows[i].findElement("imgCar");
                if (imgCar.src.indexOf("vehicle-silhouette.jpg") > 0) {
                    tableView.fireCommand("SetImage", i);
                    break;
                } // end if
            } // end for
        } // end pageLoad()

        function cboPageSize_SelectedIndexChanged(sender, args) {
            tableView.set_pageSize(sender.get_value());
        } // end cboPageSize_SelectedIndexChanged()

        function changePage(argument) {
            tableView.page(argument);
        } // end changePage()

        function numCurrentPage_ValueChanged(sender, args) {
            tableView.page(sender.get_value());
        } // end numCurrentPage_ValueChanged()
    </script>
</telerik:RadScriptBlock>
<telerik:RadAjaxLoadingPanel ID="lplLoading" runat="server" CssClass="GridLoadingPanel" Transparency="50" ZIndex="1000000">
    <table style="width: 100%; height: 100%; background-color: white;">
        <tr style="height: 100%">
            <td align="center" valign="middle" style="width: 100%">
                <img alt="Loading..." src='Images/Loading.gif' style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" />
            </td>
        </tr>
    </table>
</telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxManager ID="ramAjaxManager" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="grdSearchResults">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="grdSearchResults" LoadingPanelID="lplLoading"></telerik:AjaxUpdatedControl>
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManager>
<div class="invent-list">
    <div class="inventory-search">
        <asp:DropDownList ID="ddlYear" runat="server" CssClass="select-all-years"></asp:DropDownList>
        <asp:DropDownList ID="ddlMake" runat="server" CssClass="select-all-years" OnSelectedIndexChanged="ddlMake_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>
        <asp:DropDownList ID="ddlModel" runat="server" CssClass="select-all-years"></asp:DropDownList>
        <asp:DropDownList ID="ddlMinPrice" runat="server" CssClass="select-all-years">
            <asp:ListItem Value="" Text="Min Price" />
            <asp:ListItem Value="0" Text="0" />
            <asp:ListItem Value="10000" Text="10000" />
            <asp:ListItem Value="15000" Text="15000" />
            <asp:ListItem Value="20000" Text="20000" />
            <asp:ListItem Value="25000" Text="25000" />
            <asp:ListItem Value="30000" Text="30000" />
            <asp:ListItem Value="35000" Text="35000" />
            <asp:ListItem Value="40000" Text="40000" />
        </asp:DropDownList>
        <asp:DropDownList ID="ddlMaxPrice" class="select-all-years" runat="server">
            <asp:ListItem Value="" Text="Max Price" />
            <asp:ListItem Value="9999" Text="9999" />
            <asp:ListItem Value="14999" Text="14999" />
            <asp:ListItem Value="19999" Text="19999" />
            <asp:ListItem Value="24999" Text="24999" />
            <asp:ListItem Value="29999" Text="29999" />
            <asp:ListItem Value="34999" Text="34999" />
            <asp:ListItem Value="39999" Text="39999" />
            <asp:ListItem Value="" Text="No Max" />
        </asp:DropDownList>
        <%--
        <asp:DropDownList ID="ddlMinMPG" class="select-all-years" runat="server">
            <asp:ListItem Text="Min MPG" Value=""></asp:ListItem>
            <asp:ListItem Text="15" Value="15"></asp:ListItem>
            <asp:ListItem Text="20" Value="20"></asp:ListItem>
            <asp:ListItem Text="25" Value="25"></asp:ListItem>
            <asp:ListItem Text="30" Value="30"></asp:ListItem>
            <asp:ListItem Text="35" Value="35"></asp:ListItem>
            <asp:ListItem Text="40" Value="40"></asp:ListItem>
            <asp:ListItem Text="45" Value="45"></asp:ListItem>
            <asp:ListItem Text="50" Value="50"></asp:ListItem>
        </asp:DropDownList>
        <asp:DropDownList ID="ddlMaxMPG" class="select-all-years" runat="server">
            <asp:ListItem Text="Max MPG" Value=""></asp:ListItem>
            <asp:ListItem Text="15" Value="15"></asp:ListItem>
            <asp:ListItem Text="20" Value="20"></asp:ListItem>
            <asp:ListItem Text="25" Value="25"></asp:ListItem>
            <asp:ListItem Text="30" Value="30"></asp:ListItem>
            <asp:ListItem Text="35" Value="35"></asp:ListItem>
            <asp:ListItem Text="40" Value="40"></asp:ListItem>
            <asp:ListItem Text="45" Value="45"></asp:ListItem>
            <asp:ListItem Text="50" Value="50"></asp:ListItem>
        </asp:DropDownList>
        --%>
        <asp:ImageButton ID="lnkSearchDetailed" runat="server" OnClick="lnkSearchDetailed_Click"
            ImageUrl="~/images/go-button.jpg" align="absmiddle" Width="40" Height="22"></asp:ImageButton>
    </div>
    <div class="sort-by-area" id="dvSortBy" runat="server">
        <div class="sort-by-txt">
            Sort By :
        </div>
        <div class="sort-by-links">
            <ul>
                <li>
                    <asp:LinkButton ID="lnkSortYear" runat="server" Text="Year" OnClick="lnkSortYear_Click"></asp:LinkButton>
                </li>
                <li>
                    <asp:LinkButton ID="lnkSortMake" runat="server" Text="Make" OnClick="lnkSortMake_Click"></asp:LinkButton>
                </li>
                <li>
                    <asp:LinkButton ID="lnkSortModel" runat="server" Text="Model" OnClick="lnkSortModel_Click"></asp:LinkButton>
                </li>
                <li>
                    <asp:LinkButton ID="lnkSortPrice" runat="server" Text="Price" OnClick="lnkSortPrice_Click"></asp:LinkButton>
                </li>
            </ul>
        </div>
    </div>
    <div>
        <telerik:RadGrid ID="grdSearchResults" runat="server" AllowPaging="true" AllowSorting="true" PageSize="1500"
            OnItemDataBound="grdSearchResults_ItemDataBound"
            OnNeedDataSource="grdSearchResults_NeedDataSource"
            OnItemCreated="grdSearchResults_ItemCreated"
            OnItemCommand="grdSearchResults_ItemCommand">
            <PagerStyle AlwaysVisible="true" Position="TopAndBottom" Mode="NumericPages" />
            <ClientSettings EnableAlternatingItems="false"></ClientSettings>
            <MasterTableView CommandItemDisplay="None" AutoGenerateColumns="false"
                NoMasterRecordsText="No vehicles were found matching your search criteria. Try widening your search to match more vehicles.">
                <PagerTemplate>
                    <asp:Panel ID="PagerPanel" Style="padding: 6px; line-height: 24px" runat="server">
                        <div style="float: left">
                            <span style="margin-right: 3px;">Page size:</span>
                            <telerik:RadComboBox ID="cboPageSize" DataSource='<%# new RadComboBoxItem[]{new RadComboBoxItem("All", "1500"), new RadComboBoxItem("10", "10"), new RadComboBoxItem("20", "20"), new RadComboBoxItem("30", "30"), new RadComboBoxItem("40", "40"), new RadComboBoxItem("50", "50")} %>'
                                DataTextField="Text" DataValueField="Value"
                                Style="margin-right: 20px;" Width="40px" SelectedValue='<%# DataBinder.Eval(Container, "Paging.PageSize") %>'
                                runat="server" OnClientSelectedIndexChanged="cboPageSize_SelectedIndexChanged">
                            </telerik:RadComboBox>
                        </div>
                        <div style="margin: 0px; float: right;">
                            Displaying page <%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>
                            of <%# DataBinder.Eval(Container, "Paging.PageCount")%>,
                            items <%# (int)DataBinder.Eval(Container, "Paging.FirstIndexInPage") + 1 %>
                            to <%# (int)DataBinder.Eval(Container, "Paging.LastIndexInPage") + 1 %>
                            of <%# DataBinder.Eval(Container, "Paging.DataSourceCount")%>
                        </div>
                        <div style="width: 400px; margin: 0px; padding: 0px; margin-right: 10px; white-space: nowrap;">
                            <asp:Button ID="cmdFirstPage" runat="server" OnClientClick="changePage('first'); return false;"
                                CommandName="Page" CommandArgument="First" Text=" " CssClass="rgPageFirst"></asp:Button>
                            <asp:Button ID="cmdPrevPage" runat="server" OnClientClick="changePage('prev'); return false;"
                                CommandName="Page" CommandArgument="Prev" Text=" " CssClass="rgPagePrev"></asp:Button>
                            <asp:Panel runat="server" ID="NumericPagerPlaceHolder" CssClass="numericPages"></asp:Panel>
                            <%--<span style="vertical-align: middle;">Page:</span>
                            <telerik:RadNumericTextBox ID="numCurrentPage" Width="25px" Value='<%# (int)DataBinder.Eval(Container, "Paging.CurrentPageIndex") + 1 %>'
                                runat="server" AutoPostBack="false">
                                <ClientEvents OnValueChanged="numCurrentPage_ValueChanged"></ClientEvents>
                                <NumberFormat DecimalDigits="0"></NumberFormat>
                            </telerik:RadNumericTextBox>
                            <span style="vertical-align: middle;">of <%# DataBinder.Eval(Container, "Paging.PageCount")%></span>--%>
                            <asp:Button ID="cmdNextPage" runat="server" OnClientClick="changePage('next'); return false;"
                                CommandName="Page" CommandArgument="Next" Text=" " CssClass="rgPageNext"></asp:Button>
                            <asp:Button ID="cmdLastPage" runat="server" OnClientClick="changePage('last'); return false;"
                                CommandName="Page" CommandArgument="Last" Text=" " CssClass="rgPageLast"></asp:Button>
                        </div>
                    </asp:Panel>
                </PagerTemplate>
                <Columns>
                    <telerik:GridTemplateColumn>
                        <ItemTemplate>
                            <div class="list-box">
                                <div class="list-box-head">
                                    <a href='cardetails.aspx?VIN=<%# Eval("VIN")%>'>
                                        <asp:Literal runat="server" ID="Lit_CarName"></asp:Literal>
                                    </a>
                                    <asp:HiddenField ID="hdnCar" runat="server" />
                                    <asp:HiddenField ID="hdnYear" runat="server" Value='<%# Eval("YEAR")%>' />
                                    <asp:HiddenField ID="hdnMake" runat="server" Value='<%# Eval("MAKE_NAME")%>' />
                                    <asp:HiddenField ID="hdnModel" runat="server" Value='<%# Eval("SERIES")%>' />
                                    <asp:HiddenField ID="hdnVIN" runat="server" Value='<%# Eval("VIN")%>' />
                                    <asp:HiddenField ID="hdnMSRP" runat="server" Value='<%# Eval("MSRP")%>' />
                                    <asp:HiddenField ID="hdnSTYLE" runat="server" Value='<%# Eval("STYLE")%>' />
                                    <asp:HiddenField ID="hdnPhoto" runat="server" Value='<%# Eval("IMG_URL")%>' />
                                    <asp:HiddenField ID="hdnImageCount" runat="server" Value='<%# Eval("IMG_COUNT")%>' />
                                </div>

                                <div class="list-box-content">
                                    <div class="inventoryItemDetailThumbnail">
                                        <a href='cardetails.aspx?VIN=<%# Eval("VIN")%>' style="border: 0px;">
                                            <asp:Image BorderStyle="None" Width="175" ID="imgCar" runat="server" ImageUrl="/images/vehicle-silhouette.jpg" /></a>
                                    </div>
                                    <div class="inventoryItemDetailColumn1">
                                        <table>
                                            <tr>
                                                <td class="inventoryItemDetailLabel1">Body Style :</td>
                                                <td class="inventoryItemDetailData1">
                                                    <asp:Label ID="lblBody" runat="server" Text='<%# Eval("SEGMENT")%>'></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="inventoryItemDetailLabel1">Engine :</td>
                                                <td class="inventoryItemDetailData1">
                                                    <asp:Label ID="lblEngine" runat="server" Text='<%# Eval("ENGINE")%>'></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="inventoryItemDetailLabel1">Ext. color :</td>
                                                <td class="inventoryItemDetailData1">
                                                    <asp:Label ID="lblExteriorColor" runat="server" Text='<%# Eval("COLOR")%>'></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="inventoryItemDetailLabel1">VIN :</td>
                                                <td class="inventoryItemDetailData1">
                                                    <asp:Label ID="lblVIN" runat="server" Text='<%# Eval("VIN")%>'></asp:Label>
                                                </td>
                                            </tr>
                                            <%--<tr>
                                                <td class="inventoryItemDetailLabel1">Int Color :</td>
                                                <td class="inventoryItemDetailData1">
                                                    <asp:Label ID="lblInteriorColor" runat="server" Text='<%# Eval("")%>'></asp:Label>
                                                </td>
                                            </tr>--%>
                                            <tr>
                                                <td class="inventoryItemDetailLabel1">Stock Number :</td>
                                                <td class="inventoryItemDetailData1">
                                                    <asp:Label ID="lblStockNo" runat="server" Text='<%# Eval("STOCK_NO")%>'></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="inventoryItemDetailLabel1">Trim :</td>
                                                <td class="inventoryItemDetailData1">
                                                    <asp:Label ID="lblTrim" runat="server" Text='<%# Eval("STYLE")%>'></asp:Label>
                                                </td>
                                            </tr>
                                        </table>
                                    </div>
                                    <div class="inventoryItemDetailColumn2">
                                        <table>
                                            <tr>
                                                <td class="inventoryItemDetailLabel2">MSRP :</td>
                                                <td class="inventoryItemDetailData2">
                                                    <asp:Label ID="lblmsrp" runat="server"></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="inventoryItemDetailLabel2">
                                                    <asp:Label ID="lblMileageLabel" runat="server"></asp:Label>
                                                </td>
                                                <td class="inventoryItemDetailData2">
                                                    <asp:Label ID="lblMileage" runat="server" Text='<%# string.Format("{0:n0}", Eval("MILEAGE"))%>'></asp:Label>
                                                </td>
                                            </tr>
                                            <%--<tr>
                                                <td class="inventoryItemDetailLabel2">Transmission :</td>
                                                <td class="inventoryItemDetailData2">
                                                    <asp:Label ID="lblTransmission" runat="server"></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="inventoryItemDetailLabel2">Drivetrain :</td>
                                                <td class="inventoryItemDetailData2">
                                                    <asp:Label ID="lblDrivetrain" runat="server"></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td class="inventoryItemDetailLabel2">Model Code :</td>
                                                <td class="inventoryItemDetailData2">
                                                    <asp:Label ID="lblModelCode" runat="server"></asp:Label>
                                                </td>
                                            </tr>--%>
                                        </table>
                                    </div>
                                    <div class="list-box-button">
                                        <div id="divOfferButton" runat="server">
                                            <a href='deal.aspx?VIN=<%# Eval("VIN")%>' target="RadWindow1" onclick="window.radopen(null, 'RadWindow1');" class="offer-button"></a>
                                        </div>
                                        <div id="divRebateButton" runat="server">
                                            <a href='rebates.aspx?VIN=<%# Eval("VIN")%>' class="incentive-button"></a>
                                        </div>
                                        <div id="divViewDetailsButton" runat="server">
                                            <a href='cardetails.aspx?VIN=<%# Eval("VIN")%>' class="viewdetail-button"></a>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
</div>
<telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    <Windows>
        <telerik:RadWindow ID="RadWindow1" runat="server"
            CssClass="top PriceTimeWindow"
            VisibleTitlebar="true"
            VisibleStatusbar="false"
            Modal="true"
            Width="650"
            Height="625"
            Behaviors="Close">
        </telerik:RadWindow>
    </Windows>
</telerik:RadWindowManager>

Here is the relavent codebehind:

protected void grdSearchResults_ItemDataBound(object sender, GridItemEventArgs e) {
            if (e.Item is GridDataItem) {
                System.Web.UI.WebControls.Image imgCar = e.Item.FindControl("imgCar") as System.Web.UI.WebControls.Image;
                System.Web.UI.HtmlControls.HtmlControl divOfferButton = e.Item.FindControl("divOfferButton") as System.Web.UI.HtmlControls.HtmlControl;
                System.Web.UI.HtmlControls.HtmlControl divRebateButton = e.Item.FindControl("divRebateButton") as System.Web.UI.HtmlControls.HtmlControl;
                HiddenField hdnVIN = e.Item.FindControl("hdnVIN") as HiddenField;
                HiddenField hdnCar = e.Item.FindControl("hdnCar") as HiddenField;
                HiddenField hdnYear = e.Item.FindControl("hdnYear") as HiddenField;
                HiddenField hdnMake = e.Item.FindControl("hdnMake") as HiddenField;
                HiddenField hdnModel = e.Item.FindControl("hdnModel") as HiddenField;
                HiddenField hdnMSRP = e.Item.FindControl("hdnMSRP") as HiddenField;
                HiddenField hdnSTYLE = e.Item.FindControl("hdnSTYLE") as HiddenField;
                HiddenField hdnPhoto = e.Item.FindControl("hdnPhoto") as HiddenField;
                HiddenField hdnImageCount = e.Item.FindControl("hdnImageCount") as HiddenField;

                Literal litCarName = e.Item.FindControl("Lit_CarName") as Literal;
                Label lblBody = e.Item.FindControl("lblBody") as Label;
                Label lblInterior = e.Item.FindControl("lblInterior") as Label;
                Label lblmsrp = e.Item.FindControl("lblmsrp") as Label;
                Label lblMileage = e.Item.FindControl("lblMileage") as Label;
                Label lblMileageLabel = e.Item.FindControl("lblMileageLabel") as Label;

                litCarName.Text = hdnYear.Value + " " + hdnMake.Value + " " + hdnModel.Value + " " + hdnSTYLE.Value;

                if (lblMileage.Text != "0") {
                    lblMileageLabel.Text = "Mileage :";
                } else {
                    lblMileageLabel.Visible = false;
                    lblMileage.Visible = false;
                } // end else

                hdnCar.Value = litCarName.Text;

                string tempMSRP = hdnMSRP.Value.Replace("$", "");

                if (String.IsNullOrEmpty(tempMSRP)) {
                    lblmsrp.Text = "Call For Price";
                } else {
                    lblmsrp.Text = "$" + String.Format("{0:0,0}", Convert.ToDouble(tempMSRP));
                } // end else

                if (lblmsrp.Text == "$00") {
                    lblmsrp.Text = "Call For Price";
                    divOfferButton.Visible = false;
                } // end if

                divRebateButton.Visible = (StockType == "New");
            } // end if
        } // end grdSearchResults_ItemDataBound()

        protected void grdSearchResults_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) {
            grdSearchResults.DataSource = GetFilteredInventory();
        } // end grdSearchResults_NeedDataSource()

        protected void grdSearchResults_ItemCreated(object sender, GridItemEventArgs e) {
            if (e.Item is GridPagerItem) {
                GridPagerItem gridPager = e.Item as GridPagerItem;
                Control numericPagerControl = gridPager.GetNumericPager();

                Control placeHolder = gridPager.FindControl("NumericPagerPlaceHolder");
                placeHolder.Controls.Add(numericPagerControl);
            } // end if
        } // end grdSearchResults_ItemCreated()

        protected void grdSearchResults_ItemCommand(object sender, GridCommandEventArgs e) {
            switch (e.CommandName) {
                case "SetImage": {
                        int itemIndex = 0;
                        if (e.CommandArgument != null &&
                            e.CommandArgument is string &&
                            int.TryParse(e.CommandArgument.ToString(), out itemIndex)) {
                            GridDataItem item = grdSearchResults.MasterTableView.Items[itemIndex];
                            HiddenField hdnVIN = item.FindControl("hdnVIN") as HiddenField;
                            HiddenField hdnPhoto = item.FindControl("hdnPhoto") as HiddenField;
                            HiddenField hdnImageCount = item.FindControl("hdnImageCount") as HiddenField;
                            Image imgCar = item.FindControl("imgCar") as Image;

                            int imgCnt;
                            int.TryParse(hdnImageCount.Value, out imgCnt);
                            if (imgCnt > 0) {
                                imgCar.ImageUrl = hdnPhoto.Value;
                            } else {
                                imgCar.ImageUrl = CommonFunctions.GetChromeImageUrl(hdnVIN.Value);
                            } // end else
                        } // end if
                    } // end case
                    break;
                default:
                    break;
            } // end switch
        } // end grdSearchResults_ItemCommand()
Pavlina
Telerik team
 answered on 29 Nov 2012
2 answers
254 views
What is the code to change the Heading background colors when exporting to excel from a rad grid?
ttaylor29
Top achievements
Rank 1
 answered on 29 Nov 2012
9 answers
893 views
It seems text of Label property is not visible when DateInput is included inside a DatePicker.

Label is shown here :

<

DateInput ID="Date1" runat="server" Label="Date 1" />

But not here :

<telerik:RadDatePicker ID="Date1" runat="server"  DateInput-Label="Date 1" />

Is it true for you too ?
Etiene
Top achievements
Rank 1
 answered on 29 Nov 2012
1 answer
72 views
Hiya,

I been running through this forum several times trying to find a scenario similar to mine but I have not seen any. In my situation I'm using Telerik ASP.NET AJAX Q2 and Telerik Reporting Q3. I've created a test report using Telerik Reporting's Report Designer which I intended to be used as printing template for my RadGrid. The problem arises when I've finshed my Grid and .trdx template. I've yet to find a way to make RadGrid to pass over the data into the .trdx template which should appear as PDF embeded in browser. I hope someone could shed a little light to accomplish this task. Thanks in advance.
Pavlina
Telerik team
 answered on 29 Nov 2012
4 answers
236 views
I just upgraded to Q2 2009 and noticed that the mastertableview tablelayout="auto" seems to be ignored and results in a table-layout: fixed; in the markup. This seems to an issue in chrome where my layout for an empty grid breaks. (headers are shuffled left in the commandrow and a gap is left on the right hand side, whereas other browsers suchas a firefox and safari seem to still visually work fine.

Here's my aspx:

<telerik:RadGrid ID="rgLiens" runat="server" EnableEmbeddedSkins="false" Skin="RealMax" 
        OnNeedDataSource="rgLiens_NeedDataSource" OnItemCreated="rgLiens_ItemCreated"  
        ondeletecommand="rgLiens_DeleteCommand" oninsertcommand="rgLiens_InsertCommand"  
        onupdatecommand="rgLiens_UpdateCommand" OnPreRender="rgLiens_PreRender" OnItemDataBound="rgLiens_ItemDataBound" 
        OnRowDrop="rgLiens_RowDrop" GridLines="None" ShowFooter="True" > 
    <ClientSettings EnableRowHoverStyle="true" AllowRowsDragDrop="true"
        <ClientEvents OnRowMouseOut="rowMouseOut" OnRowMouseOver="rowMouseOver" OnPopUpShowing="PopUpCentered" /> 
        <Selecting AllowRowSelect="true" /> 
        <Resizing AllowColumnResize="True" /> 
    </ClientSettings> 
        <FilterMenu EnableTheming="True"
        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation> 
    </FilterMenu> 
    <MasterTableView AutoGenerateColumns="False" CommandItemDisplay="Top" EditMode="EditForms" TableLayout="auto" 
            DataKeyNames="LienId,LienIndex,PropertyId">         
      <NoRecordsTemplate><div style="margin:6px">No liens recorded for this property</div></NoRecordsTemplate>        
      <PagerStyle Mode="NextPrevNumericAndAdvanced" AlwaysVisible="false" /> 
      <ItemStyle CssClass="RowMouseOut" /> 
      <AlternatingItemStyle CssClass="RowMouseOut" /> 
      <RowIndicatorColumn HeaderStyle-Width="20px" /> 
      <ExpandCollapseColumn HeaderStyle-Width="20px" /> 
       
      <Columns> 
        <telerik:GridEditCommandColumn EditImageUrl="~/Images/Buttons/edit.gif" ButtonType="ImageButton" Resizable="false" > 
            <HeaderStyle Width="24px" /> 
            <ItemStyle CssClass="CommandColumn" /> 
        </telerik:GridEditCommandColumn> 
        <Telerik:GridBoundColumn DataField="LienIndex" DataType="System.Int16" ReadOnly="true"
            <HeaderStyle Width="20px" HorizontalAlign="Center" /> 
        </Telerik:GridBoundColumn> 
 
etc 
 
and here's the html generated...

<div id="ctl00_mainPlace_Liens_rgLiens" class="RadGrid RadGrid_RealMax">  
  
                <table cellspacing="0" class="rgMasterTable rgClipCells" border="0" id="ctl00_mainPlace_Liens_rgLiens_ctl00"
                                      
style="width:100%;table-layout:fixed;overflow:hidden;empty-cells:show;">  
    <colgroup>  
        <col width="24px"  />  
        <col width="20px"  />  
        <col width="90px"  />  
        <col width="90px"  />  
        <col width="90px"  />  
        <col width="90px"  />  
        <col />  
        <col />  
        <col />  
        <col />  
        <col />  
        <col width="90px"  />  
        <col width="24px"  />  
    </colgroup>  
<thead>  
        <tr class="rgCommandRow">  
            <td class="rgCommandCell" colspan="13">  
        <table border="0px" width="100%" cellpadding="0px" cellspacing="0px"><tr>  
            <td style="width:20%"><div id="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiensIcon" class="RadToolBar RadToolBar_Horizontal RadToolBar_RealMax RadToolBar_RealMax_Horizontal " style="z-index:9000;">  
                <div class="rtbOuter">  
                    <div class="rtbMiddle">  
                        <div class="rtbInner">  
                            <ul class="rtbUL">  
                                <li class="rtbItem rtbBtn"><title="Click to view all Liens" class="rtbWrap" href="Properties.aspx" style="font-size:140%;"><span class="rtbOut"><span class="rtbMid"><span class="rtbIn"><img alt="Click to view all Liens" src="Images/Buttons/lien.png" class="rtbIcon" /><span class="rtbText">Liens</span></span></span></span></a></li>  
                            </ul>  
                        </div>  
                    </div>  
                </div><input id="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiensIcon_ClientState" name="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiensIcon_ClientState" type="hidden" />  
            </div></td>  
            <td style="width:25%"><div id="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiens" class="RadToolBar RadToolBar_Horizontal RadToolBar_RealMax RadToolBar_RealMax_Horizontal " style="z-index:9000;">  
                <div class="rtbOuter">  
                    <div class="rtbMiddle">  
                        <div class="rtbInner">  
                            <ul class="rtbUL">  
                                <li class="rtbItem rtbBtn"><title="Add new lien" class="rtbWrap" href="#"><span class="rtbOut"><span class="rtbMid"><span class="rtbIn"><img alt="Add new lien" src="Images/Buttons/Add.png" class="rtbIcon" /><span class="rtbText">Add</span></span></span></span></a></li><li class="rtbItem rtbBtn"><title="Edit lien details" class="rtbWrap" href="#"><span class="rtbOut"><span class="rtbMid"><span class="rtbIn"><img alt="Edit lien details" src="Images/Buttons/Edit.gif" class="rtbIcon" /><span class="rtbText">Edit</span></span></span></span></a></li><li class="rtbItem rtbBtn"><title="Delete lien" class="rtbWrap" href="#"><span class="rtbOut"><span class="rtbMid"><span class="rtbIn"><img alt="Delete lien" src="Images/Buttons/Delete.gif" class="rtbIcon" /><span class="rtbText">Delete</span></span></span></span></a></li>  
                            </ul>  
                        </div>  
                    </div>  
                </div><input id="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiens_ClientState" name="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiens_ClientState" type="hidden" />  
            </div></td>  
            <td style="width:40%" align="left">  
            </td>  
            <td style="width:15%" align="right"><div id="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiensRefresh" class="RadToolBar RadToolBar_Horizontal RadToolBar_RealMax RadToolBar_RealMax_Horizontal " style="z-index:9000;">  
                <div class="rtbOuter">  
                    <div class="rtbMiddle">  
                        <div class="rtbInner">  
                            <ul class="rtbUL">  
                                <li class="rtbItem rtbBtn"><title="Refresh data" class="rtbWrap" href="#"><span class="rtbOut"><span class="rtbMid"><span class="rtbIn"><img alt="Refresh data" src="Images/Buttons/Refresh.png" class="rtbIcon" /><span class="rtbText">Refresh</span></span></span></span></a></li>  
                            </ul>  
                        </div>  
                    </div>  
                </div><input id="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiensRefresh_ClientState" name="ctl00_mainPlace_Liens_rgLiens_ctl00_ctl02_ctl00_rtbLiensRefresh_ClientState" type="hidden" />  
            </div></td>  
            </tr></table>  
     </td>  
        </tr><tr style="display:none;">  
            <th scope="col">&nbsp;</th><th scope="col">&nbsp;</th><th scope="col">Loan Amount</th><th scope="col">Interest Rate</th><th scope="col">Payment</th><th scope="col">Arrears</th><th scope="col">Lender</th><th scope="col">Loan Number</th><th scope="col">Loan Date</th><th scope="col">Loan Type</th><th scope="col">Term</th><th scope="col">Loan Balance</th><th scope="col">&nbsp;</th>  
        </tr>  
    </thead><tbody>  
    <tr class="rgNoRecords">  
        <td colspan="13" style="text-align:left;"><div style="margin:6px">No liens recorded for this property</div></td>  
    </tr>  
    </tbody>  
  
</table><input id="ctl00_mainPlace_Liens_rgLiens_ClientState" name="ctl00_mainPlace_Liens_rgLiens_ClientState" type="hidden" />  
                    </div>  
                 
  
            </div>  
        </div>  
  
<div id="ctl00_mainPlace_Liens_RadAjaxLoadingPanel" class="RadAjax RadAjax_Vista " style="display:none;">  
            <div class="raDiv">  
  
            </div><div class="raColor raTransp">  
  
            </div>  
        </div>  
         
    </div><div id="ctl00_mainPlace_RPV_Owners" class="GridPageView" style="display:none;">  

Pavlina
Telerik team
 answered on 29 Nov 2012
1 answer
110 views
I am using Load on Demand ComboBoxes (http://www.telerik.com/support/kb/aspnet-ajax/scheduler/related-load-on-demand-radcomboboxes-in-the-advanced-form-of-radscheduler.aspx) in my Advanced Form.  The combos contain Specialty, Physician, and Contact Number rather than Continent, Country, City.  The Scheduler is setup with TimeLine View and is sorted by Specialty, which is setup as a Resource for Scheduler. 
My issue is that if I double click on a time slot for a Specialty(e.g. Cardiology) when the advanced form loads Cardiology is pre-selected as the Specialty and the Physician combo does not get loaded.  I have to select another specialty for the Physicians to get loaded.  Would it be possible to set Specialty to 'Select a Specialty' No matter what Specialty time slot gets double clicked? 
See attached screenshots



Plamen
Telerik team
 answered on 29 Nov 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?