GridDataBoundGrid Combobox column - display more dropdown items
GridDataBoundGrid Combobox column - display more dropdown items
can I set some property llike in MS VS control combo box where i can change setting to display more items on dropdown of a combo box...
thank you
gkrish
can I set some property llike in MS VS control combo box where i can change setting to display more items on dropdown of a combo box...
thank you
gkrish
SIGN IN To post a reply.
2 Replies
JS
Jeba S
Syncfusion Team
June 27, 2007 09:23 AM UTC
Hi gkrish,
There is a DrowDownRows property that you can set to control this. But it is buried a little deep, and generally needs an event handler to set it. The reason is that normally a single combobox cell control is shared among all combobox cells. And each cell can potentially have a different list, and may need different dropdownrows.
So, to handle this, you can catch the CurrentCellShowingDropdown event, and set the property there depending upon the exact row and column. Below are some code snippets.
Kindly let us know if you need any further assistance.
Best Regards,
Jeba.
There is a DrowDownRows property that you can set to control this. But it is buried a little deep, and generally needs an event handler to set it. The reason is that normally a single combobox cell control is shared among all combobox cells. And each cell can potentially have a different list, and may need different dropdownrows.
So, to handle this, you can catch the CurrentCellShowingDropdown event, and set the property there depending upon the exact row and column. Below are some code snippets.
//C#
private void grid_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
{
GridControlBase grid = sender as GridControlBase;
if(grid != null)
{
GridCurrentCell cc = grid.CurrentCell;
GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
if(cc != null)
{
if(cc.RowIndex == 6)
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 4;
else if(cc.RowIndex == 4)
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 7;
else if(cc.RowIndex == 2)
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 10;
else
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 6;
}
}
}
Kindly let us know if you need any further assistance.
Best Regards,
Jeba.
GK
Geetha Krishnamurthy
June 27, 2007 06:41 PM UTC
Thank you
>Hi gkrish,
There is a DrowDownRows property that you can set to control this. But it is buried a little deep, and generally needs an event handler to set it. The reason is that normally a single combobox cell control is shared among all combobox cells. And each cell can potentially have a different list, and may need different dropdownrows.
So, to handle this, you can catch the CurrentCellShowingDropdown event, and set the property there depending upon the exact row and column. Below are some code snippets.
Kindly let us know if you need any further assistance.
Best Regards,
Jeba.
>Hi gkrish,
There is a DrowDownRows property that you can set to control this. But it is buried a little deep, and generally needs an event handler to set it. The reason is that normally a single combobox cell control is shared among all combobox cells. And each cell can potentially have a different list, and may need different dropdownrows.
So, to handle this, you can catch the CurrentCellShowingDropdown event, and set the property there depending upon the exact row and column. Below are some code snippets.
//C#
private void grid_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
{
GridControlBase grid = sender as GridControlBase;
if(grid != null)
{
GridCurrentCell cc = grid.CurrentCell;
GridComboBoxCellRenderer cr = cc.Renderer as GridComboBoxCellRenderer;
if(cc != null)
{
if(cc.RowIndex == 6)
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 4;
else if(cc.RowIndex == 4)
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 7;
else if(cc.RowIndex == 2)
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 10;
else
((GridComboBoxListBoxPart)cr.ListBoxPart).DropDownRows = 6;
}
}
}
Kindly let us know if you need any further assistance.
Best Regards,
Jeba.
SIGN IN To post a reply.
- 2 Replies
- 2 Participants
-
GK Geetha Krishnamurthy
- Jun 26, 2007 09:22 PM UTC
- Jun 27, 2007 06:41 PM UTC