various Datagrid questions

yousuf42

Well-known member
Joined
Feb 12, 2006
Messages
101
Programming Experience
1-3
Here I would make it clear what i'm doing with DG and where I face problem.
The DG has 6 columns respectively Sno,ProdId,ProdDescription,Qty,Uprice,Amount.

1. Sno is autoincrement upon adding new rows. I put following code to auto increment Sno (related colunm of datatable).

VB.NET:
tblTempinvoice.Columns(0).AutoIncrementSeed = 1
tblTempinvoice.Columns(0).AutoIncrementStep = 1
tblTempinvoice.Columns(0).AutoIncrement = True

The problem is whenever I click on the last row it gives new number without keeping its sequence. for example if the last row sno is 8 I click out side DG then click on sno 8 it changes to 9 then after a single click outside and on DG then 10 If I delete any row it never changes to proper number sequence.

2. ProdId is where I enter ProductID then If the user presses enter key Product Description should display inthe description colunm and price in Uprice column. here I wanted to attache a small button, if the user clicks this button, another form (which already I have it) will show productID list so, the user can pick it up if he cant remember the prodID. (How can we attach a small button in this column)

3. When the user enters numbers into qty column and presses enterkey amount column should show the calculated value (that is qty*Uprice)
I have done this last two in VB6 but I could not do all this in VB dot net2003. can any one help me please?
 
Back
Top