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 with  the "code" value of my datasource, I need to know how can I do it.
The class TempalteColumnSN inherit from ITemplate and implements the InstantiateIn method.
thanks.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ajax.NET Professional" group.

To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]

For more options, visit this group at http://groups.google.com/group/ajaxpro

The latest downloads of Ajax.NET Professional can be found at http://www.ajaxpro.info/

Don't forget to read my blog at http://weblogs.asp.net/mschwarz/

The open source project is now located at
http://www.codeplex.com/Wiki/View.aspx?ProjectName=AjaxPro
-~----------~----~----~----~------~----~------~--~---

Reply via email to