Good day Telerik Team,
I've seen your sample demos and forums about saving/loading gridview settings and it works fine. But your RadGridViewSettings.cs does not support hide columns functionality which i really need to save as part of the gridview setting(s).
I do need this one, can anyone help me with this functionality or maybe give me sample code(s) for this.
Hoping for reply
Aubrey :')
I've seen your sample demos and forums about saving/loading gridview settings and it works fine. But your RadGridViewSettings.cs does not support hide columns functionality which i really need to save as part of the gridview setting(s).
I do need this one, can anyone help me with this functionality or maybe give me sample code(s) for this.
Hoping for reply
Aubrey :')
4 Answers, 1 is accepted
0
Hi aubrey,
Maya
the Telerik team
You may expose a new property IsVisible for example in the ColumnSettings class and use it for keeping the corresponding property of the columns.
Maya
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

aubrey
Top achievements
Rank 1
answered on 03 Jun 2011, 08:06 AM
Hi Maya,
Thanks for your immediate reply. Am a little confused on how to mange this one, can you give me code snippet for this? :'(
am still studying your RadGridViewSettings.cs.
Thanks
Aubrey :')
Thanks for your immediate reply. Am a little confused on how to mange this one, can you give me code snippet for this? :'(
am still studying your RadGridViewSettings.cs.
Thanks
Aubrey :')
0
Accepted
Hi aubrey,
Setting and getting its value will be again similar to those of the other properties for the column - in the SaveState() method:
and LoadState():
Best wishes,
Maya
the Telerik team
Defining a IsVisible property would be exactly the same as the others in that class:
public class ColumnSetting : PropertySetting
{
bool _IsVisible;
public bool IsVisible
{
get
{
return _IsVisible;
}
set
{
_IsVisible= value;
}
}
}
}
Setting and getting its value will be again similar to those of the other properties for the column - in the SaveState() method:
foreach (GridViewColumn column in grid.Columns)
{
if (column is GridViewDataColumn)
{
GridViewDataColumn dataColumn = (GridViewDataColumn)column;
ColumnSetting setting = new ColumnSetting();
setting.PropertyName = dataColumn.DataMemberBinding.Path.Path;
setting.UniqueName = dataColumn.UniqueName;
setting.Header = dataColumn.Header;
setting.Width = dataColumn.ActualWidth;
setting.DisplayIndex = dataColumn.DisplayIndex;
setting.IsVisible = dataColumn.IsVisible;
Settings.ColumnSettings.Add(setting);
}
}
and LoadState():
column.IsVisible= currentSetting.IsVisible;
Maya
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

aubrey
Top achievements
Rank 1
answered on 03 Jun 2011, 09:11 AM
Hi Maya,
Sorry for the late reply. I've done studying your RadGridViewSettings.cs. and i also tried your code.. It works great! :')
Thank you so much Maya!!
Regards
Aubrey :')
Sorry for the late reply. I've done studying your RadGridViewSettings.cs. and i also tried your code.. It works great! :')
Thank you so much Maya!!
Regards
Aubrey :')