Hi,
I've added a GridViewComboBoxColumn in my grid but my grid rows have a modified high and I don't know how to make the combobox inside the cell to take the entire cell as you can see in this screenshot :
Please give me the simplest way possible as I already have this code to add me a new ComboBoxColumn in the grid :
I've added a GridViewComboBoxColumn in my grid but my grid rows have a modified high and I don't know how to make the combobox inside the cell to take the entire cell as you can see in this screenshot :
Please give me the simplest way possible as I already have this code to add me a new ComboBoxColumn in the grid :
public static void TelerikAddComboBoxColumn(RadGridView GridView, string FrenchCaption, string EnglishCaption, string SelectedValueMemberPath, string DisplayMemberPath, string DataMemberBinding, bool IsVisible, bool IsReadOnly, double Width, Telerik.Windows.Controls.SortingState SortingState, System.Collections.IEnumerable ItemsSource) |
{ |
GridViewComboBoxColumn NewColumn = new GridViewComboBoxColumn(); |
if (FrenchCaption != "") |
NewColumn.Header = FrenchCaption; |
else |
NewColumn.Header = EnglishCaption; |
NewColumn.IsVisible = IsVisible; |
NewColumn.IsReadOnly = IsReadOnly; |
if (Width != -1) |
NewColumn.Width = Width; |
NewColumn.SortingState = SortingState; |
// http://www.telerik.com/help/silverlight/gridview-columns-column-types.html#GridViewDynamicHyperlinkColumn |
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
// SelectedValueMemberPath – This one is used in conjunction with the DisplayMemberPath in the process of translation of value to display content. It also tells the ComboBox editor which property to use as value when the user makes selection. |
// DisplayMemberPath – This one is used to translate value to cell content(e.g. the ID of a country to the Name of the country). It points to a field in the GridViewComboBoxColumn.ItemsSource. |
// DataMemberBinding - A Binding to a field from the RadGridView.ItemsSource to be displayed in the column. |
// ItemsSource – An IEnumerable collection that contains data used to populate the ComboBox editor as well as to translate values when the cell is not in edit mode. |
// |
// NOTE : If the combobox is bound to an object, the SelectedValueMemberPath must be empty and the DataMemberBinding binds on the object property |
// else the SelectedValueMemberPath and the DataMemberBinding will be the same which is the property only, like the int. |
//------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
NewColumn.SelectedValueMemberPath = SelectedValueMemberPath; |
NewColumn.DisplayMemberPath = DisplayMemberPath; |
NewColumn.DataMemberBinding = new System.Windows.Data.Binding(DataMemberBinding); |
NewColumn.ItemsSource = ItemsSource; |
GridView.Columns.Add(NewColumn); |
} |