This is a migrated thread and some comments may be shown as answers.

RadGrid column text overlapping

4 Answers 128 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Chris Ward
Top achievements
Rank 1
Chris Ward asked on 02 Apr 2010, 07:06 PM
Hi,

I am getting trouble while showing the BOLD text on RadGrid. It is overlapping one column and overflowing on other column. Is there any way to solve this problem?

Thanks in advance.

4 Answers, 1 is accepted

Sort by
0
Vlad
Telerik team
answered on 06 Apr 2010, 07:27 AM
Hi Chris,

Can you post more info about the grid version and how the grid is styled in your case?

Sincerely yours,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Chris Ward
Top achievements
Rank 1
answered on 09 Apr 2010, 12:00 PM
It is telerik grid version 2009.3.1314.1030.

Here is the code of grid implemented

<telerikGrid:RadGridView  Name="RadGvTicketList" DataLoaded="RadGridView_DataLoaded"  
                                  LostFocus="RadGridView_LostFocus"
        SelectionMode="Extended" IsReadOnly="True"  
        AutoGeneratingColumn="RadGridView_AutoGeneratingColumn"
        SelectionChanged="RadGridView_SelectionChanged"
        AutoGenerateColumns="True" telerik:StyleManager.Theme="Office_Blue"  Grid.Row="0">
            <i:Interaction.Behaviors>
                <local:ConditionalFormatingBehavior/>
            </i:Interaction.Behaviors>
            
            <telerikNavigation:RadContextMenu.ContextMenu >
                <telerikNavigation:RadContextMenu telerik:StyleManager.Theme="Office_Blue"
                Opened="RadContextMenu_Opened" ItemClick="RadContextMenu_ItemClick">
                    <telerikNavigation:RadMenuItem Header="{Binding MenuItemViewTicket, Source={StaticResource ResourceString}}"  Tag="Row" />
                    <telerikNavigation:RadMenuItem Header="{Binding ConMenuItemMarkAsRead, Source={StaticResource ResourceString}}" Tag="Row"  />
                    <telerikNavigation:RadMenuItem Header="{Binding ConMenuItemMarkAsUnRead, Source={StaticResource ResourceString}}" Tag="Row"  />
                </telerikNavigation:RadContextMenu>
            </telerikNavigation:RadContextMenu.ContextMenu>
            <telerikGrid:RadGridView.Columns>
            </telerikGrid:RadGridView.Columns>
        </telerikGrid:RadGridView>


In this code you can see we have used conditional behaviour...
            <i:Interaction.Behaviors>
                <local:ConditionalFormatingBehavior/>
            </i:Interaction.Behaviors>

This conditional behaviour changes the font of the grid to bold at the time of binding. Here is the code of conditional formatting


public class ConditionalFormatingBehavior : Behavior<RadGridView>
    {
        protected override void OnAttached()
        {
            base.OnAttached();
            this.AssociatedObject.RowLoaded += new EventHandler<Telerik.Windows.Controls.GridView.RowLoadedEventArgs>(AssociatedObject_RowLoaded);
        }
        /// <summary>
        /// Formating the rows
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void AssociatedObject_RowLoaded(object sender, Telerik.Windows.Controls.GridView.RowLoadedEventArgs e)
        {
            if ((e.Row is GridViewHeaderRow) || (e.Row is GridViewFooterRow) || (e.Row is GridViewNewRow))
                return;
            //we want to apply logic to data rows only
            Binding FontWeightBinding2 = new Binding("TicketFontWeight") { Converter = new Converter() };
            e.Row.SetBinding(GridViewCell.FontWeightProperty, FontWeightBinding2);
             SolidColorBrush brush = new SolidColorBrush();
            Binding colorBinding = new Binding("TicketForGroundColor") { Converter = new Converter() };
            e.Row.SetBinding(GridViewCell.ForegroundProperty, colorBinding);
            Binding colorBinding1 = new Binding("TicketBackGroundColor") { Converter = new Converter() };
            e.Row.SetBinding(GridViewCell.BackgroundProperty, colorBinding1);
        }
    }

Here TicketFontWeight, TicketForGroundColor and TicketBackGroundColor are fields from WCF service. I hope this will make good understanding of problem

Thanks




0
Chris Ward
Top achievements
Rank 1
answered on 13 Apr 2010, 01:05 PM
Hi Telerik,

I need this problem to be solved as soon as possible. Please coordinate with me.

Thanks,.
0
Vlad
Telerik team
answered on 15 Apr 2010, 07:28 AM
Hi,

I've tried to reproduce such behavior with specified version however the grid worked as expected. You can check the attached application for reference.

Kind regards,
Vlad
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
GridView
Asked by
Chris Ward
Top achievements
Rank 1
Answers by
Vlad
Telerik team
Chris Ward
Top achievements
Rank 1
Share this question
or