Hi , Please go through this code....
BaseClassDataContext = New BaseClassDataContext(BLLmdlCommon.strConfiguration)
'Left outer join for extracting the project table records
Dim query = From p In BaseClassDataContext.GetTable(Of CP\_Project)() \_
Group Join crt In BaseClassDataContext.GetTable(Of CP\_CLM\_ClientRating)() \_
On p.RatingID Equals crt.RatingID Into ratingname = Group From c In ratingname.DefaultIfEmpty() \_
Group Join cname In BaseClassDataContext.GetTable(Of CP\_CLM\_Client)() \_
On cname.ClientID Equals p.ClientID Into clientname = Group From c1 In clientname.DefaultIfEmpty() \_
Group Join pstatus In BaseClassDataContext.GetTable(Of CP\_PRJ\_ProjectStatus)() \_
On pstatus.ProjectStatusID Equals p.ProjectStatusID Into projectstatus = Group From c2 In projectstatus.DefaultIfEmpty() \_
Group Join pjtype In BaseClassDataContext.GetTable(Of CP\_PRJ\_ProductType)() \_
On pjtype.ProductTypeID Equals p.ProductTypeID Into pj = Group From projecttype In pj.DefaultIfEmpty() \_
Select c.Rating, p.ProjectName, c1.ClientName, p.StartDate, p.DeliveryDate, c2.ProjectStatus, \_
p.ProjectID, c.RatingColor, projecttype.ProductType
'grdTasks.DataSource = query
If i bind the grid now then i don't get the order of the column as i mentioned above Now instead of binding the grid now , if i create it's XML and convert into dataset . Then the order is correct.
xElement = New XElement("Root", From p In query Select New XElement("Leaf", _
New XElement("Rating", p.Rating), _
New XElement("ProjectName", p.ProjectName), _
New XElement("ClientName", p.ClientName), _
New XElement("StartDate", p.StartDate), _
New XElement("DeliveryDate", p.DeliveryDate), _
New XElement("ProjectStatus", p.ProjectStatus), _
New XElement("ProjectID", p.ProjectID), _
New XElement("RatingColor", p.RatingColor), _
New XElement("RatingColor", p.ProductType)))
ds = New DataSet
ds.ReadXml(New System.IO.StringReader(xElement.ToString()))