|
-
February 26th, 2008, 02:18 PM
#1
sorting with datagrid
Hi
I am reading data from XML files and then i bind those data to datagrid. When i am reading xml files i load that data into object of class and then i use string builder class
here is code.
DocumentCollection updatedDocumentCollectionPolicy = new DocumentCollection();
if(documentCollection[i].SubType.Equals(SubTypes.Policy))
{updatedDocumentCollectionPolicy.Add(documentCollection[i]);
}
dgPolicies.DataSource = updatedDocumentCollectionPolicy;
dgPolicies.DataBind();
private void dgPolicies_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e) {
PopulateGrid(lnkFile, imgNewIcon, btnAdd, document);
}
public populategrid(Document document)
StringBuilder docDetails = new StringBuilder();
//docDetails.Append(document.Title);
docDetails.Append(document.SourceObjName);
docDetails.Append(" - ");
docDetails.Append(displayDate);
docDetails.Append(" - ");
docDetails.Append(document.Status); e.g status = effective
lnk.Text = Server.HtmlEncode(docDetails.ToString());
e.g document.SourceObjName= 511.600.01.01.SAC.SOP 520.13 - Return Destruction of Samples.
I append the data and then display on datagrid but i want to sort the record on SourceobjName.
Can anyone help me?
-
February 26th, 2008, 04:54 PM
#2
Re: sorting with datagrid
Create a hidden column and populate it with what you want to sort on.
Then sort on the hidden column.
Cheers,
Jon
-
February 27th, 2008, 07:11 AM
#3
Re: sorting with datagrid
do u know the concept of temp?
you want the sorted result .. right?
first populate it in one by achieving ur desire o/p , populate with your datagrid.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|