Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
921 views
Hi, I have  used GridTemplateColumn , how can i format this to 2 decimal places..Code is below


             <telerik:GridTemplateColumn DataType="System.String" DataField="totsal__amt" HeaderText="Year Sales"  
                    HeaderStyle-Width="50px">
                    <ItemTemplate>
                        <div style="text-align: right">
                            <%# Eval("totsal__amt")%>
                        </div>
                    </ItemTemplate>
                    <HeaderStyle Width="140px" HorizontalAlign="Center" />
                    <ItemStyle Width="140px" />
                </telerik:GridTemplateColumn>

Regards,
Kiran
Jayesh Goyani
Top achievements
Rank 2
 answered on 22 Mar 2012
4 answers
257 views

As part on the functionality I am trying to include in my web application, is the ability to “search” the TreeList. I have a field selector drop down list and a text box or check box to enter the search criteria. The search button performs a post back where I then location a match in the data source. Now that I have the matching record, how can I force it to be displayed selected? The result of the search may be a child node somewhere down the hierarchy not currently being displayed. If this is the case I would want the branch with the matching criteria to be expanded to this item. Then I would want to select the item. Does anyone have any ideas on how to force a node to be displayed?

I have not looked into using ExpandItemToLevel since it is liable to expose too many items. I don’t think it would work for one level at a time since I might be calling it for items not displayed, recursive calls.

Tsvetoslav
Telerik team
 answered on 22 Mar 2012
10 answers
298 views
Hi

I am trying to display rad ajax loading panel in a user control, but not able to see it.
any help will be appreciated.

please see my code below:
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server">
    <AjaxSettings>
        <telerik:AjaxSetting AjaxControlID="RadAjaxManagerProxy1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="Panel1" 
                    LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
 </telerik:RadAjaxManagerProxy>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" 
    Skin="Default">
</telerik:RadAjaxLoadingPanel>

Panel 1 has several contols which are getting populated from db when i select an item in rad combo box.

I am initiating callback using following code:

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
  
<script language="javascript">
       
    function Initiate_<%= ClientID %>(){
          
        var ajaxManager = $find("<%= RadAjaxManager.GetCurrent(Page).ClientID %>");
                  
        ajaxManager.ajaxRequest();
        return false;
    }   
</script>
  
  
</telerik:RadCodeBlock>
following is code behind during page load

Dim manager As RadAjaxManager = RadAjaxManager.GetCurrent(Page)
          
AddHandler manager.AjaxRequest, AddressOf manager_AjaxRequest
cmbLookUp.OnClientSelectedIndexChanged = "Initiate_" + Me.ClientID

please help...

thanks
Manik Rawal
Antonio Stoilkov
Telerik team
 answered on 22 Mar 2012
1 answer
171 views
Hi,

I am trying to replace Ajax ActionLink with image instead of text but not getting done, my code is as below, can any one help?

@Ajax.ActionLink("Add ", "LogsGetData", "Logs", new { Id = 0 },
                        new AjaxOptions
                        {
                            UpdateTargetId = "LogEntryDiv",
                            InsertionMode = InsertionMode.Replace,
                            HttpMethod = "GET",
                            OnSuccess = "SettingsOnSuccess"
                        }).ToHtmlString().Replace("Add", "<img src=\"Content/Telerik/Office2007/sprite.png\" ... />")


Above code replace the text "Add" with   <a data-ajax="true" data-ajax-method="GET" data-ajax-mode="replace" data-ajax-success="SettingsOnSuccess" data-ajax-update="#LogEntryDiv"   but doesn't get the image.
Andrey
Telerik team
 answered on 22 Mar 2012
1 answer
117 views
I am showing my search results in a rad grid. Rad grid is inside a panel. Whenever there are empty cells, column lines are becoming invisible.
I used the below code in prerender event of the grid, still columns lines become invisible for empty cells.
This scenario happens sometimes on grid refresh.

protected void rgMyGrid_PreRender(object sender, EventArgs e)
        {
            try
            {
 
                foreach (GridDataItem item in rgMyGrid.MasterTableView.Items)
                {
                    if (item is GridDataItem)
                    {
                        foreach (GridColumn col in rgMyGrid.Columns)
                        {
                            //Add space to the cell that has null or empty value
                            if (!col.ColumnType.Equals("GridTemplateColumn"))
                            {
                                if (string.IsNullOrEmpty(item[col.UniqueName].Text.Trim())
                                    || item[col.UniqueName].Text.Equals(" "))
                                {
                                    item[col.UniqueName].Text = " ";
                                }
                            }
                            else
                            {
                                #region AllowSpaceInCols
                                switch (col.UniqueName)
                                {
                                    case "lblColumn1":
                                        Label lblColumn1= item.FindControl("lblColumn1") as Label;
                                        if (lblColumn1.Text.Trim().Equals(String.Empty)
                                            || lblColumn1.Text.Trim().Equals(" "))
                                        {
                                            lblColumn1.Text = " ";
                                        }
                                        break;
 
                                    case "Column2":
                                        Label lblColumn2 = item.FindControl("lblColumn2") as Label;
                                        if (lblColumn2 .Text.Trim().Equals(String.Empty)
                                            || lblColumn2 .Text.Trim().Equals(" "))
                                        {
                                            lblColumn2 .Text = " ";
                                        }
                                        break;
 
                                    default:
                                        break;
                                }
                                #endregion
                            }
                        }
                    }
 
                }
            }
            catch (Exception ex)
            {
 
            }
        }
Shinu
Top achievements
Rank 2
 answered on 22 Mar 2012
1 answer
89 views
Hi I have page where is usercontrol with message
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Message.ascx.cs" Inherits="Elearning.Usecases.UserControl.Message" %>
 
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>
<script type="text/javascript">
    $(document).ready(function () {
 
        setTimeout(function () {
            $("#<%=MessageContainer.ClientID %>").fadeOut("slow", function () {
                $("#<%=MessageContainer.ClientID %>").remove();
            });
        }, 2000);
        $('.closeImage').click(function () {
            $(this).parent().hide();
        });
 
    });
</script>
<div Class="Message">
<asp:Panel ID="MessageContainer"  runat="server">
    <asp:Image ID="CloseImage" CssClass="closeImage icon" Style="float: right;" runat="server" ImageUrl='<%# HermesControl.GetAppItemRelativeUrl(Elearning.ElearningCommon.Icons.Delete  ) %>' />
    <asp:Label ID="lblMessage" EnableViewState="false" runat="server" />
</asp:Panel>
</div>
Main page 
<telerik:RadAjaxManagerProxy ID="AjaxManagerProxy1" runat="server">
        <telerik:AjaxSetting AjaxControlID="imgbtnShowMessagetnSave">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="message1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
        <telerik:AjaxSetting AjaxControlID="message1">
            <UpdatedControls>
                <telerik:AjaxUpdatedControl ControlID="message1" LoadingPanelID="RadAjaxLoadingPanel1" />
            </UpdatedControls>
        </telerik:AjaxSetting>
    </AjaxSettings>
</telerik:RadAjaxManagerProxy>
<include:message ID="message1" runat="server" />
<asp:Button runat="server" ID="btnShowMessage"/>

And if a call show messages, then message show but don´t hide after two second.
Please you know why?

Thanks and sorry for my english 

Tsvetina
Telerik team
 answered on 22 Mar 2012
1 answer
153 views
hi,

I have many records in my rad grid and its being contained in fixed height <div style="max-height: 350px; overflow-y:scroll">
what happens now is that the div is scrolling vertically, but in this scenario when the user is scrolling, so he would lose the the name of columns (header of each column) and the footer as well

as rad grid is rendered  as html table, how can I keep <thead> and <tfoot> and make the scroll only in <tbody> ?

here is my rad grid:
[note that I am loading datasource of my grid in client side]


<telerik:RadGrid ID="gvViolation" EnableViewState="false" runat="server"
    AllowPaging="true" AllowSorting="True" AllowFilteringByColumn="false" GridLines="None" Skin="Sunset" Width="735px" PageSize="3">
 
        <ExportSettings OpenInNewWindow="true" >
             <Pdf Author="WheelTrack" Creator="WheelTrack" />
        </ExportSettings>
 
        <MasterTableView AllowMultiColumnSorting="true" TableLayout="Fixed" >
 
     
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
 
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
 
        <PagerStyle Mode="NextPrevAndNumeric" />
        <CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true" ShowExportToPdfButton="true" ShowAddNewRecordButton="false" ShowExportToCsvButton="true"    />
 
        <Columns>
            <telerik:GridBoundColumn DataField="Device_Name" HeaderText="Device Name" />
            <telerik:GridBoundColumn DataField="Device_Desc" HeaderText="Device Desc" />
            <telerik:GridBoundColumn DataField="Rule_Name" HeaderText="Rule Name" />
            <telerik:GridBoundColumn DataField="ViolationText" HeaderText="Violation" />
            <telerik:GridBoundColumn DataField="Latitude" HeaderText="Latitude" />
            <telerik:GridBoundColumn DataField="Longtitude" HeaderText="Longtitude" />
            <telerik:GridBoundColumn DataField="UTC_Date" HeaderText="Violation Date" />
            <telerik:GridBoundColumn DataField="UTC_Time" HeaderText="Violation Time" />
            <telerik:GridBoundColumn DataField="Location_NearBy" HeaderText="Location NearBy" />
        </Columns>
    </MasterTableView>
 
     
        <FilterMenu EnableImageSprites="False"></FilterMenu>
 
        <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Sunset"></HeaderContextMenu>
 
    <PagerStyle AlwaysVisible="true" Mode="NumericPages"/>
    <ClientSettings>
        <ClientEvents OnCommand="gvViolation_Command" />
    </ClientSettings>
</telerik:RadGrid>
Jayesh Goyani
Top achievements
Rank 2
 answered on 22 Mar 2012
1 answer
141 views
How can I set a RadToolBarDropDown to have its dropdownwidth expand as needed so that it's child buttons don't get wrapped?  The button text will vary so the dropdownwidth cannot be hard coded.
Princy
Top achievements
Rank 2
 answered on 22 Mar 2012
3 answers
112 views
Dear Support:
i need to modify css of textbox in RadGrid footer template when page load. 
I have tried many times, still can not work, i don't know why, pls help me! Thanks!

Code is below:
function Load(sender, args) {
                sumInput = sender;
 
                sender.get_styles().EnabledStyle[0] += "color:Red;";
                sender.updateCssClass();
            }
<telerik:RadGrid ID="grdPlans" runat="server" AutoGenerateColumns="false">
                        <MasterTableView EditMode="InPlace" ShowFooter="True" TableLayout="Fixed" DataKeyNames="ProjectId">
                            <Columns>
                                <telerik:GridBoundColumn DataField="ProjectId" HeaderText="Project Id">
                                    <HeaderStyle Width="10%" />
                                </telerik:GridBoundColumn>
                                <telerik:GridTemplateColumn HeaderText="Jan" DataField="Jan" UniqueName="Jan">
                                    <ItemTemplate>
                                        <telerik:RadNumericTextBox ID="txbMonth1" runat="server" Text='<%#Bind("Jan") %>'
                                            Width="50px" IncrementSettings-InterceptArrowKeys="true" IncrementSettings-InterceptMouseWheel="true"
                                            NumberFormat-DecimalDigits="1" MinValue="0" MaxValue="150">
                                            <ClientEvents OnBlur="Blur1" OnFocus="Focus1" />
                                        </telerik:RadNumericTextBox>
                                    </ItemTemplate>
                                    <FooterTemplate>
                                        <telerik:RadNumericTextBox ID="txbTotal1" runat="server" ReadOnly="true" NumberFormat-DecimalDigits="1"
                                            Width="50px">
                                            <ClientEvents OnLoad="Load" />
                                        </telerik:RadNumericTextBox>
                                    </FooterTemplate>
                                </telerik:GridTemplateColumn>
Shinu
Top achievements
Rank 2
 answered on 22 Mar 2012
3 answers
98 views
Hi
I am just stuck with below scenario
 Having an grid with delete template field and radconfirm when clicking on that template.and  i used ajaxrequest to ajaxify the grid during OK click on radconfirm.it works fine.My problem is i need to use another confirmation on the same page.and during OK click i need to ajaxify another control not the previous gird.How it is possible?
Abhishek
Top achievements
Rank 2
 answered on 22 Mar 2012
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?