Solved

DataGrid: Sort columns or hide columns

Posted on 2004-10-10
3
380 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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This video discusses moving either the default database or any database to a new volume.
Illustrator's Shape Builder tool will let you combine shapes visually and interactively. This video shows the Mac version, but the tool works the same way in Windows. To follow along with this video, you can draw your own shapes or download the file…

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now