Implementing the methods to generate the template and to bind it to the data
For each Runtime Template you need to write two methods. One will be the one you specified in the
CreateTemplate event handler and one will be responsible to bind the data and to render
the template.
C#
void CreateEditAddressTemplate(Object sender, Obout.Grid.GridRuntimeTemplateEventArgs e)
{
Literal oLiteral = new Literal();
e.Container.Controls.Add(oLiteral);
oLiteral.DataBinding += new EventHandler(DataBindEditAddressTemplate);
}
void DataBindEditAddressTemplate(Object sender, EventArgs e)
{
Literal oLiteral = sender as Literal;
Obout.Grid.TemplateContainer oContainer = oLiteral.NamingContainer as
Obout.Grid.TemplateContainer;
oLiteral.Text = "<textarea id=\"txtAddress\" rows=\"3\" class=\"ob_gridEditControl\"
style=\"overflow: auto;\"></textarea>";
}
VB.NET
Sub CreateEditAddressTemplate(ByVal sender As Object, ByVal e As Obout.Grid.GridRuntimeTemplateEventArgs)
Dim oLiteral = New Literal()
e.Container.Controls.Add(oLiteral)
AddHandler CType(oLiteral, Literal).DataBinding, AddressOf DataBindEditAddressTemplate
End Sub
Sub DataBindEditAddressTemplate(ByVal sender As Object, ByVal e As EventArgs)
Dim oLiteral = CType(sender, Literal)
Dim oContainer As Obout.Grid.TemplateContainer
oContainer = CType(oLiteral.NamingContainer, Obout.Grid.TemplateContainer)
oLiteral.Text = "<textarea id=""txtAddress"" rows=""3"" class=""ob_gridEditControl""
style=""overflow: auto;""></textarea>"
End Sub