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

How to prevent empty combobox text representing nested table

Thread ID:

Created:

Updated:

Platform:

Replies:

96478 Sep 15,2010 04:19 PM UTC Sep 17,2010 08:37 AM UTC WinForms 1
loading
Tags: Grouping
Radek Pecher
Asked On September 15, 2010 04:19 PM UTC

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?


Jisha Joy [Syncfusion]
Replied On 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





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

;