HighTechTalks DotNet Forums  

how to set values in datagrid

VB.net Controls microsoft.public.dotnet.languages.vb.controls


Discuss how to set values in datagrid in the VB.net Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Michael
 
Posts: n/a

Default how to set values in datagrid - 01-28-2008 , 07:43 AM






Hi all,
I am using Datagrid control in VB.Net 2003.
Now I have a problem like this,
when user changed the value in a cell in datagrid, I want all the
values in the same column below the current row changed to the new
value.
How can I do this?
I use currentcellchaged event like below:

Private Sub myGRID_CurrentCellChanged(ByVal sender As Object,
ByVal e As System.EventArgs) Handles myGRID.CurrentCellChanged
''''Get total row count
Dim i as Integer
Dim NewValue as Integer
NewValue=CInt(myGRID.Item(myGRID.CurrentRowIndex,
ColumnNumber))
i = myGRID.BindingContext(Me.ALLOCATIONS_GRID.DataSour ce,
myGRID.DataMember).Count()
If (myGRID.CurrentRowIndex + 1) < i Then
myGRID.Item(myGRID.CurrentRowIndex + 1, ColumnNumber) =
NewValue
End If
End Sub

Can anybody advise on this?
I always get "ListManager's position must equal to rownum" exception.
Thanks.

Regars,
Michael

Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.