Click here to Skip to main content
15,896,154 members
Home / Discussions / C#
   

C#

 
GeneralRe: Insert image on ricktextbox Pin
BobJanova25-Oct-11 22:54
BobJanova25-Oct-11 22:54 
AnswerRe: Insert image on ricktextbox Pin
Luc Pattyn26-Oct-11 0:36
sitebuilderLuc Pattyn26-Oct-11 0:36 
GeneralRe: Insert image on ricktextbox Pin
BobJanova26-Oct-11 2:47
BobJanova26-Oct-11 2:47 
AnswerRe: Insert image on ricktextbox Pin
Luc Pattyn26-Oct-11 4:12
sitebuilderLuc Pattyn26-Oct-11 4:12 
GeneralRe: Insert image on ricktextbox Pin
BobJanova26-Oct-11 5:09
BobJanova26-Oct-11 5:09 
AnswerRe: Insert image on ricktextbox Pin
Luc Pattyn26-Oct-11 5:21
sitebuilderLuc Pattyn26-Oct-11 5:21 
QuestionCreate LDAP Listener Pin
tellaston134525-Oct-11 8:01
tellaston134525-Oct-11 8:01 
QuestionSorting in multiple columns in gridview using C# Pin
Dhyanga25-Oct-11 7:01
Dhyanga25-Oct-11 7:01 
Hi,

I am using sorting feature in multiple columns in a gridview. My gridview sorting is like this:
protected void gView_Sorting(object sender, GridViewSortEventArgs e)
        {
            //checking direction for sorting
            try
            {
                if (this.ParentPortlet.PortletViewState["direction"].ToString() == "")
                {
                    this.ParentPortlet.PortletViewState["direction"] = " ASC";
                }
                else if (this.ParentPortlet.PortletViewState["direction"].ToString() == " ASC")
                {
                    this.ParentPortlet.PortletViewState["direction"] = " DESC";
                }
                else if (this.ParentPortlet.PortletViewState["direction"].ToString() == " DESC")
                {
                    this.ParentPortlet.PortletViewState["direction"] = " ASC";
                }
            }
            catch 
            {
                this.ParentPortlet.PortletViewState["direction"] = " DESC";
            }
            getData(e.SortExpression.ToString(), this.ParentPortlet.PortletViewState["direction"].ToString());
        }

I have four columns in the gridview (Name, Date, Location, Cell) and all these columns are sortable. so If i click name, it sorts in desc order and again if i click it, it will sort in asc order which is great. Similar with the other fields. But my problem is If I click the Name, it will sort in desc order. Now If i click Date, it will sort in asc order. Again If I click the Name, it will sort in desc order. Is there any way we can put these sortings independent to each column. Like, If I click Name, it should sort in desc order. Now If I click date, it should sort in desc order. Now again, If i click Name, it should sort in asc order.

Any ideas?
suchita

AnswerRe: Sorting in multiple columns in gridview using C# Pin
Not Active25-Oct-11 8:36
mentorNot Active25-Oct-11 8:36 
GeneralRe: Sorting in multiple columns in gridview using C# Pin
Dhyanga25-Oct-11 9:32
Dhyanga25-Oct-11 9:32 
GeneralRe: Sorting in multiple columns in gridview using C# Pin
Not Active25-Oct-11 9:38
mentorNot Active25-Oct-11 9:38 
AnswerRe: Sorting in multiple columns in gridview using C# Pin
Luc Pattyn25-Oct-11 9:50
sitebuilderLuc Pattyn25-Oct-11 9:50 
GeneralRe: Sorting in multiple columns in gridview using C# Pin
Dhyanga25-Oct-11 9:53
Dhyanga25-Oct-11 9:53 
AnswerRe: Sorting in multiple columns in gridview using C# Pin
Luc Pattyn25-Oct-11 10:18
sitebuilderLuc Pattyn25-Oct-11 10:18 
QuestionDeployment of c# application with merge modules Pin
sarang_k24-Oct-11 20:49
sarang_k24-Oct-11 20:49 
AnswerRe: Deployment of c# application with merge modules Pin
Pete O'Hanlon24-Oct-11 21:05
mvePete O'Hanlon24-Oct-11 21:05 
QuestionDynamically placing Forms onto TabControl Pages - need to add threading Pin
boreland24-Oct-11 13:29
boreland24-Oct-11 13:29 
AnswerRe: Dynamically placing Forms onto TabControl Pages - need to add threading Pin
Luc Pattyn24-Oct-11 14:19
sitebuilderLuc Pattyn24-Oct-11 14:19 
GeneralRe: Dynamically placing Forms onto TabControl Pages - need to add threading Pin
boreland24-Oct-11 17:48
boreland24-Oct-11 17:48 
GeneralRe: Dynamically placing Forms onto TabControl Pages - need to add threading Pin
BobJanova24-Oct-11 23:04
BobJanova24-Oct-11 23:04 
GeneralRe: Dynamically placing Forms onto TabControl Pages - need to add threading Pin
BillWoodruff25-Oct-11 3:20
professionalBillWoodruff25-Oct-11 3:20 
GeneralRe: Dynamically placing Forms onto TabControl Pages - need to add threading Pin
boreland25-Oct-11 3:53
boreland25-Oct-11 3:53 
GeneralRe: Dynamically placing Forms onto TabControl Pages - need to add threading Pin
Pete O'Hanlon25-Oct-11 4:10
mvePete O'Hanlon25-Oct-11 4:10 
GeneralRe: Dynamically placing Forms onto TabControl Pages - need to add threading Pin
BillWoodruff25-Oct-11 14:53
professionalBillWoodruff25-Oct-11 14:53 
GeneralRe: Dynamically placing Forms onto TabControl Pages - need to add threading Pin
boreland25-Oct-11 15:49
boreland25-Oct-11 15:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.