This is a migrated thread and some comments may be shown as answers.

Set display mask of data in GridBoundColumn

3 Answers 279 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Dale
Top achievements
Rank 1
Dale asked on 16 Dec 2015, 09:07 PM

Hi, thanks for looking at my question.

I am wanting to display numeric data that is retrieved to the RadGrid - GridBoundColumn with dashes inserted.  Currently the column shows a 15 digit number, what I want to do is break up the number with dashes related to how we use the number in our system.

I have worked with RadMaskedTextBoxes so I am familiar with setting the mask and the display mask for the inclusion of dashes.

From what I understand I can use GridMaskedColumn, but that will only show the dashes in edit mode.  As I am doing no editing, I just want it to display the data in the grid column with the dashes inserted.

 

Thank you for your time, Dale

 

 

 

 

3 Answers, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 21 Dec 2015, 01:30 PM
Hi Dale,

Generally, you can use the following approach to separate the numbers with commas in the US culture:
<telerik:GridNumericColumn DataField="Freight" DataType="System.Decimal"
    FilterControlAltText="Filter Freight column" HeaderText="Freight"
    SortExpression="Freight" UniqueName="Freight" DataFormatString="{0:N}">
</telerik:GridNumericColumn>

If you want hyphens, you can try: DataFormatString="{0:###-###-###.##}"
http://msdn.microsoft.com/en-us/library/dwhawy9k%28v=vs.110%29.aspx
http://msdn.microsoft.com/en-us/library/0c899ak8%28v=vs.110%29.aspx


I hope this will prove helpful.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Dale
Top achievements
Rank 1
answered on 28 Dec 2015, 07:58 PM

Thanks for the reply, I am sorry but I was not clear in my question.  The number is a string, not a numeric, I should of clarified that.  I did work with GridMaskedColumn that does set the mask while in edit mode.

What I am wanting to do to select a set of records and display specific columns in the radgrid, then the user will select the row/record that they want to view from the radgrid.  As one of the columns is the 15 digit number (string) I want to show it with dashes inserted

 

Thanks again, Dale,

0
Eyup
Telerik team
answered on 30 Dec 2015, 01:54 PM
Hello Dale,

In this case, please prepare a new very basic runnable web site to isolate the grid and open a formal support thread to send it to us.

Regards,
Eyup
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
Dale
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Dale
Top achievements
Rank 1
Share this question
or