Hi Sorin,
We regret for the inconvenience caused.
You can add inline edit templates dynamically by using the below code snippet:
protected void GridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
//Look for the RecordField and AlternateField Cell.
if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell || e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)
{
//Look for the Column Name "Column2" in the GridGroupingControl when it get rendered
if (e.TableCellIdentity.Column.Name == "Column2")
{
Syncfusion.Web.UI.WebControls.Shared.DropDownCalendarControl dropdown = new DropDownCalendarControl();
dropdown.ClientObjectId = "ddcal";
dropdown.CustomFormat="MM/dd/yy";
dropdown.Format = DateTimeFormatType.CustomString;
dropdown.Attributes.Add("onclick", "fun1(this);");
//Response.Write(dropdown.MinValue.Year.ToString());
dropdown.AutoPostBack = true;
System.Web.UI.WebControls.TextBox tb = new TextBox();
tb.ID = "TextBox2";
tb.Text = "TextBox";
//Here we adding the DropDownListBox programatically using ITemplate Interface
TemplateClass mytemp = new TemplateClass(dropdown,tb);
this.GridGroupingControl1.TableDescriptor.InlineFormModeTemplate = mytemp;
}
}
}
public class TemplateClass : ITemplate
{
private Control m_ctrlChildControl = null;
private Control m_ctrlChildControl1 = null;
public TemplateClass(Control ctrlChildControl, Control ctrlChildControl1)
{
m_ctrlChildControl = ctrlChildControl;
m_ctrlChildControl1 = ctrlChildControl1;
}
public void InstantiateIn(Control container)
{
container.Controls.Add(m_ctrlChildControl);
container.Controls.Add(m_ctrlChildControl1);
}
}
Please refer the sample in the below link which illustrates the above:
http://websamples.syncfusion.com/samples/Grid.Web/6.2.0.40/Grid_ASP_InlineFormMode_73249/main.htmPlease try this and let me know if this helps.
Thanks,
Melba