Results 1 to 5 of 5

Thread: stop form refresh

  1. #1
    taurusone is offline VB.NET Forum Newbie
    .NET Framework
    .NET 1.1
    Join Date
    Sep 2012
    Posts
    4
    Reputation
    0

    stop form refresh

    hi friends i have a problem, plz help me out.
    i have a vb.net form with grid view and "export to excel" button. grid view has date column which displays date in this form> 21-02-2012 but once i click on "export to excel" button the grid view data is exported to excel. After exporting the form gets refreshed and date gets changed to 02/21/2012 (check this date and month is interchanged) or 21 feb 2012.
    how do i stop this grid view or form from getting refreshed.

  2. #2
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    11,355
    Reputation
    1544
    It's not like it just happens of it's own accord and you have to do something specific to stop it happening. If it's happening then it's because your code is doing it. If you want it not to happen then don't make it happen. As to what it is that you're doing that makes it happen, we can't possibly know because we don;t know what you're doing.

    Just to be clear, you are saying that the format of the dates in the DataGridView changes when you perform the export, right?

  3. #3
    taurusone is offline VB.NET Forum Newbie
    .NET Framework
    .NET 1.1
    Join Date
    Sep 2012
    Posts
    4
    Reputation
    0
    Yes you are right.

    The gridview in my program is defined as follows:
    Me.gridview1.MappingFeilds = "InvoiceNumber[Invoice-Number],InvoiceDate[Invoice-Date]"

    Invoice-Date> is gridview1 column name
    InvoiceDate> is column name in database

    How do i change the date formate?

  4. #4
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    11,355
    Reputation
    1544
    I'm afraid that I have no idea what control you're talking about. There is no GridView control in Windows Forms so I assumed that you were talking about a DataGridView, but it has no MappingFields property. In fact, I just searched MSDN and there was no matches for MappingFields at all. That would suggest that you are using a third-party grid control, which is not information that we should have to guess. You need to provide us with ALL the relevant information.

  5. #5
    Lotok is offline VB.NET Forum Genius
    .NET Framework
    .NET 4.0
    Join Date
    Jan 2012
    Location
    Scotland
    Posts
    193
    Reputation
    22

    Re: stop vb.net form refresh

    Excel is a annoying with dates, you sure the export isn't fine, but when opened in excel, excel changes the formatting?

    Sent using XT910 with Android 4.0.4 and MIUI 2.8.10

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking