This is a migrated thread and some comments may be shown as answers.

GroupFooter Issue

2 Answers 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dany V
Top achievements
Rank 1
Dany V asked on 14 May 2010, 07:07 PM
Hi,

Well ehmmm...I' encountering a little problem with groupFooters, I have a Grid that's grouping by expressions in 2 levels, and the thing is that I want to put a label (to say something), on the groupfooter of the 2nd level but not in the fisrt...for example:

GROUP 1
GROUP 2
item1
item2
item3
......
Group2Footer "Label", Sum
Group1Footer Sum

hope you can help me!!! =)

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 17 May 2010, 01:06 PM
Hello Daniel,

Here is the code example that I tried to add label control in the inner groupfooter item. I hope this would shed some light in accomplish your functionality.

C#:
protected void Radgrid1_ItemCreated(object sender, GridItemEventArgs e) 
    { 
        if (e.Item is GridGroupFooterItem ) 
        { 
            GridGroupFooterItem groupFooter = (GridGroupFooterItem)e.Item; 
            string grIndex = groupFooter.GroupIndex.ToString(); 
            if (grIndex.Length >= 2) 
            { 
                if (grIndex.Substring(grIndex.Length - 2) == "_0"
                { 
                    Label lb = new Label(); 
                    lb.Text = "Label"
                    groupFooter.Cells[1].Controls.Add(lb); 
                } 
            } 
       } 
  } 

Regards,
Shinu.





0
Dany V
Top achievements
Rank 1
answered on 17 May 2010, 04:17 PM
Hi Shinu!

Thanks, it works now!

Regards,
Daniel
Tags
Grid
Asked by
Dany V
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Dany V
Top achievements
Rank 1
Share this question
or