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

RadGrid input footer controls

1 Answer 129 Views
Input
This is a migrated thread and some comments may be shown as answers.
Jack
Top achievements
Rank 1
Jack asked on 16 Feb 2009, 11:20 PM
I created a template column with a textbox in the FooterTemplate. Let's say it has an id of "txtInputInFooter".

I would like to retrieve the Text property of the textbox on postback but I am unable to find a way to do so.

I have tried to handle the ItemCommand event and using the following code:
DirectCast(e.Item.FindControl("txtInputInFooter"), TextBox).Text
I get a blank value every time.

This seems like it should be a no brainer, is there something I am missing?

Thanks in advance.

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 17 Feb 2009, 09:13 AM
Hi Jack,

Try the following code snippet to access the textbox in FooterTemplate of RadGrid.

CS:
foreach (GridFooterItem footeritem in RadGrid1.MasterTableView.GetItems(GridItemType.Footer)) 
    TextBox textbox = (TextBox)footeritem["Template1"].FindControl("txtInputInFooter"); 
    string str = textbox.Text; // Get the textbox value 
}      

Thanks,
Shinu.
Tags
Input
Asked by
Jack
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or