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

grid view paging

2 Answers 83 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Anjali
Top achievements
Rank 1
Anjali asked on 29 Apr 2011, 05:49 AM
I need to put a small label between the gridview and the paging buttons of the gridview. I need to display a value in that label that is completely unrealted with the gridview stored proc.This value is coming from a different stored proc. user want to see the value between the gridview and paging buttons, the next and prev buttons. Is it possible to do that.

Any help will be higly apprceciated

2 Answers, 1 is accepted

Sort by
0
Accepted
Shinu
Top achievements
Rank 2
answered on 29 Apr 2011, 09:04 AM
Hello Nitu,

One approach is to add the Label control in the FooterItem at runtime and bind it from there. Here is a sample code.

C#:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
   {
       if (e.Item is GridFooterItem)
       {
           GridFooterItem fitem = (GridFooterItem)e.Item;
           Label lbl1 = new Label();
           lbl1 .Text = "Text";/Set the data
           lbl1 .ID = "Label1";
           fitem.Cells[3].Controls.Add(lbl1 );//set the cell text accordingly.
       }
    }

Note:Set the showfooter property to true.

Thanks,
Shinu.
0
Anjali
Top achievements
Rank 1
answered on 29 Apr 2011, 04:13 PM
Thanks Shinu!! This is exactly what i was looking for.
Tags
Grid
Asked by
Anjali
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Anjali
Top achievements
Rank 1
Share this question
or