Solved

DataGrid: Sort columns or hide columns

Posted on 2004-10-10
3
383 Views
Last Modified: 2012-05-05
I'd like to produce a datagrid with two different modes - one mode would be a conventional sort...clicking the column head toggles between ascending/descending sort.

In the other mode clicking the column header of a given column will cause that column to shrink to 10 pixels wide with all cells containing blanks. Click that column again and it toggles to it's regular width and content.

I'm figuring the best way to indicate mode is a checkbox.

It'd be great if shifting between modes didn't require a trip back to the server but first things first.

thankx

0
Comment
Question by:juststeve
3 Comments
 
LVL 2

Accepted Solution

by:
dwcorwith earned 500 total points
ID: 12358768
Try to adjust the properties of your datagrid column something like this:

        Dim l As Button
        If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
            l = CType(e.Item.Cells(12).FindControl("cmdDel"), Button)                            
            l.Attributes.Width = "10"
        End If

Confirm the syntax of L.Attributes.Width.  This references a Column Template in a DataGrid that happens to be a button.  You would reference your column template this is of another type, (not a button).

Hope this helps.
dwcorwith
 Also see:
http://builder.com.com/5100-6373-1049811.html#Listing%20E

I know you are not trying to delete something however see if you can just change the attribute of  a column to do what you want.
 Perhaps you could also do a search at builder.com to find a tutoral.  Nice clear turtorals.
0
 

Author Comment

by:juststeve
ID: 12574550
The question was better handled over in the JavaScript room:

http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_21166530.html
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
I have developed many web applications with asp & asp.net and to add and use a dropdownlist was always a very simple task, but with the new asp.net, setting the value is a bit tricky and its not similar to the old traditional method. So in this a…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

733 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question