Sort datagrid

Discussion in 'ASP .Net Datagrid Control' started by sam, Sep 27, 2004.

  1. sam

    sam Guest

    Hello Group,
    I have a datagrid which needs to be sorted but the column
    headers should not be clickable on certain conditions( say on the
    "print version" of the page). The simple piece of code used is :

    dgwip.allowsorting=true
    dgWIP.DataSource = dvWIP
    dvWIP.Sort = Me.SortColumn & " " & Me.SortOrder
    dgWIP.DataBind()
    **dgwip.allowsorting=false

    Since, I need to sort the datagrid and disable the column headers
    after the sort, I disable the allowsorting property after the databind
    but that does not seem to do the job. Not sure, how to go about it.

    Any help would be great!!


    Thanks,
    Sam.
    sam, Sep 27, 2004
    #1
    1. Advertising

  2. sam

    Eric Guest

    From your description, the special conditions that preclude sorting also
    require a post back or new page. If you can track when this is true, then
    you can disallow sorting. For example, the "Print Version" is obvoiusly a
    special case rendering of the page, so you can track it and disallow sorting
    when it is true.

    "sam" <> wrote in message
    news:...
    > Hello Group,
    > I have a datagrid which needs to be sorted but the column
    > headers should not be clickable on certain conditions( say on the
    > "print version" of the page). The simple piece of code used is :
    >
    > dgwip.allowsorting=true
    > dgWIP.DataSource = dvWIP
    > dvWIP.Sort = Me.SortColumn & " " & Me.SortOrder
    > dgWIP.DataBind()
    > **dgwip.allowsorting=false
    >
    > Since, I need to sort the datagrid and disable the column headers
    > after the sort, I disable the allowsorting property after the databind
    > but that does not seem to do the job. Not sure, how to go about it.
    >
    > Any help would be great!!
    >
    >
    > Thanks,
    > Sam.
    Eric, Oct 29, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Eugene
    Replies:
    0
    Views:
    481
    Eugene
    Sep 28, 2004
  2. nobody
    Replies:
    0
    Views:
    535
    nobody
    Jun 1, 2004
  3. JerryJ
    Replies:
    11
    Views:
    1,403
    Dave Moore
    Apr 28, 2004
  4. John Black
    Replies:
    6
    Views:
    2,059
    John Harrison
    May 28, 2004
  5. Navin
    Replies:
    1
    Views:
    690
    Ken Schaefer
    Sep 9, 2003
Loading...

Share This Page