tags:

views:

262

answers:

1

I bind my datagrid using

//fill datagrid
    public DataTable GameData
    {
        get
        {
            DataSet ds = new DataSet();
            FileStream fs = new FileStream(IMDB.WebPage.Class.Config.XMLPath,
            FileMode.Open, FileAccess.Read);
            StreamReader reader = new StreamReader(fs, Encoding.Default);
            ds.ReadXml(reader);
            fs.Close();
            DataTable temp = ds.Tables[0];
            return ds.Tables[0];
        }
    }

For some reason I get an empty row at the bottom. And sometimes after clicking on some buttons and checkboxes in the grid, more empty rows are added.

Why is this? And how do I block this?

thx all! u've been great

+1  A: 

Sounds like you probably have CanUserAddRows set to true for the DataGrid. Just add

CanUserAddRows="false"

to the XAML.

TomiJ
great, that did the trick! Weird why this is on by default..
WtFudgE