Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
108 views
I am using the code in:

http://www.telerik.com/help/aspnet-ajax/grid-export-with-ajax-enabled.html

to prevent a toolbar button in an ajaxified grid from causing an ajax update in order to ExportToExcel. It seems to be working fine, but I have found that, upon clicking this button, the grid's loading image in the lower left hand corner is still displayed and never goes away. How can I prevent this from showing when args.set_enableAjax(false)?
Andrey
Telerik team
 answered on 22 May 2013
2 answers
126 views
I have data that requires views to properly pull the correct updated columns from various tables. So a user can update on one webpage a Column for "EstimatedCompletionDate" of a task. Another page has this same date but it applies to a different task. So the easiest way to get the right data into the right grid is to utilize views. I'd like to use the Entity Framework DataSource but I'm not sure how to execute the stored procedure call?

Is there an example of how to do this?

I'm using Rad Controls for ASP.NET AJAX version 2013.1.220.

Thanks
Julian
Top achievements
Rank 1
 answered on 22 May 2013
7 answers
142 views
Hi Telerik and the community ! I'm french dev so sorry for my english .. i've got a problem with a scenario. I try to cancel by javascript the indexchanging on my radlistbox. When i set_cancel(true) my action seems to be canceled but the previous index is not selected and no one of my listitems are selected. After that I can't selected no items.

I hope my explanations are good ... So for exemple my first index is selected, I click on my second inex and I set_cancel(true) and I would like to keep my first item selected.

My radkustbix (populate in pageload for my test)
<telerik:RadListBox runat="server" ID="ListBoxFile" Height="100px" OnClientSelectedIndexChanging="onClientSelectedIndexChangingHandler"
SelectionMode="Multiple" AutoPostBack="false">
</telerik:RadListBox>

My JS script
function onClientSelectedIndexChangingHandler(sender, e)
{
       if(ok)
        {
           do something
         }
         else
          {
           e.set_cancel(true);
          }
 }

I searched since yesterday ... I found not solution for the moment. Hope you can help me. I would like to cancel and keep my previous index selected. I tried to re-set my index with set_selected but I created a loop and indexchanging is recall again and again ..

Thank

Roms
Romain
Top achievements
Rank 1
 answered on 22 May 2013
7 answers
1.3K+ views
Hi,

I have a SQL database table with a description column which has HTML encoded data. I want to display this table's each row in an asp.net 3.5 details view control.
This details view has an template field which displays this column's data. This template field has an aspx Lable control which display's data when the details view is in view mode and a RadEditor which display's data when details view is in edit mode.

But both of these controls display data with HTML tags, but I want to display the data in HTML decoded form. Like plain text with html tag applied on the text, instead of showing along with text in the editor and label.
 
Here is the code-

<asp:DetailsView ID="dv" runat="server" Width="748px" DataSourceID="dvSqlDataSource"
                             DataKeyNames="Id" AutoGenerateRows="False"
        HeaderText="Details" CellPadding="4">    
        <Fields>
         <asp:BoundField DataField="Id" HeaderText="ID" InsertVisible="False" ReadOnly="True" SortExpression="Id" />
<asp:TemplateField HeaderText="Description" SortExpression="Description" >
          <ItemTemplate>
                <asp:Label ID="lblDescription" runat="server" Text='<%# Eval("description") %>' Width="580px"></asp:Label>
            </ItemTemplate>
            <EditItemTemplate>
                <telerik:RadEditor ID="RadEditDesc" SkinID="Edit" runat="server"  ToolsFile="~/Editor/BasicTools.xml" EditModes="Design,Preview" Width="580px" Content='<%#Bind("description")%>' />
                <asp:RequiredFieldValidator ID="valRequireDesc" runat="server" ControlToValidate="RadEditDesc"
                         Display="Dynamic" ErrorMessage="Required" SetFocusOnError="true"  ToolTip="Description is required."  />
            </EditItemTemplate>        
         </asp:TemplateField>       
         
            <asp:CommandField ShowEditButton="True" />       
         
        </Fields>
        <EmptyDataTemplate>No description found!</EmptyDataTemplate>
       </asp:DetailsView>
<asp:SqlDataSource ID="dvSqlDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:MyConnectionString %>"
        SelectCommand="SELECT [ld], [description],FROM [tbldescripion]
 
       UpdateCommand="UPDATE [tbldescription] SET [description] = @description  WHERE [Id] = @Id">
        <UpdateParameters>
             <asp:Parameter Name="Id" Type="Int32" />
 <asp:Parameter Name="description" Type="String" />
        </UpdateParameters>       
    </asp:SqlDataSource>

I have handled this event handler for decoding the text of label control  but It isn't working

protected void dvDeal_OnDataBound(object sender, EventArgs e)
    {
        DetailsView d = (DetailsView)sender;
        foreach (DetailsViewRow row in d.Rows)

        {
            if (row.RowType == DataControlRowType.DataRow)
            {

                foreach (Control c in row.Cells)
                {
                    foreach (Control c1 in c.Controls)
                    {
                        if (c1.GetType() == typeof(Label))
                        {
                            Label l = (Label)c1;
                            l.Text = System.Web.HttpUtility.HtmlDecode(l.Text);
                        }


                  }
          }
        }
 }

Anybody knows, how can we display a html encoded string into the lable control and in RadEditor as well in html decoded form. So that the end user can easily view and edit the description without looking onto these confusing html tags.

Any help will be really appreciated.  

Regards,
dazy
Patrick
Top achievements
Rank 2
 answered on 22 May 2013
3 answers
102 views
Hi,

From client code, how to disable a Radmenu item and give a  disabled image on checking a Listbox item?

Thanks for reply,
Tia.
Shinu
Top achievements
Rank 2
 answered on 22 May 2013
5 answers
198 views
Dear,

I'm developing Time Attendance application so it's using Dates and Time a lot and I created a Grid that has Date fields in it. In Edit or Insert mode if I input 1/1/2013 it work but if I input 31/8/2013 insert/update button won't perform postback, I tried to set the Culture and UICulture to 'en-GB' still not working, and my default Culture is 'en-US' but I need the date input format to be dd/MM/yyyy because I'm developing this application for middle east. 
What is wrong? Am I missing something?

And another one simple request can you provide a resource how to be Ninja in RadGrid I want to learn every event and every single feature in RadGrid.


RadGrid Code:
<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" DataSourceID="obsShiftPeriods" GridLines="None" Skin="Metro" AllowAutomaticDeletes="True" AllowAutomaticInserts="True" AllowAutomaticUpdates="True">
    <MasterTableView CommandItemDisplay="Top" AutoGenerateColumns="False"
        DataSourceID="obsShiftPeriods" DataKeyNames="ShiftId,PeriodId">
        <CommandItemSettings ExportToPdfText="Export to PDF" />
        <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
            <HeaderStyle Width="20px" />
        </RowIndicatorColumn>
        <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
            <HeaderStyle Width="20px" />
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderStyle-Width="3%">
                <HeaderStyle Width="3%" />
            </telerik:GridEditCommandColumn>
            <telerik:GridButtonColumn
                CommandName="Delete"
                Text="Delete"
                UniqueName="DeleteColumn" ButtonType="ImageButton" ImageUrl="~/images/delete.png" ConfirmText="Are you sure?">
            </telerik:GridButtonColumn>
            <telerik:GridDateTimeColumn DataField="DateFrom" DataFormatString="{0:dd/MM/yyyy}" DataType="System.DateTime" FilterControlAltText="Filter DateFrom column" HeaderText="Date From" UniqueName="DateFrom">
            </telerik:GridDateTimeColumn>
            <telerik:GridDateTimeColumn DataField="DateTo" DataFormatString="{0:dd/MM/yyyy}" DataType="System.DateTime" FilterControlAltText="Filter DateTo column" HeaderText="Date To" UniqueName="DateTo">
            </telerik:GridDateTimeColumn>
            <telerik:GridDateTimeColumn DataField="TimeIn" DataType="System.DateTime" DataFormatString="{0:hh:mm tt}" FilterControlAltText="Filter TimeIn column" HeaderText="Time In" PickerType="TimePicker" UniqueName="TimeIn">
            </telerik:GridDateTimeColumn>
            <telerik:GridBoundColumn DataField="GraceIn" DataType="System.Int32" FilterControlAltText="Filter GraceIn column" HeaderText="GraceIn" SortExpression="GraceIn" UniqueName="GraceIn">
            </telerik:GridBoundColumn>
            <telerik:GridDateTimeColumn DataField="TimeOut" DataType="System.DateTime" DataFormatString="{0:hh:mm tt}" FilterControlAltText="Filter TimeOut column" HeaderText="Time Out" PickerType="TimePicker" UniqueName="TimeOut">
            </telerik:GridDateTimeColumn>
            <telerik:GridBoundColumn DataField="GraceOut" DataType="System.Int32" FilterControlAltText="Filter GraceOut column" HeaderText="GraceOut" SortExpression="GraceOut" UniqueName="GraceOut">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="OverTimeStart" DataType="System.Int32" FilterControlAltText="Filter OverTimeStart column" HeaderText="OverTimeStart" SortExpression="OverTimeStart" UniqueName="OverTimeStart">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn DataField="AbsertAfter" DataType="System.Int32" FilterControlAltText="Filter AbsertAfter column" HeaderText="AbsertAfter" SortExpression="AbsertAfter" UniqueName="AbsertAfter">
            </telerik:GridBoundColumn>
            <telerik:GridCheckBoxColumn DataField="Night" DataType="System.Boolean" FilterControlAltText="Filter Night column" HeaderText="Night" SortExpression="Night" UniqueName="Night">
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="Sat" DataType="System.Boolean" FilterControlAltText="Filter Sat column" HeaderText="Sat" SortExpression="Sat" UniqueName="Sat">
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="Sun" DataType="System.Boolean" FilterControlAltText="Filter Sun column" HeaderText="Sun" SortExpression="Sun" UniqueName="Sun">
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="Mon" DataType="System.Boolean" FilterControlAltText="Filter Mon column" HeaderText="Mon" SortExpression="Mon" UniqueName="Mon">
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="Tue" DataType="System.Boolean" FilterControlAltText="Filter Tue column" HeaderText="Tue" SortExpression="Tue" UniqueName="Tue">
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="Wed" DataType="System.Boolean" FilterControlAltText="Filter Wed column" HeaderText="Wed" SortExpression="Wed" UniqueName="Wed">
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="Thu" DataType="System.Boolean" FilterControlAltText="Filter Thu column" HeaderText="Thu" SortExpression="Thu" UniqueName="Thu">
            </telerik:GridCheckBoxColumn>
            <telerik:GridCheckBoxColumn DataField="Fri" DataType="System.Boolean" FilterControlAltText="Filter Fri column" HeaderText="Fri" SortExpression="Fri" UniqueName="Fri">
            </telerik:GridCheckBoxColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
</telerik:RadGrid>
Update1:

I logged error in Google Chrome
please view the image in attachments
Emad Mokhtar
Top achievements
Rank 1
 answered on 22 May 2013
11 answers
157 views
Hello,

I have found some inregularities in the skinning:

Glow
Menu
- Disabled menu items are displaying normal (IE,Chrome,FF,Safari Win)
- Normal items are not showing ok in FF
All skins
- RadDropDownList does not react on mouse like other (radCombobox) controls
- RadDropDownTree does not react on mouse like other (radCombobox) controls
- RadAutoCompleteBox does not react on mouse like other (radTextbox) controls


Regards,

Erik
Kate
Telerik team
 answered on 22 May 2013
9 answers
1.5K+ views
Hi there

I have a large data grid that I need to have a loading panel for. I have got it working by combining code from a few posts. I have two problems though.

1. If I don't set a height on my Grid, the initial loading panel is about about 5pixels high. The problem is that the data records are not all the same height, so it generates the height on load. Is there a way around this?

2. It shows the loading wheel on the initial page load, but not when I browse to other pages in my grid?

ASPX
    <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
        <script type="text/javascript">
            function pageLoad(sender, eventArgs) {
                if (!eventArgs.get_isPartialLoad()) {
                    $find("<%= uxAjaxManager.ClientID %>").ajaxRequest("InitialPageLoad");
                }
            }
        </script>
    </telerik:RadCodeBlock>
<div>
    <telerik:RadAjaxManager ID="uxAjaxManager" runat="server" OnAjaxRequest="uxAjaxManager_AjaxRequest">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="uxAjaxManager">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="uxTitleGrid" LoadingPanelID="uxTitleGridLoadingPanel" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <div class="input_slide">       
        <telerik:RadGrid ID="uxTitleGrid" runat="server"
             AutoGenerateColumns="false" AllowPaging="true" PageSize="20" Width="100%"
             EnableLinqExpressions="false" AllowSorting="true" AllowFilteringByColumn="true"
             OnNeedDataSource="uxTitleGrid_NeedDataSource"
             OnItemDataBound="FormatTitleColumns">
            <GroupingSettings CaseSensitive="false" />
            <MasterTableView>
                <Columns>
                    .
                    .
                    .
                </Columns>  
                <NoRecordsTemplate>
                    No Titles listed for your company.
                </NoRecordsTemplate>                                             
            </MasterTableView>         
        </telerik:RadGrid>          
        <telerik:RadAjaxLoadingPanel ID="uxTitleGridLoadingPanel" runat="server" />
   </div>   
</div>
and here is the code behind
protected void uxAjaxManager_AjaxRequest(object sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
    if (e.Argument == "InitialPageLoad")
    {
        Session["TitlesCanLoad"] = "Yes";
        uxTitleGrid.Rebind();
    }
}
 
protected void uxTitleGrid_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
    if (Session["TitlesCanLoad"].ToString() == "Yes")
    {
        User currentUser = new User(HttpContext.Current.User.Identity.Name.ToString());
        uxTitleGrid.DataSource = RPGService.GetTitles(currentUser.CompanyName, currentUser.UserTypeID);
    }
}
Thanks.
Jako
Top achievements
Rank 1
 answered on 22 May 2013
1 answer
95 views
Hello,

I've got a RadButton with a custom icon working, but I want to use an image from my App_Themes/Blue/Images folder.

I can hardcode the Url like this:
<telerik:RadButton ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click">
    <Icon PrimaryIconUrl="App_Themes/Blue/Images/ButtonImage.gif" PrimaryIconLeft="5" PrimaryIconTop="5" />
 </telerik:RadButton>

But I want to do something like this:
<telerik:RadButton ID="btnLogin" runat="server" Text="Login" OnClick="btnLogin_Click">
    <Icon PrimaryIconUrl='<%# GetThemedUrl("Images/ButtonImage.gif")%>' PrimaryIconLeft="5" PrimaryIconTop="5" />
</telerik:RadButton>

protected string GetThemedUrl(string path)
{
     string url = "~/App_Themes/" + this.Theme + "/" + path;
     return url;
}


However I get an exception saying:

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: Databinding expressions are only supported on objects that have a DataBinding event. Telerik.Web.UI.RadButtonIcon does not have a DataBinding event.

Can this be done? Is there a better way?

Thanks in advance,
Matt
Danail Vasilev
Telerik team
 answered on 22 May 2013
2 answers
119 views
Hi,

We hav a Radpivotgrid which list the property details and we need to integrate with our own library for sharing some information and business needs. Does pivot grid got such a feature?

Thanks,
Team Shell.
Jini
Top achievements
Rank 1
 answered on 22 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Dean
Top achievements
Rank 1
Leland
Top achievements
Rank 2
Iron
Iron
Iron
Emil
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?