private
void
RadGrid_InitCol()
{
RadGrid1.AutoGenerateColumns =
false
;
RadGrid1.Columns.Clear();
GridBoundColumn boundColumn;
boundColumn =
new
GridBoundColumn();
boundColumn.DataField =
"id"
;
boundColumn.HeaderText =
"id"
;
boundColumn.UniqueName =
"id"
;
boundColumn.HeaderStyle.Width = Unit.Pixel(60);
boundColumn.Visible =
false
;
RadGrid1.MasterTableView.Columns.Add(boundColumn);
String templateColName =
"SO2"
;
GridTemplateColumn templateColumn;
templateColumn =
new
GridTemplateColumn() {
UniqueName =
"tempCol0"
,
HeaderText = templateColName,
ItemTemplate =
new
MyTemplate(
"0"
, templateColName)
//EditItemTemplate = new MyEditTemplate(templateColName)
};
RadGrid1.MasterTableView.Columns.Add(templateColumn);
}
protected
void
RadAjaxManager1_AjaxRequest(
object
sender, Telerik.Web.UI.AjaxRequestEventArgs e)
{
if
(e.Argument ==
string
.Empty)
{
RadGrid1.Rebind();
return
;
}
String[] editedItemIds = e.Argument.Trim(
':'
).Split(
':'
);
int
i;
for
(i = 0; i < editedItemIds.Length; i++)
{
string
id = editedItemIds[i];
GridDataItem updatedItem = RadGrid1.MasterTableView.FindItemByKeyValue(
"id"
,
int
.Parse(id));
TextBox txtBox = (TextBox)updatedItem.FindControl(
"txtBox"
);
}
}
updatedItem["id"].Text=115102
updatedItem["tempCol0"] .Text="" updatedItem["tempCol0"] .Controls.Count=0
-------------------------------------------------------------------------------------------------------------------------------
How to get the txtbox control?
Thanks!