Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

DatagidView Formatting Lost on Sort

  • 12-01-2009 4:33pm
    #1
    Closed Accounts Posts: 2,268 ✭✭✭


    VB.net
    I have a datagrid view to which formatting is applied at runtime. When I click the column header the grid sorts as expected. However I can't reapply this formatting.

    I am tring to reapply the formatting from the click event.

    MM


Comments

  • Registered Users, Registered Users 2 Posts: 2,931 ✭✭✭Ginger


    If you add the formatting onItem_DataBound I think it should be ok..

    Where are you applying the formatting in the first place?


  • Closed Accounts Posts: 2,268 ✭✭✭mountainyman


    I am applying it on the initial load of the form. The datagrid is populated from a stored procedure.
            LoadGrid()
    
            AllFormatting()
    

    That's the pattern.


  • Registered Users, Registered Users 2 Posts: 610 ✭✭✭nialo


    You have to recall your AllFormating method within your Sorted method.


  • Closed Accounts Posts: 2,268 ✭✭✭mountainyman


    OK but I am just using the standard sort (by clicking on the column header) I call my fromat method from repaint
        Private Sub PAINT(ByVal sender As System.Object, _ 
     ByVal e As System.Windows.Forms.PaintEventArgs)  _ 
     HandlesMygrid.Paint
        
        AllFormatting()
    
        End Sub
    

    The formatting is reapplied but shows a screen flicker as it happens.


Advertisement