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.

GridDataBoundGrid - Selecting Text Within a Cell Programatically

Thread ID:

Created:

Updated:

Platform:

Replies:

93188 Mar 2,2010 11:57 AM Mar 4,2010 10:00 AM ASP.NET Web Forms (Classic) 1
loading
Tags: GridGroupingControl
Jeffrey Dufseth
Asked On March 2, 2010 11:57 AM

Hi,

I need to select the text within a specific cell programatically. I am using the GridDataBoundGrid.

Currently, when a user opens a grid drop down box, if they want to start typing to get to their item faster, they have to manually select or delete the text in that cell. Because of this, I want to select the text automatically when they open a drop down box.

Anyone know how to select text programatically?

Thanks

Rajadurai C [Syncfusion]
Replied On March 4, 2010 10:00 AM

Hi Jeffrey,

Thanks for your interest in Syncfusion Products.

To set the text selected in the dropdowncell on opening the dropdown, you can handle the CurrentCellShowingDropDown event with the following kind of code which is used for Combobox cell in GridDataBoundGrid.

//Method Invoker
this.gridDataBoundGrid1.CurrentCellShowingDropDown += new Syncfusion.Windows.Forms.Grid.GridCurrentCellShowingDropDownEventHandler(gridDataBoundGrid1_CurrentCellShowingDropDown);

//gridDataBoundGrid1_CurrentCellShowingDropDown
GridCurrentCell cc = this.gridDataBoundGrid1.CurrentCell;
if (cc.Renderer is GridComboBoxCellRenderer)
{
GridComboBoxCellRenderer rend = cc.Renderer as GridComboBoxCellRenderer;
if (rend != null)
rend.TextBox.SelectAll();
}

Regards,
Rajadurai

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.

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.

;