Telerik Forums
UI for ASP.NET AJAX Forum
7 answers
1.2K+ 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
92 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
182 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
133 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
88 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
109 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
1 answer
58 views
Hi,

the OnClientSelectedIndexChanging event doesn't seem to fire when the Native RenderMode is used.
Is that intentional? Are there other ClientEvents that do not work in Native mode? The documentation only says that skinning is restricted in NativeMode.
Plamen
Telerik team
 answered on 22 May 2013
1 answer
103 views
Hello.

I would like to know how can I change the value of a field when grouping. I have a grid with group enabled. When I group by a field (named status that is a boolen, but, in item data bound I change to: true = ativo, false = inativo), the grid shows me true and false instead of ativo and inativo. How can I fix it? See the attached picture to have a better idea.

One more thing, how can I remove the header text: (Showing 5 of 6 items. Group continues on the next page.) that appears when the paging is enabled?

Best regards.


http://img856.imageshack.us/img856/6273/buggrouping.png


Eyup
Telerik team
 answered on 22 May 2013
1 answer
113 views
Hi ,
    I am using radtreeview with outlook skin. when i make tree node visible false it appears as follows

 
it shows as marked in red box, how to be removed the extra line.

Thanks
Kate
Telerik team
 answered on 22 May 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Top users last month
Miljana
Top achievements
Rank 2
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Bronze
Cynthia
Top achievements
Rank 1
John
Top achievements
Rank 1
Iron
Mozart
Top achievements
Rank 1
Iron
Veteran
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?