Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > .NET General

Vista - CellFormating function slowing down table refresh..

Reply
 
Old 03-30-2009   #1 (permalink)
Christiano Donke


 
 

CellFormating function slowing down table refresh..

hey there...

I'm using this function to place place an image inside a datagridview


If e.ColumnIndex = 0 Then
If Not (GridView.Item("StatAnda", e.RowIndex).Value) Is Nothing
Then
Dim value As String = GridView.Item("StatAnda",
e.RowIndex).Value.ToString 'Gets the filename of the image to be placed
Dim img = Image.FromFile(modProp.AppPath & "\status\" &
value) 'Read the image
GridView.Item("ImagAnda", e.RowIndex).Value = img 'PLace
it in the grid
End If
End If


But it's slowing down my grid refresh... is there something that i can
change to speed it up??
Maybe place the images on the resources??

Changing a cell backcolor may get it faster??


Tks,
christiano.



My System SpecsSystem Spec
Old 04-02-2009   #2 (permalink)
Cesar


 
 

Re: CellFormating function slowing down table refresh..

First of all, getting every image from the disk is costly. Surely it will
slow down the process, specially if your grid show several lines.

Try setting the images on a array first, then reuse whenever you need an
already loaded image.



"Christiano Donke" <cdonke@xxxxxx> wrote in message
news:e7nh7wSsJHA.4876@xxxxxx
Quote:

> hey there...
>
> I'm using this function to place place an image inside a datagridview
>
>
> If e.ColumnIndex = 0 Then
> If Not (GridView.Item("StatAnda", e.RowIndex).Value) Is Nothing
> Then
> Dim value As String = GridView.Item("StatAnda",
> e.RowIndex).Value.ToString 'Gets the filename of the image to be placed
> Dim img = Image.FromFile(modProp.AppPath & "\status\" &
> value) 'Read the image
> GridView.Item("ImagAnda", e.RowIndex).Value = img
> 'PLace it in the grid
> End If
> End If
>
>
> But it's slowing down my grid refresh... is there something that i can
> change to speed it up??
> Maybe place the images on the resources??
>
> Changing a cell backcolor may get it faster??
>
>
> Tks,
> christiano.
>

My System SpecsSystem Spec
Old 04-03-2009   #3 (permalink)
Christiano Donke


 
 

Re: CellFormating function slowing down table refresh..

i've realized that..

i've solved that placing the images in the resources... and importing them
from there..

tks anyway..
christiano.

"Cesar" <nospam@xxxxxx> escreveu na mensagem
news:uSwOhD7sJHA.4068@xxxxxx
Quote:

> First of all, getting every image from the disk is costly. Surely it will
> slow down the process, specially if your grid show several lines.
>
> Try setting the images on a array first, then reuse whenever you need an
> already loaded image.
>
>
>
> "Christiano Donke" <cdonke@xxxxxx> wrote in message
> news:e7nh7wSsJHA.4876@xxxxxx
Quote:

>> hey there...
>>
>> I'm using this function to place place an image inside a datagridview
>>
>>
>> If e.ColumnIndex = 0 Then
>> If Not (GridView.Item("StatAnda", e.RowIndex).Value) Is
>> Nothing Then
>> Dim value As String = GridView.Item("StatAnda",
>> e.RowIndex).Value.ToString 'Gets the filename of the image to be
>> placed
>> Dim img = Image.FromFile(modProp.AppPath & "\status\" &
>> value) 'Read the image
>> GridView.Item("ImagAnda", e.RowIndex).Value = img 'PLace
>> it in the grid
>> End If
>> End If
>>
>>
>> But it's slowing down my grid refresh... is there something that i can
>> change to speed it up??
>> Maybe place the images on the resources??
>>
>> Changing a cell backcolor may get it faster??
>>
>>
>> Tks,
>> christiano.
>>
>
>

My System SpecsSystem Spec
Reply

Thread Tools


Similar Threads
Thread Forum
Typed datasets and table table adapters components not showing inToolbox .NET General
KAV 9 is slowing down my internet? System Security
Slowing down the mouse General Discussion
how do you create a dynamic table/pivot table .NET General
BUG: Redirecting function contents to a file truncates function lines at the width of the console PowerShell


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46