on InitializeRowEvent I assign UltraControlContainerEditor to EditorComponent of cell. its added successfully. but the problem is that control show only when we mouse over it or click on sell.
e.g dropdown or any control .
i am adding in following way .
UltraControlContainerEditor uce= new UltraControlContainerEditor();
Infragistics.Win.UltraWinEditors.UltraComboEditor cmb = new Infragistics.Win.UltraWinEditors.UltraComboEditor();
cmb.Items.Add(lstItem);
cmb.DropDownStyle = DropDownStyle.DropDownList;
uce.EditingControl = (Control)cmb
e.Row.Cells["Answer"].EditorComponent = uce;
Hi Tariq,
I believe the issue is that you have not set a RenderingControl on the UltraControlContainerEditor.
Take a look at the example in our docs, which demonstrates how to Embed Any Control within WinGrid Cell using UltraControlContainerEditor.
Please let me know if you have any questions.
Hi Mike ,
Thank you for quick response me .
I tired set renderingControl also . but the problem then i can't edit it .
actually i have custom usercontrol . and i dont know where i am doing wrong. let me share u complete detail..
here is GridViewInitilzerow event code.
private void ugCarePlanFill_InitializeRow(object sender, Infragistics.Win.UltraWinGrid.InitializeRowEventArgs e) {
if (e.Row.Cells["QuestionType"].Value.ToString() == "MO")//mo mean multipleoption control. { bool hasChildCarePlan = false; int NumberOfChildCarePlans = 0; UltraControlContainerEditor ultraControlContainerEditor1 = new UltraControlContainerEditor(); ultraControlContainerEditor1.RenderingControl = CreateMOList(e.Row.Cells["CarePlanQuestionId"].Value.ToSafeString(), out hasChildCarePlan, "MO", out NumberOfChildCarePlans); e.Row.Cells["Answer"].EditorComponent = ultraControlContainerEditor1;
}
// CreatMoList Method return Control . in that method i am using user control name "usrMultipleOptions" dynamic loading checkbox control base on database tables record. we further process on while we check and uncheck ,like hide/show child band if check box check/uncheck.
private Control CreateMOList(string sQuestionId, out bool hasChildCarePlan, string sQuestionType, out int NumberOfChildCarePlans) { hasChildCarePlan = false; NumberOfChildCarePlans = 0; usrMultipleOptions cmb = new usrMultipleOptions();
cmb.Tag = sQuestionId; cmb.Height = 24; cmb.BorderStyle = BorderStyle.FixedSingle; cmb.Name = "mo" + sQuestionId; DataSet ods = oCCarePlan.GetCarePlanQuestionsDetail(sQuestionId, l_iCarePlanFillId.ToLong()); foreach (DataRow odr in ods.Tables[0].Rows) { ValueListItem lstItem = new ValueListItem(); lstItem.DataValue = odr["CarePlanQuestionsMOID"].ToString();
lstItem.DisplayText = odr["Caption"].ToString(); lstItem.Tag = odr["CarePlanQuestionsMOID"].ToString();
if (odr["ChildCarePlanID"].ToString().Trim().ToInt() != 0) { lstItem.Tag = lstItem.Tag.ToString() + "|" + odr["ChildCarePlanID"].ToString() + "|" + odr["ChildCarePlanFillID"].ToString(); NumberOfChildCarePlans += 1; hasChildCarePlan = true; }
cmb.addItem(lstItem); } cmb.ItemChecked += MO_SelectionChanged;
return cmb; }