We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

DisplayName attribute not working

Thread ID:

Created:

Updated:

Platform:

Replies:

118128 Feb 3,2015 08:51 AM Feb 6,2015 12:42 AM Windows Forms 4
loading
Tags: GridDataBoundGrid(Classic)
Simon
Asked On February 3, 2015 08:51 AM

My simple customer class:
class Customer
{
    [DisplayName("Customer Name")]
    public string Name { get; private set; }

    public Customer(string name)
    {
        Name = name;
    }
}

And the binding logic on a Form control, which contains GridDataBound control:
public partial class Form1 : Form
{
    private readonly List<Customer> _customers;

    public Form1()
    {
        InitializeComponent();

        _customers = new List<Customer>();
        gridDataBoundGrid1.DataSource = _customers;
    }

    private void BtnAddCustomer(object sender, EventArgs e)
    {
        _customers.Add(new Customer("Customer 1"));
        gridDataBoundGrid1.Refresh();
    }
}

If I run my application the first column in the grid is named 'Name' instead of 'Customer Name'. Is DisplayName attribute supported?

Simon
Replied On February 3, 2015 08:59 AM

A possible workaround:

this.gridDataBoundGrid1.Binder.InternalColumns["Name"].HeaderText = "Customer Name";




Muthukumar Kalyanasundaram [Syncfusion]
Replied On February 4, 2015 12:37 PM

Hi Simon,

 

Thanks for using Syncfusion products.

 

The reported issue with “DisplayName attribute not working" has been confirmed as a defect. We have logged a bug report on this reported query. For this, Please create a DT incident for your query so that we can update the patch for this issue.

 

You can create the DT incident from the following link.

<http://www.syncfusion.com/account/dashboard>

 

In the interests of maintaining confidentiality, we have a policy of not sharing patches or otherwise proprietary customer specific information in the public Forum.

 

Please let me know your concerns.

 

Regards,

Muthukumar K.


Simon
Replied On February 5, 2015 08:00 AM


Muthukumar Kalyanasundaram [Syncfusion]
Replied On February 6, 2015 12:42 AM

Hi Simon,

 

Thank you for update.

 

We will update details for your reported query in that incident 134974. Please refer the incident for better follow up. Please let us know if you need any further assistance.

 

Regards,

Muthukumar K


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;