Skip to content

Replies

0
Dimitar
Dimitar answered on Sep 3, 2015 9:01 AM

Hi,

 

Thank you for posting in our forums.

 

You can’t modify the UltraGrid Band’s collection. It is design to mimic the underlying data source, so you cannot delete bands or add new ones. If you can elaborate on the issues you are facing I can try and see if there are other alternatives to solving them, but modifying the bands collection is not possible.

 

I am looking forward to hearing from you.

0
Dimitar
Dimitar answered on Sep 2, 2015 11:37 AM

Hi,

I have used your DataFilter with the sample I have provided and it seems to me that it works fairly well. The only thing I would change is the ConvertValueEditor method the following way:

Public Function ConvertValueToEditor(value As Object) As String

        Dim decimalValue As Decimal

        If value IsNot Nothing AndAlso TypeOf value Is Decimal Then

            decimalValue = DirectCast(value, Decimal)

            Dim returnString = decimalValue.ToString()

            If (returnString.Contains(".")) Then

                Return returnString.TrimEnd("0"c).TrimEnd("."c)

            Else

                Return returnString

            End If

        End If

        Return value.ToString

End Function

The previous version can trim a number like 340.0 to just 34, using two consecutive EndTrims ensures that it won’t happen. Other than that everything seems fine for me.

Please let me know if you have any additional questions.

0
Dimitar
Dimitar answered on Aug 31, 2015 10:15 AM

Hi,

 

Thank you for the reply.

 

After reviewing the code you have provided, it seems to me that it won’t cause issues with the UltraGrid. After testing the modified DataFilter, it seems that it ensures that each value will have at least 14 digits after the decimal point. As I don’t know the bigger picture in your application, I will leave it up to you to decide if this satisfies your goal. However with regards to the UltraGrid it shouldn’t cause any issues.

 

Please let me know if you have any additional questions.

0
Dimitar
Dimitar answered on Aug 25, 2015 9:23 AM

Hi,

 

Thank you for posting in our forums.

 

By default the grid won’t show any trailing zeros when editing even if the column is decimal type. I have attached a small sample project. Notice that when you edit the Price column (which is of type Decimal) no trailing zeros are shown. What settings are applied to the decimal column in your application? Have you specified MaskInput or Format for the column?

 

Please provide me with a sample which reproduces this and I will be glad to research it further. You can use my sample as a starting point.

 

I am looking forward to hearing from you.