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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

GridListControl Cell : Should not allow new value

Thread ID:

Created:

Updated:

Platform:

Replies:

88809 Aug 12,2009 03:25 PM UTC Aug 20,2009 07:19 AM UTC WinForms 1
loading
Tags: GridControl
Santosh U
Asked On August 12, 2009 03:25 PM UTC

Hi,

I have a GCC in which i have set one column as GridListControl.
I have some data which I am populating from database.

I want to force the user not to enter new value in the cell where the GridListControl is. A user can only type and not enter new, which happens in a ComboBoxAdv control where I can set property AllowNewText = false;

How can I acheive this in GridListControl Dropdown within a cell.
I had gone through the properties using CellRender but could not succeed in it.

Can any one please help me regarding this.

Thanks,
Piyush

Rajadurai C [Syncfusion]
Replied On August 20, 2009 07:19 AM UTC

Hi Piyush,

Thanks for your interest in Syncfusion Products.

In GridListControl celltype, there is no property support available similar to 'AllowNewText' of ComboBoxAdv control. Since ComboBoxAdv is a tools control designed to handle as seperate control, this property has been implemented in it. However, if you would like to achieve similar functionality in GridListControl celltype in grid, you can handle TableControlCurrentCellKeyPress event with the following code.

bool b;
GridCurrentCell cc = e.TableControl.CurrentCell;
if (cc.Renderer is GridDropDownGridListControlCellRenderer)
{
GridDropDownGridListControlCellRenderer rend = cc.Renderer as GridDropDownGridListControlCellRenderer;
b = false;
rend.ReplaceSel("");
string s = rend.ControlText+"" + e.Inner.KeyChar.ToString();
foreach (string item in dept)
{
if (item.StartsWith(s,StringComparison.CurrentCultureIgnoreCase))
{
b = true;
break;
}
}
if (!b)
e.Inner.Handled = true;
else
e.Inner.Handled = false;
}

Here is a sample for your reference in which this code has been implemented.
http://files.syncfusion.com/support/samples/Grid.Windows/7.3.0.20/F88809.zip

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.

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

;