ToolTips unicode problem? Please help

4 posts, 0 answers
  1. kenneth
    kenneth avatar
    9 posts
    Member since:
    Sep 2010

    Posted 14 Oct 2011 Link to this post

    when using GridTemplateColumn, it wont show french characters like(èèèèèèèèèèèèèèèè) nicely(it will display htmlcode), but if with /telerik:GridBoundColumn, they would be fine.

    Is this a bug? Is there a solution to overcome this problem ? Thanks for help


     <telerik:GridTemplateColumn DataField="Transcription" HeaderText="Response/Transcription"
                                                                    UniqueName="Transcription">
                                            <EditItemTemplate>
                                                <asp:TextBox ID="TextBox2" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.TooltipText") %>' />
                                            </EditItemTemplate>
                                            <ItemTemplate>
                                                <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.TooltipText") %>' />
                                                <telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="Label1" Width="150px"
                                                    RelativeTo="Element" Position="MiddleRight" ManualClose="true">
                                                    <%# DataBinder.Eval(Container, "DataItem.Transcription")%>
                                                </telerik:RadToolTip>
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
  2. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 14 Oct 2011 Link to this post

    Hi Kenneth,

    We are not aware of such a scenario. I also tested this and things seem to be working as expected: http://screencast.com/t/1WReXTFN7f6. Here is the simple code I used for testing, which is based on your sample:
    <telerik:RadGrid runat="server" ID="RadGrid1" OnNeedDataSource="OnNeedDataSource" AutoGenerateColumns="false">
        <MasterTableView>
            <Columns>
                <telerik:GridTemplateColumn DataField="Transcription" HeaderText="Response/Transcription"
                    UniqueName="Transcription">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.TooltipText") %>' />
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.TooltipText") %>' />
                        <telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="Label1" Width="150px"
                            RelativeTo="Element" Position="MiddleRight" ManualClose="true">
                            <%# DataBinder.Eval(Container, "DataItem.Transcription")%>
                        </telerik:RadToolTip>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

    protected void OnNeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        RadGrid1.DataSource = GetData();
    }
     
    protected DataTable GetData()
    {
        DataTable tbl = new DataTable();
        tbl.Columns.Add(new DataColumn("Transcription"));
        tbl.Columns.Add(new DataColumn("TooltipText"));
        tbl.Columns.Add(new DataColumn("ThirdColumn"));
        tbl.Columns.Add(new DataColumn("FourthColumn"));
        tbl.Rows.Add(new object[] { "èèèèèèèèèèèèèèèè", "firstRecord2", "firstRecord3", "firstRecord4" });
        tbl.Rows.Add(new object[] { "other content with èèèèèèèèèèèèèèèè", "secondRecord2", "secondRecord3", "secondRecord4" });
        tbl.Rows.Add(new object[] { "some more èèèèèè", "thirdRecord2", "thirdRecord3", "thirdRecord4" });
        tbl.Rows.Add(new object[] { "and even more èèèèèèèèè", "fourthRecord2", "fourthRecord3", "fourthRecord4" });
        return tbl;
    }


    Can you also confirm the version you are using? If this is an old version which one is it? I generally advise that you upgrade to the latest (currently 2011.2.915) and see if this helps.

    Please also make sure that your datasource does indeed return the proper characters and not the HTML entities in the first place - i.e. try placing the tooltip contents in the targeted label:
    From:
    <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.TooltipText") %>' />

    To:
    <asp:Label ID="Label1" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Transcription")%>' />

    If the label contains the proper characters, yet the tooltip - the entities I strongly advise that you prepare and send us a simple, runnable project that reproduces this behavior so that we can debug it locally and see what is going on. We do not need any complex logic, just a very basic setup resulting in this behavior, for example based on my declarative datasource logic.

    If this is the case you can also try HtmlUtility.HtmlDecode method:
    <telerik:RadToolTip ID="RadToolTip1" runat="server" TargetControlID="Label1" Width="150px"
        RelativeTo="Element" Position="MiddleRight" ManualClose="true">
        <%# HtmlUtility.HtmlDecode(DataBinder.Eval(Container, "DataItem.Transcription"))%>
    </telerik:RadToolTip>



    Regards,
    Marin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. kenneth
    kenneth avatar
    9 posts
    Member since:
    Sep 2010

    Posted 16 Oct 2011 Link to this post

    Hi Marin,

    What if you replaceFirst record, second record, and third record with "èèèèèèèèèèèèèèè"  ??
    To display in this grid?
  5. Marin Bratanov
    Admin
    Marin Bratanov avatar
    3602 posts

    Posted 18 Oct 2011 Link to this post

    Hi Kenneth,

    I replaced all the strings in the datasource with "èèèèèèèèèèèèèèèè" and things seem to be working fine with me: http://screencast.com/t/RX46NqmxQ. Can you confirm that your datasource returns the expected string to a simple label? I am also attaching my test page as a reference. Can you reproduce the issue with my page?


    Greetings,
    Marin
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
Back to Top