Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8758069
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T14:27:12+00:00 2026-06-13T14:27:12+00:00

I have an Ellipse in a DataGridTemplateColumn, the data it is bound to displays

  • 0

I have an Ellipse in a DataGridTemplateColumn, the data it is bound to displays correctly in the next column but my ellipse column is always empty, nothing displayed.

<DataGridTemplateColumn CanUserResize="False" Header="StateEllipse">
    <DataGridTemplateColumn.CellTemplate>
        <DataTemplate>
            <StackPanel>
                <Ellipse Fill="{Binding Path=State, Converter={StaticResource StateToBrush}}" Width="10" Height="10" />
                <TextBlock Text="{Binding Path=State}" />
            </StackPanel>
        </DataTemplate>
    </DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Header="State" Binding="{Binding Path=State}" />

My Converter looks like this :

using System;
using System.Globalization;
using System.Windows.Data;
using System.Windows.Media;

namespace ThisNS.NS.Converter
{
    [ValueConversion(typeof(int), typeof(Brush))]
    public sealed class StateToBrush : IValueConverter
    {

    #region IValueConverter Members

        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            Color stateColor = Colors.Yellow;
            switch ((int)value)
            {
                case 0:
                    stateColor = Colors.Green;
                    break;
                case 1:
                    stateColor = Colors.Red;
                    break;
            }
            return new SolidColorBrush(Colors.Yellow);
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }

    #endregion
    }
}

My second column that displays the State value is ok but the first one with the ellipse is always empty.

The converter is never called, so the binding is never binded.

Somebody has an idea/suggestion?

Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T14:27:14+00:00Added an answer on June 13, 2026 at 2:27 pm

    Looks like you are failing to set the size of the Ellipse?

    You have to set its Width and Height properties in order for it to show I believe…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this code to draw an ellipse in the screen but I don't
I have a DepencencyProperty (a boolean) that works fine on an Ellipse, but not
I have a simple handler that adds an ellipse to an empty Silverlight canvas
I have drawn ellipse: CGContextFillEllipseInRect(contextRef, CGRectMake(50, 50, 50, 128)); But i only need a
I have a java program which displays an ellipse on the screen and changes
I have some shaped created using flex primitive classes like ellipse , rectangle, path
I have a small problem with the visibility of an ellipse. In runtime I
I have two curves, one inside another, for example ellipse inside circle. I need
I have container of geometrical entities. Let's assume there is circle, ellipse, line, arc.
I have an ellipse that I'd like to programatically put into a canvas. Unfortunately,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.