Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
i created a dataset in the application and a TableAdapter.this TableAdapter gets data from two tables of the dataBase and inner jioned them. one of the fields is named Active.TableAdapter just gets the data from the dataBase which their active fields =0.then i created a form and put a DevExpressDataGrid in it and bound the the TAbleAdapter to it.
i have a problem to sending the new value of a edited column of the devepressDataGrid to the TableAdapter.this datagrid has 4 coulmn which one of them is named as delete column ,which showes Active field. this column is defined as bit , that i can check some rows of that column.
i want when i check the delete coulmn of some rows , and then press the delete button ,that rows be deleted .
now i dont know how to send the boolean parameter to the tableAdapter. that when the delete column of the row is checked, Edit the Active feild of that row =1 and for the next time dont show them.
i know i should create an updateQuery for the tableAdapter an send the new value of ( Active )to it, but how? i tryed different codes but they didnt work.
one of the code i used:



VB
Dim g As Boolean
Dim chkStatus As DevExpress.XtraEditors.CheckEdit = DirectCast(sender, DevExpress.XtraEditors.CheckEdit)
*Dim row As DataGridViewRow = DirectCast(chkStatus.NamingContainer, DataGridViewRow)

If chkStatus.Checked Then
    g = True
Else
    g = False

VIPAdmitTableAdapter.UpdateQuery(g)


bold line * has error: 'namingcontainer ' is not a member of 'DevExpress.XtraEditors.CheckEdit'



best regards
Posted
Updated 17-Nov-11 9:55am
v4
Comments
Pandya Anil 17-Nov-11 7:54am    
put your not working code :)
DaveAuld 17-Nov-11 15:57pm    
On a different note, you could change the IF....Else to simply; g=chkStatus.Checked :-) or ditch g and just go for VIPAdmitTableAdapter.UpdateQuery(chkStatus.Checked).

1 solution

chkStatus is of type DevExpress.XtraEditors.CheckEdit. You cast it as such. Just a guess, but it probably doesn't have a property called NamingContainer
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900