We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

how can i do this

i want to make invoice and using Essential Grid so i just ask how can i do the grid control add new row when the user get the last cell of the last row when he press inter i dont want to use button i know that
soo give me help with that


reda hashem
egypt


13 Replies

RE reda January 29, 2008 04:43 PM UTC

by the way i use vb2008 noot c#




RA rardis January 29, 2008 10:13 PM UTC


>by the way i use vb2008 noot c#




Try This?

Me.GridDataBoundGrid1.Model.Options.WrapCellBehavior = GridWrapCellBehavior.WrapRow



RE reda January 29, 2008 10:35 PM UTC



thank u for answer
i know that code
that move too next cell by press enter button
but doesnot add new row to gridcontrol
wanna it to add new row when perss enter at last cell in the last row

thanks
reda hashem
egypt



RE reda January 31, 2008 10:18 PM UTC

no body reply



SR Sri Rajan Syncfusion Team January 31, 2008 11:49 PM UTC

Hi reda,

Thank you for your interest in Syncfusion products.

To add new row when perss enter at last cell in the last row, Please refer the below code


Private Sub GridControl1_CurrentCellKeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles GridControl1.CurrentCellKeyDown
If (e.KeyCode = Keys.Enter And Me.GridControl1.CurrentCell.RowIndex = Me.GridControl1.RowCount And Me.GridControl1.CurrentCell.ColIndex = Me.GridControl1.ColCount) Then
Me.GridControl1.RowCount = Me.GridControl1.RowCount + 1
End If
End Sub


Please let me know if this helps.

Regards,
Srirajan



RE reda February 2, 2008 08:43 PM UTC

thank u for answering to me
i really new user for ur tools i used farpoint
for manytimes so may be bored u with my silly questions
that code you wrote working well
but if i hav 3 cols in my gridcontrol and textbox and want this : col3 =(col1)*(col2)
and texbox = total all rows of(cols3) i hope you understand me
dont know how start formula with girdcontrol
with vb2008
thanks
reda hashem




SR SubhaSheela R Syncfusion Team February 4, 2008 08:26 AM UTC

Hi Reda,

Thank you for using Syncfusion products.

You can multiply two cells by using =(A1*B1) in Formula Cell type. Also, you can find the total of column 3 by using =Sum(C1:C9).

Kindly have a look into the sample available in the link below and please let me know if it helps:

http://websamples.syncfusion.com//samples/ Grid.Windows/F71390/main.htm

Regards,
Subhasheela R




RE reda February 4, 2008 07:20 PM UTC

thank you
first i want make Formula by code not by designer i tried but i face troubles if u give sample using code not designer and formula multiply cols when user add rows when pressing inter i mean not limeted rows
second!!!!! want the total of cols all total in TextBox not on the same grid
not on the grid

thank you so much
best wishes for all
=====================

reda hashem



RE reda February 4, 2008 08:45 PM UTC

and when i transfer the that from formula cols for example to textbox that shown
"=(A1*B1)" not the formula number
===============
reda hashem



RE reda February 5, 2008 04:28 PM UTC

pl help if it possible



SR SubhaSheela R Syncfusion Team February 7, 2008 12:23 PM UTC

Hi Reda,

Thank you for using Syncfusion products.

1. You can set the cell type of table as formula using CellType property of the GridControl. Then you can set the formula to that particular cell using Text property.
2. You can get the total of column3 by assigning the that particular cell's value to the Textbox using FormattedText property of the GridControl.
3. You can handle CurrentCellKeyDown event to add new rows by pressing enter by increamenting the rowcount of the GridControl.
Below is the code snippet:


Me.GridControl1.TableStyle.CellType = GridCellTypeName.FormulaCell
Me.GridControl1(1, 3).Text = "=A1*B1"
Me.GridControl1(2, 3).Text = "=A2*B2"
Me.GridControl1(3, 3).Text = "=A3*B3"
Me.GridControl1(4, 3).Text = "=A4*B4"
Me.GridControl1(5, 3).Text = "=A5*B5"
Me.GridControl1(6, 3).Text = "=A6*B6"
Me.GridControl1(7, 3).Text = "=A7*B7"
Me.GridControl1(8, 3).Text = "=A8*B8"
Me.GridControl1(9, 3).Text = "=A9*B9"
Me.GridControl1(10, 3).Text = "=A10*B10"
Me.GridControl1(11, 3).Text = "=Sum(C1:C10)"
Me.TextBox1.Text = Me.GridControl1(11, 3).FormattedText.ToString()
Private Sub GridControl1_CurrentCellKeyDown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles GridControl1.CurrentCellKeyDown
Me.GridControl1.RowCount = (Me.GridControl1.RowCount + 1)
End Sub


Please refer the sample available in the link below and let me know if it helps:

http://websamples.syncfusion.com//samples/Grid.Windows/F71390FollowUp/main.htm

Regards,
Subhasheela R




RE reda February 16, 2008 08:50 PM UTC

thank you for reply
first check for your link
scond i dont know how many RowCount will be on formula
so cant say this:Me.GridControl1(6, 3).Text = "=A6*B6"
i know (a) that col(a) and (b) that col(b)
(6) thats the number row
how can i code the formula with out say
"=A6*B6"
the user maybe add to grid control 2Rows may be add 100 rows
unlimted rows i mean
thank u 4 help


reda



AD Administrator Syncfusion Team February 18, 2008 11:21 AM UTC

Hi Reda,

We regret for the inconvenience caused.

You can give the formula through loop, if rowcount is indefinite. You can achieve it by using the below code snippet:


Do While (i <= count)
Me.GridControl1(i, j).Text = i.ToString
Me.GridControl1(i, j1).Text = i.ToString
Me.GridControl1(i, C).Text = "=(A" & i & "*B" & i & ")"
i = (i + 1)
Loop
Me.GridControl1(i, C).Text = "=Sum(C1:C10)"
Me.TextBox1.Text = Me.GridControl1(i, C).FormattedText.ToString()


Please refer the sample available in the link below and let me know if it helps:


http://websamples.syncfusion.com//samples/Grid.Windows/I71390FollowUp1/main.htm


Regards,
Subhasheela R




Loader.
Live Chat Icon For mobile
Up arrow icon