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 Harshit,
What programming environment, platform, and language are you programming in? I ask because your questions aren't really making any sense to me.
If you have an UltraDropDown or an UltraCombo and you want to populate it with data, the only thing you have to do is set the DataSource. If that's not working, then either your data source is empty or the control is unable to get the data for some reason. In the previous issue discussed in this thread, the control was not getting data the control had no BindingContext. This is nothing specific to Infragistics controls, it's the way binding works in a Windows Forms application. Typically, a control gets its binding context from the form or other container that it is in. In the original post, the control was being created in code and never added to any container. Therefore is had no binding context and could not get any data. The solution to that problem is to add the control to a container. Or, alternately, so set the BindingContext.
This new question does not seem to be in any way related to that. But I'm not really sure what you are asking. I'm not sure where you got the impression that the dropdown uses key-value pairs. Or why you think you need to assign an index.
You can, optionally, use ValueMember and DisplayMember to translate Id values into more user-friendly display text in the grid, if you want. But this is not a requirement. If that's what you want, then your combo/dropdown must have at least 2 columns in it, one for the ValueMember/Id and another for the DisplayMember/DisplayText. It's not possible to do this with a single column.
Hi Sir,
Sorry for the confusion.
I am working on a windows application targeting ASP .NET 2.0 framework. I am using C# language. The data that I am fetching from the database contains the values of a single column of a certain table and I am storing this data in a dataTable. I have assigned the dataSource of my UltraDropDown as this dataTable. I have tried debugging as well and can confirm you that the data is being fetched correctly into the dataSource of my dropdown. In the screen, in the grid, I can see the column with dropdown button. On clicking the dropdown arrow, I get a box with no values but a scroller. When I go down with scroller, It shows me the values corresponding to the position of scroller in sort of mousehover style. Maybe that is the property of ultradropdown but it shows me the values in the same way as when we scroll down to our contact list in our cell phone, we see alphabets corresponding to the scroller's position. I do not know the exact technical term for this functionality but I hope you get the point. I have tried using BindingContext as well but id didn't work. It's like the values are there but they are just not visible. Below is the code :-
BindingContext bc = new System.Windows.Forms.BindingContext();
uddClini_bud_id.BindingContext = bc;
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"].Hidden = true;
uddClini_bud_id.DisplayLayout.Bands[0].Columns["BUD_ID"].Width = e.Layout.Bands[1].Columns["CLIN_BUDGET_ID"].Width + 270;
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"].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;
Is it because I am using the same column name (BUD_ID) as Display member and value member?
In Addition to this, I want the default selected value from the dropdown to be auto-populated corresponding to a value present in an ultratext editor in the same form. For this, I tried the below code, but it did not work :-
//e.Layout.Bands[1].Columns["CLIN_BUDGET_ID"].DefaultCellValue.Equals(uteBindBudId.Text);
I hope this time the issues is little bit more clarified.
Thank you for all your help.
Harshit
Just to be clear... you are using the Windorms Forms UltraGrid and UltraDropDown in an ASP.Net application? That doesn't make sense. As far as I know, it's not possible to use a Winforms control in an ASP.Net application. So I have to assume that you are just using the wrong terminology here. Or else you are using some kind of bridge or other technology I've never heard of it. If the latter, then that's not really something we can support.
There's nothing necessarily wrong with using the same field as both ValueMember and DisplayMember. Although, in such a case, you would not even need to set the DisplayMember. In fact, since you only have one column, both the ValueMember and DisplayMember will both default to the column. The only weird part about that would be that the grid column's DataType has to match the ValueMember field. I doubt that's relevant to the issue of the DropDown showing blanks, though.
If your dropdown has rows, then presumably it is getting something from the data source. It must be getting the rows but for something reason, it is either unable to get the cell values or unable to draw them. At this point, I have to think it's something to do with the environment you are using - whatever that is. But frankly, I'm at a loss because I'm really confused about what you are doing and what environment you are using.
I'm tempted to think you might be using UltraWebGrid, instead of UltraWinGrid - but you are posting in the WinForms forum and the code you posted sure looks like UltraWinGrid code.
You're right. It's UltraWinGrid only. It's .net based windows application. I just checked, in the database, the datatype of this column is "VARCHAR2", although in the grid, I am using String. What corresponding data type for grid should be there for VARCHAR2?
Thanks,
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.
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
//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"].DataType.ToString();
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?