Hi,
I've got an UltraWinGrid hooked up to a BindingSource.
One of my source's columns/properties is of type Nullable(Of Integer).
I have set the column's ValueList property, and the ValueList includes an entry generated by the line "ValueList.ValueListItems.Add(DBNull.Value, "")"
I have set the following settings on the Column:
Column.ValueList = MyValueList Column.NullText = String.Empty Column.Format = String.Empty Column.Nullable = Infragistics.Win.UltraWinGrid.Nullable.Nothing Column.Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList Column.Header.Caption = "myCaption"
In my dropdown, when the list is dropped down, the blank value shows as an empty option in the list. If I select this option and the cell is still selected, an empty cell is displayed.
When I click off the list, the cell suddenly displays a "0". When I re-focus the cell and the dropdown opens again, the 0 is still displayed in the cell itself, but the entry in the dropdown list is still a blank entry. Clicking on the blank entry again blanks the cell again, until it loses focus, when it displays 0 again.
I've searched the forum and I can't find any solution except for this guy http://es.infragistics.com/community/forums/t/75962.aspx and he doesn't say how he solved his problem.
EDIT: I've just noticed that the "DisplayString" of the ValueList item is being set to "0" instead of an empty string, which I suspect is the root of the problem, but I'm not sure how to deal with it.
Hello Lars,
Thank you for your feedback.
Please find bellow answers to your questions:
I changed the ComboBox from a ValueList to an EditorComponent, yet the result is the same. Maybe it's because there are almost 9K items in the Combo editor? – this should not be an issue. Please check the attached sample with 10 000 items not reproducing this behavior;
Also, if I type data into the Editor portion of the ComboBox for which there is no corresponding item, I get an error message – this is expected behavior. You need to choose an item from the dropdown or you need to enter an integer. If you enter a value not existing in the drop down list and not an integer it cannot be parsed to the value of the column.
Finally, the combo drop down does not seem to work with the settings in its initialize event handler: AutoCompleteMode.SuggestAppend and AutoSuggestFilterMode.Contains – you need to set all this properties to the grid column and not to the combo. Actually the grid uses the combo’s editor and not the combo itself. Please check the attached sample where I have set all this properties to the grid column.
Please note I still cannot reproduce this behavior at my side. The only difference is the getPartsList method. As I did not find the parts.json file I have change this method in order to be able to run your sample. If you can send me this file I will be happy to test with it.
Looking forward to your reply.
I cannot figure out why yours is working and mine is not. Perhaps because I'm running NetAdvantage 14.2?
I tried to make my sample as simple as possible and yet with similar data to the real solution. I constructed a Form sample rather than UserControl. I changed the ComboBox from a ValueList to an EditorComponent, yet the result is the same. Maybe it's because there are almost 9K items in the Combo editor?
Also, if I type data into the Editor portion of the ComboBox for which there is no corresponding item, I get an error message (in attached archive - combo_error.png).
Finally, the combo drop down does not seem to work with the settings in its initialize event handler: AutoCompleteMode.SuggestAppend and AutoSuggestFilterMode.Contains. If I try to type in the Editor of the combo with a string which does not exist at the beginning of the DisplayMember, it is slow and finds nothing.
Thank you for posting in our forum.
Following the steps you have described and using the code snippet you have provided I have implement a custom control. I have populated this custom control with some sample data and have added in a sample Windows Forms application. I have run my sample application and I did not have any zeros in my grid. Please note my test application was build with latest version of Infragistics Controls 15 Volume 1, 15.1.20151.2013.
I am sending you my sample project in order to test it on your machine, and let me know if you experience the same issue or not. If the issue appears again this could be because of different version of Infragistics Controls we are using, so please let me know the exact version of your controls. If the issue does not appear this could be an issue in your code, so please try to send me an small isolated sample demonstrating this behavior. If you do not have such sample please fill free to modify my sample solution to match your scenario and send it back to me.
I am having the same issue. The code is very simple.
public partial class KitMaintenanceView : UserControl {
public KitMaintenanceView() { InitializeComponent(); _valueListParts = new ValueList {FormatString = string.Empty}; _valueListParts.ValueListItems.Add(1, "First item"); ValueListItem item = new ValueListItem(2,"Second item"); _valueListParts.ValueListItems.Add(item); setupHandlers(); }
private void grdKit_InitializeLayout(object sender, InitializeLayoutEventArgs e) { e.Layout.GroupByBox.Hidden = true; e.Layout.TabNavigation = TabNavigation.NextControlOnLastCell;
// Resize columns to width of grid e.Layout.AutoFitStyle = AutoFitStyle.ResizeAllColumns;
e.Layout.Override.CellClickAction = CellClickAction.Edit; e.Layout.Override.AllowAddNew = AllowAddNew.FixedAddRowOnTop; e.Layout.Override.AllowUpdate = DefaultableBoolean.True; e.Layout.Override.AllowDelete = DefaultableBoolean.True;
UltraGridBand bandKit = e.Layout.Bands[0]; UltraGridBand bandParts = e.Layout.Bands[1];
// Make row selectors visible bandKit.Override.RowSelectors = DefaultableBoolean.True; // Customize the appearance of the row selectors. e.Layout.Override.RowSelectorAppearance.BackColor = Color.Cyan;
// Hide columns parent band bandKit.Columns["Id"].Hidden = true;
// Hide columns child band bandParts.Columns["Id"].Hidden = true; bandParts.Columns["KitId"].Hidden = true;
// Set Column descriptions, widths & appearances for child band bandParts.Columns["PartId"].Width = 450; // band.Columns["PartId"].SortIndicator = SortIndicator.Ascending; bandParts.Columns["PartId"].Header.Caption = "Description"; bandParts.Columns["PartId"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList; bandParts.Columns["PartId"].ValueList = _valueListParts;
bandParts.Columns["Quantity"].CellAppearance.TextHAlign = HAlign.Right; bandParts.Columns["Quantity"].Format = "###,##0.00"; bandParts.Columns["Quantity"].MaskInput = "999999.99"; bandParts.Columns["Quantity"].Width = 70; }
private void setupHandlers() { grdKit.InitializeLayout += grdKit_InitializeLayout; }
}
Hi, Milko,
I'm afraid I had to go with writing a quick and dirty function to dump all the data out to a DataTable.
I couldn't get around the issue I was having, but I also couldn't reproduce it using anything other than our data objects, so I guess the problem must be with them.
You can consider this question closed.