This question is locked. New answers and comments are not allowed.
Hi,
We are in the process of evaluating your MVC product and ran into some trouble dealing with grouping/aggregating data. Our use case calls for us to bind the grid to a DataTabe, but we have no design time knowledge of what columns appear in the table and need to dynamically choose which columns should be displayed in the grid (can this be done with the Bound() feature?). We had no trouble up until the point at which we tried to enable group/aggregation. Using our meta data (stored per user) we want to be able to dynamically assign aggregation settings to a column. I have been unable to figure determine how to achieve this. Do you have any suggestions? Do you support this?
I have embedded a sample of my code from my view to help paint the picture of how we are setting up our grid. We are leveraging the LoadSettings( ) method to loading a enumerable of GridColumnSettings.
Thanks for your time and we look forward to your response.
We are in the process of evaluating your MVC product and ran into some trouble dealing with grouping/aggregating data. Our use case calls for us to bind the grid to a DataTabe, but we have no design time knowledge of what columns appear in the table and need to dynamically choose which columns should be displayed in the grid (can this be done with the Bound() feature?). We had no trouble up until the point at which we tried to enable group/aggregation. Using our meta data (stored per user) we want to be able to dynamically assign aggregation settings to a column. I have been unable to figure determine how to achieve this. Do you have any suggestions? Do you support this?
I have embedded a sample of my code from my view to help paint the picture of how we are setting up our grid. We are leveraging the LoadSettings( ) method to loading a enumerable of GridColumnSettings.
var gSettings = Html.Telerik( ).Grid( Model.ActiveDataSet ) .Name( "gvwYetiTasks" ) .DataBinding( dataBinding => dataBinding.Ajax( ).Select( "AjaxBinding", "Telerik", new {id = Model.ActiveDataPanel.ID.GetValueOrDefault( )} ) ) .Pageable( p => p.Enabled( true ).PageOnScroll( true ).PageSize( 50 ) ) .Sortable( s => s.Enabled( true ).SortMode( GridSortMode.MultipleColumn ) ) .Scrollable( s => s.Enabled( true ) ) .Groupable( g => g.Enabled( true ).Visible( true ) ) .Reorderable( r => r.Columns( true ) ) .Resizable( s => s.Columns( true ) ) .Selectable( s => s.Enabled( true ) ) .Filterable( ); IList<GridColumnSettings> colSettings = new List<GridColumnSettings>( ); foreach ( var f in Model.ActiveDataPanelView.UserGridSetting.Fields.Where( vf => vf.VisibleIndex >= 0 ).OrderBy( vf => vf.VisibleIndex ) ) { var dpf = Model.ActiveDataPanel.GetFieldByFieldName( f.FieldName ); var colStg = new GridColumnSettings {Title = f.DisplayName, Visible = ( f.VisibleIndex >= 0 ), Sortable = true, Member = f.FieldName, Groupable = true, Width = "200px;", Format = dpf.Format, Filterable = true}; if ( dpf.SummaryItemType != SummaryItemType.Undefined && dpf.SummaryItemType != SummaryItemType.None && dpf.SummaryItemType != SummaryItemType.WeightedAverage ) { //want to set summary item data here } colSettings.Add( colStg ); } gSettings.Columns( cols => cols.LoadSettings( colSettings ) ); gSettings.Render( );Thanks for your time and we look forward to your response.