I have Column which have data like digits and string together . But I need this to be sorted by digits. Once Click on column sorting the data From stored procedure is getting sorted as required. But after binding to grid the data in the column changes. Please help
Below is the column data
Hello,
Could you please share a small sample with me that is showing this issue in order to investigate it further for you.
Looking forward for your reply.
Hi Zdravko Kolev ,
Thanks for the response. Actually I am binding the data in server side. When I click on the column for sorting. The Stored procedure takes care of the sorting and provided the sorted values. The Sorting for the mentioned column(Total Budget) is perfect from stored procedure. But after binding that to Grid the order changes.
This is the code where I am binding the data to grid :
{
dgBudgetApprovalAlerts.DataSource = m_ResultDataSet;
dgBudgetApprovalAlerts.DataBind();
Enter.Visible = true;
Pager1.Visible = true;
dgBudgetApprovalAlerts.Visible = true;
NoRecords.InnerHtml = "";
}
The dataset from Stored procedure where TotalBudget is Sorted in ASC.
But after binding to grid the result is . We need grid to display data as it is in Dataset.
Hello ramya y,
Thank your for contacting us.
About your question, when data is formed by digits and strings together it is considered as a string only, you cannot sort it by digits.
Could I ask you what do you mean by saying "data in the column changes" do you mean that the data is lost? How you are binding your grid? If you set the data source through the code behind on Page_Load for example, you should provide this data source every time on postback. Could you please share with me isolated sample that is showing the issue, in order to investigate this behavior.
When sorting is used, and you rebind the grid after some column was already sorted, the order should be persisted.
Looking forward to hearing from you.