Good Afternoon,
I am building an elections app. I would like to use the Telerik Grid to display the candidates and votes. Each candidate will have a table row/record for each precinct vote tally. I have set the ability to group and to group by the candidate column. However I have to click/drag manually to group the candidates.
What I would like is when the page loads is a listing of each candidate grouping with a footer of the total vote count in a collapsed state. Then the user if they want to see a breakdown of the votes by precinct, they can expand the candidate.
Can I setup the grid to do be in this state programatically? If so, can you get me pointed in the right direction?
Below is my grid
<
TelerikGrid
Data
=
"@officeList"
Groupable
=
"true"
>
<
GridAggregates
>
<
GridAggregate
Field
=
"@(nameof(VotingMainModel.Votes))"
Aggregate
=
"@GridAggregateType.Sum"
/>
</
GridAggregates
>
<
GridColumns
>
<
GridColumn
Field
=
"@(nameof(VotingMainModel.Candidate))"
Title
=
"Candidate"
Groupable
=
"true"
/>
<
GridColumn
Field
=
"@(nameof(VotingMainModel.Affiliation))"
Title
=
"Affiliation"
/>
<
GridColumn
Field
=
"@(nameof(VotingMainModel.Precinct))"
Title
=
"Precinct"
/>
<
GridColumn
Field
=
"@(nameof(VotingMainModel.Votes))"
Title
=
"Votes"
>
<
GroupFooterTemplate
>
Total Votes: <
strong
>@context.Sum</
strong
>
</
GroupFooterTemplate
>
</
GridColumn
>
</
GridColumns
>
</
TelerikGrid
>