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.
Unfortunately, activation email could not send to your email. Please try again.

how can i do this

Thread ID:

Created:

Updated:

Platform:

Replies:

71390 Jan 29,2008 11:32 AM Feb 18,2008 06:21 AM Windows Forms 13
loading
Tags: GridControl
reda
Asked On January 29, 2008 11:32 AM

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


reda
Replied On January 29, 2008 11:43 AM

by the way i use vb2008 noot c#



rardis
Replied On January 29, 2008 05:13 PM


>by the way i use vb2008 noot c#




Try This?

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


reda
Replied On January 29, 2008 05:35 PM



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


reda
Replied On January 31, 2008 05:18 PM

no body reply


Sri Rajan [Syncfusion]
Replied On January 31, 2008 06:49 PM

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


reda
Replied On February 2, 2008 03:43 PM

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



SubhaSheela R [Syncfusion]
Replied On February 4, 2008 03:26 AM

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



reda
Replied On February 4, 2008 02:20 PM

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


reda
Replied On February 4, 2008 03:45 PM

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


reda
Replied On February 5, 2008 11:28 AM

pl help if it possible


SubhaSheela R [Syncfusion]
Replied On February 7, 2008 07:23 AM

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



reda
Replied On February 16, 2008 03:50 PM

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


Administrator [Syncfusion]
Replied On February 18, 2008 06:21 AM

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




CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;