3 Replies - 5429 Views - Last Post: 13 September 2012 - 06:47 AM Rate Topic: -----

#1 taurusone   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 11-September 12

stop vb.net form refresh .

Posted 11 September 2012 - 10:55 AM

hi friends i have a problem, please 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.

Is This A Good Question/Topic? 0
  • +

Replies To: stop vb.net form refresh .

#2 modi123_1   User is online

  • Suitor #2
  • member icon



Reputation: 14173
  • View blog
  • Posts: 56,771
  • Joined: 12-June 08

Re: stop vb.net form refresh .

Posted 11 September 2012 - 10:56 AM

Why would the grid be refreshed on an export? If you don't want that to happen then take that line of code out!
Was This Post Helpful? 0
  • +
  • -

#3 taurusone   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 11-September 12

Re: stop vb.net form refresh .

Posted 13 September 2012 - 02:28 AM

View Postmodi123_1, on 11 September 2012 - 10:56 AM, said:

Why would the grid be refreshed on an export? If you don't want that to happen then take that line of code out!


I have commented the like me.refresh but no use.. still it gets refreshed. there is not other refresh code.

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 format?
Was This Post Helpful? 0
  • +
  • -

#4 _HAWK_   User is offline

  • Master(Of Foo)
  • member icon

Reputation: 1162
  • View blog
  • Posts: 4,444
  • Joined: 02-July 08

Re: stop vb.net form refresh .

Posted 13 September 2012 - 06:47 AM

Something I use when I am doing graphics and want to tell the system - no more automatic refreshing. It should help in your case as well.

ControlStyles
'form load event
Me.SetStyle(ControlStyles.UserPaint, True)


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1