This project is read-only.

Widget BindGrid() - cant delete last entry in grid - bug fix..

Topics: Controls
Jun 16, 2009 at 9:59 PM

Playing about with the LinkList widget, and cant delete the last link in my list. No matter how many times i hit the delete button, the link wont go away!

Problem lies in the BindGrid() method..

Here is a working solution...




private void BindGrid()
        XmlDocument doc = Doc();
		XmlNodeList list = doc.SelectNodes("//link");

        if (list.Count > 0)
            using (XmlTextReader reader = new XmlTextReader(doc.OuterXml, XmlNodeType.Document, null))
                System.Data.DataSet ds = new System.Data.DataSet();
                grid.DataSource = ds;
                grid.DataKeyNames = new string[] { "id" };
        { //BUG FIX to remove last entry in grid
            grid.DataSource = null;


Hope thats of some help to someone!!