D
David
I have the following:
[AjaxMethod]
public string Test()
{
DataSet ds = ...;
DataGrid dg = new DataGrid();
dg.AutoGenerateColumns = false;
TemplateColumn tc = new TemplateColumn();
tc.HeaderText = "Serial Number";
tc.ItemTemplate = new TemplateColumnSN(ListItemType.Item);
dg.Columns.Add(tc);
dg.DataSource = ds;
dg.DataBind();
StringBuilder sb = new StringBuilder();
StringWriter stWriter = new StringWriter(sb);
HtmlTextWriter htmlWriter = new HtmlTextWriter(stWriter);
dg.RenderControl(htmlWriter);
return sb.ToString();
}
My datasource have one column named "code", I want to place an html
button in that template column, and I want to set his value property
with the "code" value of my datasource, I need to know how can I do
it.
TempalteColumnSN inherit from ITemplate and implements the
InstantiateIn method.
thanks.
[AjaxMethod]
public string Test()
{
DataSet ds = ...;
DataGrid dg = new DataGrid();
dg.AutoGenerateColumns = false;
TemplateColumn tc = new TemplateColumn();
tc.HeaderText = "Serial Number";
tc.ItemTemplate = new TemplateColumnSN(ListItemType.Item);
dg.Columns.Add(tc);
dg.DataSource = ds;
dg.DataBind();
StringBuilder sb = new StringBuilder();
StringWriter stWriter = new StringWriter(sb);
HtmlTextWriter htmlWriter = new HtmlTextWriter(stWriter);
dg.RenderControl(htmlWriter);
return sb.ToString();
}
My datasource have one column named "code", I want to place an html
button in that template column, and I want to set his value property
with the "code" value of my datasource, I need to know how can I do
it.
TempalteColumnSN inherit from ITemplate and implements the
InstantiateIn method.
thanks.