Hi,
I am using templates for row editing.The mark-up is something like this. The question is how can I get access to shiftsTemplate control on server side.
<ig:RowEditingTemplate Enabled="true"> <Template > <controls:ShiftTemplate ID="shiftsTemplate" runat="server"/> </Template> </ig:RowEditingTemplate>
I've tried following:
var mycontrol = (ShiftTemplate)m_grid.Behaviors.EditingCore.Behaviors.RowEditTemplate.Template ;
but that doesn't work.
Please help.
I've tried following this recomendation, but they doesn't work either:
http://help.infragistics.com/Help/NetAdvantage/ASPNET/2010.1/CLR3.5/html/WebDataGrid_Binding_Controls_in_Row_Editing_Template.html
Hello Alexander,
I am just following up to see if you were able to find user control from row edit template based on details I have provided above.
Feel free to update me if any further assistance needed.
I was able to get user control as well as other controls used in row edit template. I was also able to add controls in user control at runtime also using below lines of code:
TemplateContainer temp = (TemplateContainer)this.WebHierarchicalDataGrid1.GridView.Behaviors.EditingCore.Behaviors.RowEditTemplate.TemplateContainer;Button btn1 = (Button)temp.FindControl("Button2");btn1.Text = "chaged";
//Find User ControlUserControl usr = (UserControl)temp.FindControl("Usrt1");
//Add Button to User ControlButton btn2 = new Button();btn2.ID = "btn1";btn2.Text = "I ADD1";btn2.Height = Unit.Pixel(100);btn2.Width = Unit.Pixel(100);usr.Controls.Add(btn2);
I have tried below mark up for Row Editing Template:
<ig:EditingCore><Behaviors><ig:RowEditingTemplate CancelButton="buttonCancel" OKButton="buttonOK"><Template><asp:Button ID="Button2" runat="server" Text="Button" /><uc1:Usrt ID="Usrt1" runat="server" /></Template></ig:RowEditingTemplate></Behaviors></ig:EditingCore>
I hope this helps.
Thank you for your answer,
but I don't want to get TemplateContainer, I need to get my own UserControl.
Actually before I wrote the question here I'd tried a lot of variants, including the suggested one.
So could you please ask development for other variants?
Alexander.
Based on update from development, I understand you may access row edit template on parent grid as shown below:
TemplateContainer temp = (TemplateContainer)this.WebHierarchicalDataGrid1.GridView.Behaviors.EditingCore.Behaviors.RowEditTemplate.TemplateContainer;
Thank you!
I am waiting for details on this!
Alexander