Hi
I've use this post for reference:
https://ko.infragistics.com/community/blogs/bf9d3b11-fd1c-4ecd-a46e-dcbd97be1898/archive/2009/05/08/creating-a-dropdown-list-in-a-grid-cell-whose-list-values-are-dependent-on-another-cell.aspx
I want to populate a dropdown (differently for every row based on the value of a dataset or could use a list). When I do what is in the code below it only wipes out all my rows in the grid. Is there a better/easier way:
Hello Tony,
From the code snippet you provided it seems that mDSetPackageDetails is a DataSet. Is this correct? If so, then the filter you are adding at this line:
rootBand.ColumnFilters["X_SUPRA_DSCNT_ID"].FilterConditions.Add(FilterComparisionOperator.Equals, mDSetPackageDetails);
should hide all the rows in the grid, as it is comparing the values in the cells against a DataSet, and I suppose the result is always false. As a first step try to comment out this row and check if the rows are gone again. If the rows are there try to fix your filter.
Please let me know if you have any additional questions on this matter.
Thanks...that is what is occurring I should clarify... I query the dataset for each row in the grid with different values in Field2 and Field3. this line seems to affect the whole grid.
I want to set the values for a dropdown in field1...like enter a State and here is a list of Cities, but the drop down is on each row so each row may have a different state. That's the sample I used in a previous post (Mine has different values than city and state). How can I use a filter to filter a drop down value (field1) on each row of the grid differently based on Field2 and Field3 and also reset the dropdown values of field1 if either field2 or field3 are changed?
Thanks.
Thank you for your feedback.
There are several ways to show different drop down in a grid cell based on the value of the other cell in the same row. What we did in “Creating a dropdown list in a grid cell whose list values are dependent on another cell” was next:
Form the code you send me it seems that you are using ValueList and not UltraDropDown. In this case you should either create a separate ValueList for each cell, or populate the ValueListItems every time the cell activates. There is no way to filter the items in ValueList. Attached is a small sample showing how to populate items in ValueList each time cell activates.
Please check my sample and let me know if this is what you are looking for or if I am missing something.
Hi Tony,
I am glad to hear that you were able to resolve your issue.
To answer your additional question – yes, you can examine the content of the value list. One way to achieve this is to put a break point in your code on the next row where ValueList items are populated. Then perform a QuickWatch over the ValueList or add it to the Watch window and investigate its content. Other possible way is to use System.Diagnostics.Debug.WriteLine method and to write the content of the ValueList in the Output window like this:
foreach (var item in valLstPackage.ValueListItems) { System.Diagnostics.Debug.WriteLine( "Item DataValue {0} Item DisplayText {1}", item.DataValue, item.DisplayText);}
Please let me know if any additional questions on this matter arise.
Thank you for your straight forward example, that helped me understand I was mixing Filters with Value lists. Turns out, I started repopulating a "new" valuelist each time, but was not getting the results I expected, so that's when I turned to filters. The issue with my orginal valuelist turned out to the query populating the dataset. It is now working fine. On a related note is there a way to examine the contents of a valuelist in debug? Thanks again.