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

ColumnWidthChanged

1 Answer 72 Views
ListView
This is a migrated thread and some comments may be shown as answers.
Dev
Top achievements
Rank 1
Dev asked on 20 Jun 2013, 11:03 AM
HI,

I'm porting over our custom ListView conrol to use the RadListView, however the standard ListView has the ColumnWidthChanged event and the RadListView doesn't, please could someone tell me the best event to use to detect when a column has been resized.

Many thanks,
Rich.

1 Answer, 1 is accepted

Sort by
0
Paul
Telerik team
answered on 24 Jun 2013, 02:51 PM
Hello Dev,

Thank you for writing.

Perhaps the best way to detect whether a column has been resized would be to subscribe to the PropertyChanged event for all columns:
foreach (ListViewDetailColumn column in this.radListView1.Columns)
{
    column.PropertyChanged += Columns_PropertyChanged;
}

and then check if the property is the one you need:
void Columns_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
    if (e.PropertyName == "Width")
    {
        ListViewDetailColumn column = sender as ListViewDetailColumn;
        if (column != null)
        {
            column.HeaderText = column.Name + " Width changed";
        }
    }
}
That should do the work.

Please do not hesitate to contact us, should have further questions.

Regards,
Paul
Telerik
RadChart for WinForms is obsolete. Now what?
Tags
ListView
Asked by
Dev
Top achievements
Rank 1
Answers by
Paul
Telerik team
Share this question
or