Solved

DataGrid: Sort columns or hide columns

Posted on 2004-10-10
3
382 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

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

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.
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

825 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