I've added an Unbound column to grid for adding combo control in it. I tried to add UltraDropDown/UltraCombo both through code and at design time but it doesn't show in grid. I tried both with EditorComponent and ValueList properties. Although it's not giving any error but it doesn't show up in grid.If I replace this UltraCombo with check box it works perfect both at design and run time.
Hi,
What's the DataType of the unbound column? If you did not set it, it will be string by default.
How are you populating your DropDown/Combo? Are you setting the ValueMember and/or DisplayMember?
When you say "it doesn't show in grid" do you mean that you do not even see a dropdown arrow in the grid cell when you click on the cell? Or do you see the dropdown arrow but are unable to drop it down?
Are you setting any other properties on the unbound column, such as the Style property?
Are you loading a Layout or a Preset or do you have code in the InitializeLayout event or some other event that might be overriding the settings you are applying to the unbound column?
Mike the only mistake was the event.
Actually my task is to show different type of input controls in single column in each row depending on the value of data.
e.g. in bound dataset I have a field named "type" that defines the type of some info and depending on value of type I've to show DatePickers, Checkbox, combo, textbox in single column of grid in each row.
I hope you may have understood my requirement, I don't know is it possible by any solution or by some tweak.
Please suggest me some solution and event that I should use to do this.
Thanks alot for your assistance.
Hi Sir,
I have not modified either of the data types in my code so both of these should contain their default datatype. I know that my UltrawinGrid's default data type is string. How do I check it for column in the dropdown?
Regards,
Harshit
Hi Harshit,
No, that's not how it works. The default DataType of an unbound column is string. The DataType of a bound column is determined by the data source. So the Dotnet framework will translate varchar2 into something the DotNet framework understands, since varchar2 is not a data type in DotNet. I'm assuming it will probably be string, and like I said, I doubt that this has anything to do with the problem you are experiencing, but since you want to explore it, you should check the DataType property of the column in the grid and the column in the DropDown at run-time so see what they are actually returning and make sure they are the same.
I checked both the datatypes. Both are coming up as string. I have been stuck at this for 4-5 days. The values are getting fetched on screen as well. Its just that they are not visible in the dropdown. Please let me know what information you need about the application and the system. I'll double check it and provide you the same.
Thanks,
We have got this project and we need to implement some change requests. In as is code, they have implemented many ultracombos for such columns and its working fine for them but those ultracombos are not editable, i.e. the user would have to select something from the dropdown list, he can not type in the box. On the contrary, this time we need to make this column editable as well in addition to the dropdown.
I have made it editable using filterOperamdProperties. I was able to do so with both - ultradropdown and ultracombo. Its just that the dropdown list is coming up invisible. I know that the values are there as when I scroll down using the scroller coming up with dropdown, it shows me the values corresponding to the current position of the dropdown. But the values are not visible in the dropdownlist. Below is the snapshot of how is it appearing on the screen.
That box showing BUD ID : 00003282 is appearing because I have kept the scroller clicked while taking this snapgrab. It also proves that the values are coming up. There are just not visible.
Another thing I am confused about is, in the existing code, they have implemented these ultracombos, as I explained above. So in the designer.cs of this view, there so many appearances have been declared. And they have been used for different properties of ultracombos. For Example : they have used appearance1 for ultracombo.groupbybox, then they have used another appearance for ultracombo.rowappearance. My question is, how these appearances got created. Had somebody might have hardcoded these or they have been created through ultragrid design? If through design, then how do we do it? Similarly, they have assigned ultragridBands as well to different ultracombos as band serializer. how does this band serializer work ad what its significance?
I have not write any code related to these appearances or band serializer. Can it have anything to do with why I am not getting values visible in my dropdown list?
-Harshit
Harshit said:I have made it editable using filterOperamdProperties
What is "filterOperamdProperties?" That doesn't mean anything to me.
For UltraCombo, typing into the edit portion of the control is allowed by default. You turn this off by setting the DropDownStyle property to DropDownList. This forces the user to select from the list exactly like the DotNet Framework's ComboBox control.
Harshit said:Below is the snapshot of how is it appearing on the screen.
There's no screen shot attached to your post. To attach an image file, go to the Options tab while posting and attach the image as a file.
Right now, your description is rather confusing. You say that the values are not displayed, but that you can see them when scrolling. My best guess is that ou must be seeing the scrolltips showing the values.
If that's the case, then that means that the DropDown is getting the correct data and it's just not displayed on the screen. This makes sense considering that you are getting rows and can scroll. But as for why the data is not displaying in the cells, I really can't say. This must be something your code is doing. Perhaps something in your application is applying an Appearance to the cells such that the foreground color is the same as the background color. This could also happen if you are loading an Application Style Library (isl) file. Check your code for StyleManager.Load. Or... less likely, perhaps you have a CreationFilter or a DrawFilter which is deliberately removing the text.
Harshit said:Another thing I am confused about is, in the existing code, they have implemented these ultracombos, as I explained above. So in the designer.cs of this view, there so many appearances have been declared.
Appearances can be set in the Visual Studio Form Designer through the property grid. Or they could be applied in code. It's possible that certain very limited default appearances are also applied when you simply place the control on the form at design-time.
Harshit said:Similarly, they have assigned ultragridBands as well to different ultracombos as band serializer. how does this band serializer work ad what its significance?
The BandSerializer is only used in the Form Designer in Visual Studio. This is code that is automatically generated by the form designer and the control and you should not modify that code directly.
This all goes back to the original issue of this thread, which was that the control was being created at run-time and never parented to a form. But I don't think that's the same issue you are having at all. If it was, you would not be getting rows and you would not be seeing the data in the scroll tips.
The values are coming up in dropdownlist now and when I am saving the record after selecting a certain value, it does get saved in database but doesn't stay in UI dropdown textbox. Also, This grid is getting loaded with certain values as well, but no value get selected by default in the dropdown textbox, although there is a value present in database.
Could you please help me out?
Thanks,Harshit
Yes, this was the issue. Now the values have been populated. I know this was a sill one but thanks a lot.
Now, in this form, I have a UltraTextEditor, whose value is getting populated from a previous page. This value is present in the dropdown, that we have implemented. I need the default selected value of this dropdown to be the same value that is present there in this ultratexteditor. Is it possible?
Note: since my datatable(that contains the VALUELIST getting populated in the dropdown) has only one column, I don't have a n Index for the dropdownitems.
Well.. it's hard to tell from just a code snippet, but it looks like you said your data source has only one column and you are hiding that column.
uddClini_bud_id.DisplayLayout.Bands[0].Columns["BUD_ID"].Hidden = true;
So that would certainly explain all of the behavior you are describing. You are hiding the only column in the dropdown, so there's nothing to display.
This is my current code in View.cs
BindingContext bc = new System.Windows.Forms.BindingContext();
uddClini_bud_id.BindingContext = bc;
//e.Layout.Bands[1].Columns["CLIN_BUDGET_ID"].DefaultCellValue.Equals(uteBindBudId.Text);
uddClini_bud_id.DataSource = Lookup.ClinicalBudIdMapping.ClinicalBudIdMappingDt;
uddClini_bud_id.ValueMember = "BUD_ID";
uddClini_bud_id.DisplayMember = "BUD_ID";
uddClini_bud_id.DropDownWidth = 250;
//uddClini_bud_id.DisplayMember.StartsWith("BUD_ID", true, null);
uddClini_bud_id.DisplayLayout.Bands[0].Columns["BUD_ID"].Width = e.Layout.Bands[1].Columns["CLIN_BUDGET_ID"].Width;
e.Layout.Bands[1].Columns["CLIN_BUDGET_ID"].ValueList = uddClini_bud_id;
e.Layout.Bands[1].Columns["CLIN_BUDGET_ID"].ValueList.ShouldDisplayText.Equals(true);
//e.Layout.Bands[1].Columns["CLIN_BUDGET_ID"].DataType.ToString();
//e.Layout.Bands[1].Columns["CLIN_BUDGET_ID"].Style = Infragistics.Win.UltraWinGrid.ColumnStyle.DropDownList;
e.Layout.Bands[1].Columns["CLIN_BUDGET_ID"].FilterEvaluationTrigger = FilterEvaluationTrigger.OnEnterKeyOrLeaveCell;
e.Layout.Bands[1].Columns["CLIN_BUDGET_ID"].FilterOperandStyle = FilterOperandStyle.DropDownList;
e.Layout.Bands[1].Columns["CLIN_BUDGET_ID"].FilterOperandStyle = FilterOperandStyle.Edit;
And this is there in the designer.cs of this form. Some of it (the last 5 lines) got created by itself and the rest of it has been added by me.
this.uddClini_bud_id.DisplayLayout.Appearance = appearance121;
//this.uddClini_bud_id.DisplayLayout.BandsSerializer.Add(ultraGridBand17);
this.uddClini_bud_id.DisplayLayout.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
this.uddClini_bud_id.DisplayLayout.CaptionVisible = Infragistics.Win.DefaultableBoolean.False;
this.uddClini_bud_id.DisplayLayout.GroupByBox.Appearance = appearance122;
this.uddClini_bud_id.DisplayLayout.GroupByBox.BandLabelAppearance = appearance123;
this.uddClini_bud_id.DisplayLayout.GroupByBox.BorderStyle = Infragistics.Win.UIElementBorderStyle.Solid;
this.uddClini_bud_id.DisplayLayout.GroupByBox.PromptAppearance = appearance124;
this.uddClini_bud_id.DisplayLayout.MaxColScrollRegions = 1;
this.uddClini_bud_id.DisplayLayout.MaxRowScrollRegions = 1;
this.uddClini_bud_id.DisplayLayout.Override.ActiveCellAppearance = appearance125;
this.uddClini_bud_id.DisplayLayout.Override.ActiveRowAppearance = appearance126;
this.uddClini_bud_id.DisplayLayout.Override.BorderStyleCell = Infragistics.Win.UIElementBorderStyle.Dotted;
this.uddClini_bud_id.DisplayLayout.Override.BorderStyleRow = Infragistics.Win.UIElementBorderStyle.Dotted;
this.uddClini_bud_id.DisplayLayout.Override.CardAreaAppearance = appearance127;
this.uddClini_bud_id.DisplayLayout.Override.CellAppearance = appearance126;
//this.ucRecipient.DisplayLayout.Override.CellClickAction = Infragistics.Win.UltraWinGrid.CellClickAction.EditAndSelectText;
this.uddClini_bud_id.DisplayLayout.Override.CellPadding = 0;
this.uddClini_bud_id.DisplayLayout.Override.GroupByRowAppearance = appearance129;
this.uddClini_bud_id.DisplayLayout.Override.HeaderAppearance = appearance130;
this.uddClini_bud_id.DisplayLayout.Override.HeaderClickAction = Infragistics.Win.UltraWinGrid.HeaderClickAction.SortMulti;
this.uddClini_bud_id.DisplayLayout.Override.HeaderStyle = Infragistics.Win.HeaderStyle.WindowsXPCommand;
this.uddClini_bud_id.DisplayLayout.Override.RowAppearance = appearance131;
this.uddClini_bud_id.DisplayLayout.Override.RowSelectors = Infragistics.Win.DefaultableBoolean.False;
this.uddClini_bud_id.DisplayLayout.Override.TemplateAddRowAppearance = appearance132;
this.uddClini_bud_id.DisplayLayout.ScrollBounds = Infragistics.Win.UltraWinGrid.ScrollBounds.ScrollToFill;
this.uddClini_bud_id.DisplayLayout.ScrollStyle = Infragistics.Win.UltraWinGrid.ScrollStyle.Immediate;
this.uddClini_bud_id.DisplayLayout.ViewStyleBand = Infragistics.Win.UltraWinGrid.ViewStyleBand.OutlookGroupBy;
//
this.uddClini_bud_id.Location = new System.Drawing.Point(3, 529);
this.uddClini_bud_id.Name = "uddClini_bud_id";
this.uddClini_bud_id.Size = new System.Drawing.Size(94, 14);
this.uddClini_bud_id.TabIndex = 101;
this.uddClini_bud_id.Visible = false;
I think the image has been attached now.
Also, I was talking about FilterOperandStyle.
Though, you got it right sir, this is exactly the issue I have. However, I have checked for appearance and creationFilter/draw filter. These have not been applied in my code. I don't know where to find StyleManager.Load. I understand that this is something done inside my code only, something is sort of setting the visibility of these values to false. but I am unable to find that thing.
Do you think I should start over by using UltracomboEditor? or anything else?