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

How to prevent empty combobox text representing nested table

Example "Relations And Hierarchy\List Item Reference Demo", supplied with the Syncfusion installation, demonstrates how to set up nested tables. It is however possible to clear the selected text (e.g., the country name) and end up with an empty text in the combobox, representing no country at all. I would like to prevent such empty cells and always show some valid entry from the child table. How can I set up validators for such cells, please? Is there any property/event I can use and not resort to deriving my own classes?


1 Reply

JJ Jisha Joy Syncfusion Team September 17, 2010 08:37 AM UTC

Hi Radek,

You could achieve the desired behavior by handling the TableControlCurrentCellValidating event. See the code:

private void gridGroupingControl1_TableControlCurrentCellValidating(object sender, Syncfusion.Windows.Forms.Grid.Grouping.GridTableControlCancelEventArgs e)
{
GridCurrentCell gc = this.gridGroupingControl1.TableControl.CurrentCell;
if (gc.Renderer.ControlText == "")
{
e.Inner.Cancel = true;
gc.ErrorMessage = "Null not allowed";
}

Regards,
Jisha





Loader.
Live Chat Icon For mobile
Up arrow icon