Click here to Skip to main content
15,921,697 members
Home / Discussions / C#
   

C#

 
QuestionHandling Usercontrol with menu items in C# Pin
Hammad Rasheed25-Oct-11 23:36
Hammad Rasheed25-Oct-11 23:36 
AnswerRe: Handling Usercontrol with menu items in C# Pin
V.26-Oct-11 1:16
professionalV.26-Oct-11 1:16 
AnswerRe: Handling Usercontrol with menu items in C# Pin
PIEBALDconsult26-Oct-11 2:33
mvePIEBALDconsult26-Oct-11 2:33 
QuestionRe: Handling Usercontrol with menu items in C# Pin
Luc Pattyn26-Oct-11 4:16
sitebuilderLuc Pattyn26-Oct-11 4:16 
AnswerRe: Handling Usercontrol with menu items in C# Pin
PIEBALDconsult26-Oct-11 14:50
mvePIEBALDconsult26-Oct-11 14:50 
AnswerFlag: Repost of QA question: Re: Handling Usercontrol with menu items in C# Pin
BillWoodruff27-Oct-11 21:05
professionalBillWoodruff27-Oct-11 21:05 
QuestionInsert image on ricktextbox Pin
Chu Van Dat25-Oct-11 15:56
Chu Van Dat25-Oct-11 15:56 
AnswerRe: Insert image on ricktextbox Pin
Luc Pattyn25-Oct-11 16:24
sitebuilderLuc Pattyn25-Oct-11 16:24 
GeneralRe: Insert image on ricktextbox Pin
Mycroft Holmes25-Oct-11 21:44
professionalMycroft Holmes25-Oct-11 21:44 
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 

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.