Hi,
I am using a RadGrid to show data (obviously). Within a specific cell I have a literal that is called "DocumentName". The user has an option to rename that generic name to something custom. What I do is have a button that they click and an asp:TextBox control becomes visible with a save button. When I enter text into that textbox and hit the save button I want to get that new value from the textbox. However, I am getting an empty string every time. I have tried multiple ways Here is my code.
foreach (GridDataItem g in EventsDocsRadGV.Items)
{
// First way - returns an empty string
TextBox RenameDocumentName = (TextBox)g.FindControl("RenameDocumentName");
// Second way - returns an empty string
string txt = (g["EventTypeDesc"].FindControl("RenameDocumentName") as TextBox).Text;
// Third way - returns an empty string
GridDataItem item = (GridDataItem)g;
TextBox RenameDocumentName2 = (TextBox)item["EventTypeDesc"].FindControl("RenameDocumentName");
}
I also tried the same only wrapped in this loop
foreach (GridDataItem g in EventsDocsRadGV.MasterTableView.Items)
{
// First way - returns an empty string
TextBox RenameDocumentName = (TextBox)g.FindControl("RenameDocumentName");
// Second way - returns an empty string
string txt = (g["EventTypeDesc"].FindControl("RenameDocumentName") as TextBox).Text;
// Third way - returns an empty string
GridDataItem item = (GridDataItem)g;
TextBox RenameDocumentName2 = (TextBox)item["EventTypeDesc"].FindControl("RenameDocumentName");
}
I can access the other properties and cells that were bound onitemdatabound but not this textbox. Ideas?
Thanks!