We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

Removing the down icon from comboboxes

I am using a column containing combo boxes to format the column data in databound grid.

Eg the datatable that is bound to the grid contains values such as X, A and I display Cancelled or Accepted etc.

This works well but I will never need the user to edit this column so don't need the down arrow icon you click on to activate the drop down. Is there a way to hide this icon ?

Cheers


1 Reply

RC Rajadurai C Syncfusion Team October 13, 2008 12:17 PM UTC

Hi Geoff,

Thanks for your interest in Syncfusion products.

You can prevent the user from changing the combobox cells by making them 'read-only' instead of hiding the dropdown icon button. Please try the following code in PrepareViewStyleInfo event to achieve this feature.


private void gridDataBoundGrid1_PrepareViewStyleInfo(object sender,GridPrepareViewStyleInfoEventArgs e)
{
if(e.ColIndex == 3 && e.RowIndex != 0) //Check for combobox cell
{
e.Style.ReadOnly = true;
}
}


Please check out the sample here.
GDBG-77048.zip


Regards,
Rajadurai


Loader.
Live Chat Icon For mobile
Up arrow icon