or
I have a win form with a DataGridView and two edit fields and a binding navigator.The DataGridView and the edit fields are bound to a database table.
If i press the „Add“ button in the binding navigator, the DataGridView scrolls down to the bottom, adds an empty line at the bottom and the two edit fields are cleared. After entering data in the edit fields, and selecting any other items in the DataGridView, the values from the edit fields are shown in the new line at the bottom of the grid.
Now I have replaced the DataGridView with the RadGridView 2010 Q3.
If I press the „Add“ button in the binding navigator, the RadGridView scrolls down (but not to the very bottom), adds an empty line at the bottom, however it does not scroll to this new line. So it’s invisible until the user scrolls the list to the end. The two edit fields still have the content of the last selected item. They are not cleared. I can overwrite in the two edit fields the existing values with some new values. The new values are now in the dataset but the RadDataView is not updated with the new values. At the bottom in the grid, there is still the new empty line. If I click on the empty line, the correct values are shown in the edit fields.
dsRittenTemp.Clear()
dsGoederenTemp.Clear()
'
cmdRittenTemp =
New
Odbc.OdbcCommand(
"Select * FROM ritten_temp WHERE ritnummer = '"
& RitNummer &
"'"
, cn)
adpRittenTemp =
New
Odbc.OdbcDataAdapter(cmdRittenTemp)
adpRittenTemp.Fill(dsRittenTemp,
"ritten_temp"
)
'
cmdGoederenTemp =
New
Odbc.OdbcCommand(
"Select * FROM goederen_temp"
, cn)
adpGoederenTemp =
New
Odbc.OdbcDataAdapter(cmdGoederenTemp)
adpGoederenTemp.Fill(dsGoederenTemp,
"goederen_temp"
)
' Me.RadGridViewOverView.MasterTemplate.Templates.Clear()
RadGridViewOverView.DataSource = dsRittenTemp
RadGridViewOverView.DataMember =
"ritten_temp"
Dim
template
As
New
GridViewTemplate()
template.DataSource = dsGoederenTemp
template.DataMember =
"goederen_temp"
RadGridViewOverView.MasterTemplate.Templates.Add(template)
Dim
relation
As
New
GridViewRelation(RadGridViewOverView.MasterTemplate)
relation.ChildTemplate = template
relation.RelationName =
"goederenticket"
relation.ParentColumnNames.Add(
"goederenticket"
)
relation.ChildColumnNames.Add(
"goederenticket"
)
RadGridViewOverView.Relations.Add(relation)
RadGridViewOverView.AllowEditRow =
False
RadGridViewOverView.MasterTemplate.Templates(0).AllowEditRow =
False
public
class
MyCar
{
private
string
_carOwner;
private
string
_carModel;
private
int
_carYear;
private
string
_carColor;
private
double
_carPrice;
private
double
_carDepreciation;
public
MyCar(
string
carOwner,
string
carModel,
int
carYear,
string
carColor,
double
carPrice,
double
carDepreciation)
{
CarOwner = carOwner;
CarModel = carModel;
CarYear = carYear;
CarColor = carColor;
CarPrice = carPrice;
CarDepreciation = carDepreciation;
}
public
string
CarOwner
{
get
{
return
_carOwner; }
set
{ _carOwner = value; }
}
public
string
CarModel
{
get
{
return
_carModel; }
set
{ _carModel = value; }
}
public
int
CarYear
{
get
{
return
_carYear; }
set
{ _carYear = value; }
}
public
string
CarColor
{
get
{
return
_carColor; }
set
{ _carColor = value; }
}
public
double
CarPrice
{
get
{
return
_carPrice; }
set
{ _carPrice = value; }
}
public
double
CarDepreciation
{
get
{
return
_carDepreciation; }
set
{ _carDepreciation = value; }
}
}