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. Image for the cookie policy date

Trouble sizing datagrid columns

Hi, When using your AutoSizeTable code, the sample works great.....UNTIL I try to use the following code to fill my dataset: Dim ds As DataSet = New DataSet() Dim nSR As StringReader = New StringReader(sxml) Dim xmlRdr As System.Xml.XmlTextReader = New System.Xml.XmlTextReader(nSR) ds.ReadXml(xmlRdr, XmlReadMode.InferSchema) Dim myTable As New DataTable() myTable = ds.Tables("XXXXX") dataGrid1.DataSource = myTable This code is designed to take an XML string, and convert it to a dataset. Then load that dataset into the grid. When using this code to load the dataset, I get an error at the following line: dataGrid1.TableStyles("customers").GridColumnStyles(col).Width = CType(width, Integer) The error indicates that there are no GridColumnStyles in the collection. Any Ideas? Thanks Eddie

1 Reply

AD Administrator Syncfusion Team February 10, 2004 09:56 AM UTC

001 Hi! 002 Select List! In this case status_details is the table name and code and description are columns, check whether your xml file format is in correct format, make a dummy xml with the above descriptions and try to add it in the dataset, if it work then there is some format mistake in your xml file.

Live Chat Icon For mobile
Up arrow icon