?
Solved

DataGrid: Sort columns or hide columns

Posted on 2004-10-10
3
Medium Priority
?
385 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 2

Accepted Solution

by:
dwcorwith earned 1500 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

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

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

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
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.
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…
Suggested Courses

764 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