Reputation: 1
i have some problem in gridex janus
thanks
Upvotes: 0
Views: 2998
Reputation: 1
GridEX.RootTable.Columns("YourColumnsName").TotalFormatString = "N0"
0 is odd number
too late but hope can be useful for another person. :)
Upvotes: 0
Reputation: 24132
As to set the value in total row, you have to set the aggregate function, which I don't know whether you're aware of. Here's an example, for the sake of comprehensiveness.
GridEX.TotalRow = InheritableBoolean.True
GridEX.RootTable.Columns("MyColumn").AggregateFunction = AggregateFunction.Count
As for the aggregate function to choose, simply select the one you require among those available.
As for formatting the string for the total row, I am still looking for this information myself. I'll update as soon as I get the details.
And by the way, here are some other questions from which you might find the information about the formatting options, here on SO: https://stackoverflow.com/questions/tagged/gridex
, in case it helps meanwhile.
EDIT
When you wish to customize the total row cells content, you ought to aggregate the summary manually through your GridEX's DataSource
, for example, or through the RowCount
property if you simply wish a count.
When you initialize your GridEX control, you have to set the TotalRow
to the appropriate value as shown above. Then, implement the FormattingRow
as follows.
private void GridEX_FormattingRow(Object sender, RowLoadEventArgs e) {
var r = e.Row
if (r.RowType == RowType.TotalRow) r.Cells("MyColumn").Text = String.Format("{0} elements", GridEX.RowCount);
}
So, all you have to do is to get a grip on your DataSource, may it be an IList<T>
, then aggregate according to your needs, then set the Text
property of the appropriate cell of your total row.
You're done!
Hope this helps!
Upvotes: 1