This question is locked. New answers and comments are not allowed.
Sébastien ISINGRINI
Top achievements
Rank 1
Sébastien ISINGRINI
asked on 02 Dec 2009, 04:05 PM
Hi,
I need some help with the GridViewDataColumn.ColumnWidthChanged event.
I would like to use this functionality but this event is now marked obsolete on a GridViewDataColumn.
Do you know why?
Do you have an issue to know when a column width is modified by the user in order to save in real time (by a ws) the personalization of his grid (columns width settings)?
Thanks,
Seb
I need some help with the GridViewDataColumn.ColumnWidthChanged event.
I would like to use this functionality but this event is now marked obsolete on a GridViewDataColumn.
Do you know why?
Do you have an issue to know when a column width is modified by the user in order to save in real time (by a ws) the personalization of his grid (columns width settings)?
Thanks,
Seb
3 Answers, 1 is accepted
0
Sébastien ISINGRINI
Top achievements
Rank 1
answered on 03 Dec 2009, 08:48 AM
Waiting for an answer from your team, I found a temporary solution : I use the MouseLeftButtonUp of the grid and make an action is the event OriginalSource is a Border (Visual control of a column side) :
I use a Dictionary<string,double> which contains foreach column.UniqueName the ActualWidth.
I use a Dictionary<string,double> which contains foreach column.UniqueName the ActualWidth.
| private void gdvData_MouseLeftButtonUp(object sender, MouseButtonEventArgs e) |
| { |
| if (e.OriginalSource is Border) |
| { |
| foreach (KeyValuePair<string, double> columnWidth in _dicColumnWidths) |
| { |
| double dblActualWidth = gdvData.Columns[columnWidth.Key].ActualWidth; |
| if (dblActualWidth != columnWidth.Value) |
| { |
| //Update Profil setting |
| } |
| } |
| this.SaveColumnsWidth(); |
| } |
| } |
0
Hello Sébastien ISINGRINI,
This event supports columns layout infrastructure and should not be used directly from your code. Currently we are considering better alternative to it.
I can also suggest alternative approach to yours - since width property is dependency property you can bind to width property of each column.
Attached you will find a project demonstrating how this can be achieved.
If you have any more questions do not hesitate to contact us.
Best wishes,
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
This event supports columns layout infrastructure and should not be used directly from your code. Currently we are considering better alternative to it.
I can also suggest alternative approach to yours - since width property is dependency property you can bind to width property of each column.
Attached you will find a project demonstrating how this can be achieved.
If you have any more questions do not hesitate to contact us.
Best wishes,
Tsvyatko
the Telerik team
Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Sébastien ISINGRINI
Top achievements
Rank 1
answered on 04 Dec 2009, 10:22 AM
Thank you Tsvyatko for the support and the attchment,
Your approach is interesting but provides many calls of PropertyChanged when you are just modifying a column width and would invoke in my case many calls to a webservice to update the profile settings.
My approach updates the profile only when the user releases the mouse so when the column width updating is finished.
So, for the moment I keep mine and I hope the future integrated solution will raise the event only when the mouse will be released ...
Sincerely,
Seb
Your approach is interesting but provides many calls of PropertyChanged when you are just modifying a column width and would invoke in my case many calls to a webservice to update the profile settings.
My approach updates the profile only when the user releases the mouse so when the column width updating is finished.
So, for the moment I keep mine and I hope the future integrated solution will raise the event only when the mouse will be released ...
Sincerely,
Seb