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.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

UseRightToLeftCompatibleTextBox propert change for v5.1

Thread ID:

Created:

Updated:

Platform:

Replies:

63923 Jul 11,2007 01:20 PM Jul 11,2007 05:54 PM Windows Forms 1
loading
Tags: GridControl
Burke Harris
Asked On July 11, 2007 01:20 PM

I have some code in an CurrentCellActivated event handler that I have been using to highlight the text in our custom grid filter row. It has been working fine for years but when we switched to v5.1 we started getting an exception trying to convert our filter comboboxes to GridDropDownEditPartControl. After some digging around I found this new property UseRightToLeftCompatibleTextBox being set to true is causing the issue.

My questions are:

Does it make sense for UseRightToLeftCompatibleTextBox to be defaulted to true?

If so should I stop using GridDropDownEditPartControl (I ma using in two other places)?

If so, what should I use instead of GridDropDownEditPartControl?

Thanks,
Burke Harris
Senior Developer
Quellos Group LLC

Exception:
Unable to cast object of type 'Syncfusion.Windows.Forms.Grid.GridOriginalTextBoxControl' to type 'Syncfusion.Windows.Forms.Grid.GridDropDownEditPartControl'."

Code:

private void QDataBoundGrid_CurrentCellActivated(object sender, System.EventArgs e)
{
//Skip processing if the grid is binding.
if (this.m_blnDataSourceChanging) { return; }

//Set the cell display if this is a filter cell.
if (this.IsFilterBarCell(CurrentCell.RowIndex, CurrentCell.ColIndex))
{
try
{
//Get a reference to the drop down control.
GridDropDownEditPartControl objDropDownTextBox = (GridDropDownEditPartControl)CurrentCell.Renderer.Control;

//Select all text in the filter cell by default.
objDropDownTextBox.SelectAll();

objDropDownTextBox.Focus();
}
catch (Exception ex)
{
QC.ExceptionHandler.Log(ex);
}

}


}

haneefm [Syncfusion]
Replied On July 11, 2007 05:54 PM

Hi,

By default The TextBox celltype uses in a grid cell. The Filtered TextBox celltype uses a GridDropDownEditPartControl as editing control. But if you set the UseRightToLeftCompatibleTextBox property then grid uses the OriginalTextBox celltype in a grid cell. The OriginalTextBox celltype uses a Wndows.Forms.TextBox as the editing control. This different base control is the reason they behave differently. One way you can resolve this by using the GridOriginalTextBoxControl instead of GridDropDownEditPartControl. Below is a code snippet

GridOriginalTextBoxControl objDropDownTextBox = ( GridOriginalTextBoxControl )CurrentCell.Renderer.Control;

//Select all text in the filter cell by default.
objDropDownTextBox.SelectAll();

objDropDownTextBox.Focus();

Best regards,
Haneef

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;