Hi Everyone,
I am having some REAL difficulty with getting a DropDownList to appear in an UltraWebGrid column. I have searched far and wide for the correct way to setup a DropDownList and for some reason I cannot get to dropdown list to appear even in an overly simple senario.
I have followed these approaches: http://forums.infragistics.com/forums/t/14767.aspx , http://news.infragistics.com/forums/t/9063.aspx, http://news.infragistics.com/forums/p/11438/43300.aspx#43300 , http://news.infragistics.com/forums/p/10880/41315.aspx#41315
Furthermore, I have run the example http://devcenter.infragistics.com/download/samples/kb/webgridcomplexrowtemplate.zip in which the grid still doesn't show a dropdown (or rowedittemplate).
I have set up a VERY simple example where I just try to create a drop down list in a page load and bind but still nothing shows, here is the logic:
protected void Page_Load(object sender, EventArgs e)
{
UltraGridColumn c = b.Columns[0];
c.Header.Caption = "code-behind";
List<Class1> cl1 = new List<Class1>(0);
c.ValueList.DataSource = cl1;
c.ValueList.DisplayMember = "Name";
c.ValueList.DataSourceID = "Id";
c.ValueList.DataBind();
Where class1 has two members, Id and Name. I get a column called "code-behind" but no dropdownlist.
Can someone please shed some light on what I am missing?
Thanks for any help,
Jason
I haven't tested your code, but I see one line that jumps out at me:
c.ValueList.DataMember = "Id";
Try removing this line and see if it works. This property is used in combination with the DataSource property to specify a given list within a set of lists (such as the name of a DataTable within a DataSet).
Is your WebGrid databound? If so, then I suggest moving this logic to the InitializeLayout event, so that you know it'll be called when the grid is databound. Use "e.Layout.Bands[0]" to get a reference to your band in this event handler.
Thanks for the quick reply.
I have removed the DataMember reference, moved the logic to the InitializeLayout, and I still do not receive any info. I also read over the documentation of valuelist member and tried setting:
c.ValueList.ValueMember = "Id";
still no luck. I think I am probably missing some kind of setting I need to set programatically.
On a parallel note, is it possible to wire up an event on the binding of a row? That way I can force the binding of the dropdown list manually.
Thanks again,