Home - Forums-.NET - FlyGrid.Net (Windows Forms) - not allowing an empty field in the grid

FlyGrid.Net (Windows Forms)

.NET Datagrid - Fast, highly customizable, industry standards .NET data grid control for WinForms

This forum related to following products: FlyGrid.Net

not allowing an empty field in the grid
Link Posted: 11-Oct-2005 04:22
I have a "Parameters" DataTable (contained in a DataSet) with two columns, "Name" and "Type", all strings.

I've bound the DataSet to the grid and created two columns, also Name and Type. Now I need that the "Name" column will not accept an empty string.

How do I do it?

(I tried setting the DataColumn.AllowDBNull=false but the results were weird - I couldn't tab through the cells for some reason, and got some exceptions too).
Link Posted: 11-Oct-2005 04:26
I forgot to mention - there's no data in the DataSet - the grid is initially empty.
Link Posted: 11-Oct-2005 06:43
You can use FlyGrid.OnNodeCellChanging event to validate user input,
in your case - if user inputs empty string, handler of this event should return false (this will possible in the nearest FlyGrid.Net update).
Link Posted: 18-May-2006 11:09
Is the result of the OnNodeCellChanging stored in the FlyGrid?

I am handling cell navigation through ProcessCmdKey (the details are covered in a different topic). When a cell traversal key is pressed, I call ActivePort.EndEdit(True) to commit the change, then call ActivePort.BeginEdit() to start editing in the next cell. If OnNodeCellChanging() returned false, I don't want to switch to the next cell.
Link Posted: 18-May-2006 11:47

Is the result of the OnNodeCellChanging stored in the FlyGrid?

Yes, if this method returns true.
Link Posted: 18-May-2006 11:53
Apparently my previous question was ambiguous.
I would like to be able to tell whether OnNodeCellChanging returned true or false at the point where I called ActivePort.EndEdit(True).

Alternatively, I suppose that I could throw an exception in OnNodeCellChanging.
Link Posted: 18-May-2006 14:30
As I've understood, you would like to realize following:

if (EndEdit(true))
{
  //go editing next cell
}
else
{
   //stay here
}

?
Link Posted: 18-May-2006 16:06
That is correct.
Link Posted: 19-May-2006 01:54
Nearest FlyGrid.Net update will supports this functionality.