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

using Grid control for invoice

I want to use Grid control in invoice.Lot of fields are double and integer and currency and want to validate all of them so that no column has value 0(zero) or empty before going to next cell.
I tried to use validating event as suggested on help portal as well as in various example but facing two issues.\
1. if trying to cast cell to gridtextboxrenderer then always remain nothing infact value is there
2. Use another help topic to use controltext property.In this case when i move to next control and value is 0 it does nothing .if i enter some value it it shows empty string.
   when i came back from next cell to previous and changed value then in validation only gets previous value.


Kindly look in to the mater and suggest how to achieve this.

3 Replies

MG Mohanraj Gunasekaran Syncfusion Team September 15, 2017 02:17 PM UTC

Hi Harjinder, 

Thanks for using Syncfusion product. 

Query 
Solution 
 if trying to cast cell to gridtextboxrenderer then always remain nothing infact value is there 
By default, GridCells are having TextBox CellType, so all the cells are defined in GridTextBoxCellRenderer so renderers have assigned based on the CellType. As per your update you are using GridTextBoxCellRender so we have checked the following celltypes, 

·         ButtonEdit 
·         ComboBox, GridListControl (DropDown) 
·         NumericUpDown 
·         LinkLabel 
·         TextBox 
But we are unable to reproduce your scenario. So, please let us know if you are using any other CellTypes in grid, please provide that details. If it is possible, please provide the sample to reproduce your scenario. It will be helpful to provide the solution at the earliest.  
  
Use another help topic to use controltext property.In this case when i move to next control and value is 0 it does nothing .if i enter some value it it shows empty string. 

We can reproduce your scenario with DoubleTextbox CellType. Can you please confirm whether you are using DoubleTextBox CellType or different? It will help us to assist you. 


Regards, 
Mohanraj G 



HS Harjinder Singh September 16, 2017 03:48 PM UTC

Yes I am using Double textbox as well masked date box in  my grid.

For grid there is  no sample/guid

1. stating how i can move to next row from a specific cell.

2. using named columns

3. formula type cell is defined but not working

4. no formula column is defined

Now another problem with masked edit date setting

I cant validate date  in MaskCustomValidate ,it always left I digit and try to validate.So I try to use it in control leave event with DateTime.ParseExact format exception making textbox property to blank if exception occurs,but in this case control text alignment changes to right

here is the code snipt

Try
            Try
                DateTime.ParseExact(Me.txtInvoiceDate.Text, "dd/MM/YYY", System.Globalization.CultureInfo.InvariantCulture)
                Dim userDate As DateTime = Convert.ToDateTime(Me.txtInvoiceDate.Text)
                If (userDate > DateTime.Now) Then
                    Me.txtInvoiceDate.Text = ""
                End If
            Catch ex As FormatException
                Me.txtInvoiceDate.Text = ""
            End Try

        Catch ex As Exception
            Messages.ExceptionMessage(ex)
        End Try

if i disables Me.txtInvoiceDate.Text = "" then textalignment remain left




MG Mohanraj Gunasekaran Syncfusion Team September 18, 2017 12:32 PM UTC

Hi Harjinder, 
 
Thanks for your update. 
 
Query 
Solution 
Yes I am using Double textbox. 
We have created separate incidents for this queries, so please follow up with that incidents using your direct-trac login, 

  
stating how i can move to next row from a specific cell. 
 using named columns 
formula type cell is defined but not working 
 no formula column is defined 
I cant validate date in MaskCustomValidate ,it always left I digit and try to validate.So I try to use it in control leave event with DateTime.ParseExact format exception making textbox property to blank if exception occurs,but in this case control text alignment changes to right 

Regards, 
Mohanraj G 
 


Loader.
Up arrow icon