How do i display the Drop Down button in my Editable Combo Box type Grid Column?
See picture attached...
Hello Itamarbe,
If I understand correctly your requirement, you could have this button always visible if you set the ButtonDispalyStyle of the desired column to Always. One way to do so would be handling the InitializeLayout event of the UltraGrid and setting it there using the following code snippet:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.Bands[0].Columns[0].ButtonDisplayStyle = Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always; }
Did it. didn't help... any definition on Grid or Column level that might have overriding it? the Button is still displayed only when i click on the cell...
I am still following this forum thread. Have you been able to take a look at your application for more specific details ?If you have any other questions please feel free to let us know.
if (gridDefinition.EditableColumnsIndexes.Count > 0)
{
foreach (var index in gridDefinition.EditableColumnsIndexes)
e.Layout.Bands[0].Columns[index].ButtonDisplayStyle =
Infragistics.Win.UltraWinGrid.ButtonDisplayStyle.Always;
}
This is the loop i am running and no results... the button is not displayed. how can i send all the properties? it's a lot of information no? i can pull some properties on Grid or Column just tell which...
I am not really sure what the "gridDefinition.EditableColumnsIndexes" are, so I couldn't say if the desired column from your UltraGrid does have an index matching one of the returned ones here. Better approach would be if you know the exact column key and set this property to the desired column using the Column key instead of the index which actually is a matter of change.In order to verify if this property has been applied to your column correctly, you could first set it inside InitializeLayout event of the UltraGrid and then in a button click event to verify if, for some reason, this property has been changed or not like:
private void ultraGrid1_InitializeLayout(object sender, Infragistics.Win.UltraWinGrid.InitializeLayoutEventArgs e) { e.Layout.Bands[0].Columns["Desired String Column Key"].ButtonDisplayStyle = ButtonDisplayStyle.Always; }
private void button1_Click(object sender, EventArgs e) { Debug.WriteLine(ultraGrid1.DisplayLayout.Bands[0].Columns["Str1"].ButtonDisplayStyle.ToString()); }
The index is correct and i debugged it the Style is correct, no results. i will retry and update you.
Hello Itambare,I am still following this forum thread.Have you been able to take a look at your application and to verify how the mentioned properties are being set?
Please feel free to let us know if you have any other questions with this matter.
In the button event handler could you please verify what are the following properties being set to:
private void button1_Click(object sender, EventArgs e) { Debug.WriteLine(ultraGrid1.DisplayLayout.Bands[0].Columns["DesiredColumnKEY"].Style.ToString()); Debug.WriteLine(ultraGrid1.DisplayLayout.Bands[0].Columns["DesiredColumnKEY"].Editor.ToString()); Debug.WriteLine(ultraGrid1.DisplayLayout.Bands[0].Columns["DesiredColumnKEY"].EditorComponent.ToString();Debug.WriteLine(ultraGrid1.DisplayLayout.Bands[0].Columns["DesiredColumnKEY"].CellDisplayStyle.ToString()); }
If you have any other questions please feel free to let us know.