BoldSignEasily embed eSignatures in your .NET applications. Free sandbox with native SDK available.
Query |
Response |
Is it possible to lock the combobox dropdown in readonly gridboundcolumns ? |
To avoid the dropdown showing when the grid is in non-editable mode, you can use anyone of the following suggestions,
Suggestion 1:
The CurrentCellShowingDropDown event of grid can be used to restrict the dropdown showing in non-editable mode. Please make use of the below code,
Code example:
this.gridControl1.CurrentCellShowingDropDown += gridControl1_CurrentCellShowingDropDown;
//Disable the dropdown showing in NonEditable mode.
void gridControl1_CurrentCellShowingDropDown(object sender, GridCurrentCellShowingDropDownEventArgs e)
{
if (this.gridControl1.BrowseOnly)
e.Cancel = true;
}
Suggestion 2:
You can set the Enabled property to false for that combobox column, to lock the dropdown. Please make use of the below code,
Code example:
this.gridControl1.ColStyles[1].Enabled = false; |
Why is it possible to start editing in readonly textboxes ? |
In the .NET framework (say a standard TextBox), being ReadOnly does not prevent the control from accepting input focus and displaying a cursor. If you do not want to see the edit cursor, you can use BrowseOnly property instead of ReadOnly.
Code example
this.gridControl1.BrowseOnly = true; |
Can i change the cell textcolor or backcolor for editmode? |
In order to change the cell text color and back color when current cell is in edit mode, QueryCellInfo event of grid can be used. Please make use of the below code,
Code example
this.gridControl1.BrowseOnly = false;
this.gridControl1.QueryCellInfo += gridControl1_QueryCellInfo;
//Change the Cell text color and back color in edit mode.
void gridControl1_QueryCellInfo(object sender, GridQueryCellInfoEventArgs e)
{
bool hasCurrentCell = this.gridControl1.CurrentCell.HasCurrentCellAt(e.RowIndex, e.ColIndex);
bool isEditMode = this.gridControl1.CurrentCell.IsEditing;
if (hasCurrentCell && isEditMode)
{
e.Style.BackColor = Color.Yellow;
e.Style.TextColor = Color.Red;
}
} |