how do I get a dropdownlist as EditorControl to assign it to a column?
Hello Anand,
Take a look at the following post.
http://news.infragistics.com/forums/t/16126.aspx
Taz.
Thanks Taz,
I was looking for the functinality you mentioned at the last in the post you showed me. to hide dropdown until its selected but its not posible ATM.
I'll have to change other columns to tamplate columns as well.
but i have one more question that how I will bind the data with that dropdown list? I can bind it with other items as shown in the online samples but my dropdown list is dynamic.
depends on row. one row can have 2 items and another can have 3.
I checked with InitRow event handler on server side but it does not have e.Data property with event args as it was in WebGrid.
how do I get Row Data on InitRow event at serverside?
Anand,
You can create the different types of templates that you want to use and add them within the template collection of the WebDataGrid. Build the templates with different types of drop down lists and then in the InitRow event, associate the template to the cell of that row using the templateId.
In the code below, there are two templates with ID DropDownList1 & DropDownList2 present within the templates collection of the grid.
protected void WebDataGrid1_InitializeRow(object sender, Infragistics.Web.UI.GridControls.RowEventArgs e)
{
if (e.Row.Index % 2 == 0)
e.Row.Items[0].TemplateId = "DropDownList1";
else
e.Row.Items[0].TemplateId = "DropDownList2";
}
I hope this helps.