Dear friends,
Take a look at the following code:
| webappteste.WebReferenceX.Service1 sd = new webappteste.WebReferenceX.Service1(); |
| DataSet ds = new DataSet(); |
| ds = sd.getClientes(); //Get full list of customers from a web service |
| DataTable dt = new DataTable("clientes"); |
| dt = ds.Tables[0]; |
| RadGrid1.DataSource = dt; |
| int asd = dt.Columns.Count; //Returns 58 columns - CORRECT |
| string tableName = ds.Tables[0].Columns[0].ToString(); //Returns the column name "CLIENTE" - CORRECT |
| int b = ds.Tables[0].Columns.Count; //Returns 58 columns - CORRECT |
| int a = RadGrid1.Columns.Count; //Return 0 columns - WRONG - Why not 58 columns??? |
Can you tell me why this is happening?
Is there any other way to load a DataSet into a RadGrid?
Thanks in advance!!
WebService:
[WebMethod]
| public DataSet getClientes() |
| { |
| SqlDataAdapter dataAdapter = new SqlDataAdapter("SELECT * FROM CLIENTES ORDER BY NOME",connections.retConn()) |
| DataSet dataSet = new DataSet(); |
| dataAdapter.Fill(dataSet); |
| return dataSet |
| } |