Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7966165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T06:21:08+00:00 2026-06-04T06:21:08+00:00

I have a xtragrid with values from a stored procedure. I am getting the

  • 0

I have a xtragrid with values from a stored procedure.
I am getting the values in float (0.23) and I want to display in percent (23%).
What would be the best way to do it in C#?

before
before
after
after

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T06:21:09+00:00Added an answer on June 4, 2026 at 6:21 am

    Use CustomDrawCell event if you just want to display the cell readonly. or You can use the CustomColumnDisplayText Event also.

    Try this:

    private void gridView1_CustomDrawCell(object sender, DevExpress.XtraGrid.Views.Base.RowCellCustomDrawEventArgs e)
                {
                    if (e.Column.FieldName == "Marks")
                    {
                        e.DisplayText = (((int)(Convert.ToDecimal(e.CellValue) * 100))).ToString() + "%";
                    }
                }
    

    Another way use the Editor EditFormat and DisplayFormat property. and after setting these properties add it to the gridview column: Ref: How to format values shown in the XtraGrid

    RepositoryItem textEdit;
            private void AddGridRepositoryItem()
            {
                textEdit = new RepositoryItemTextEdit();
                textEdit.AllowHtmlDraw = DevExpress.Utils.DefaultBoolean.True;
                textEdit.ReadOnly = true;
                gridControl1.RepositoryItems.Add(textEdit);
    
                textEdit.DisplayFormat.FormatType = DevExpress.Utils.FormatType.Numeric;
                textEdit.DisplayFormat.FormatString = "p";
                gridView1.Columns[0].ColumnEdit = textEdit;
    
            }
    

    The simplest way is use GridColumn.DisplayFormat Property.

    colPayment.DisplayFormat.FormatType = FormatType.Numeric;
    colPayment.DisplayFormat.FormatString = "p0";
    

    Hope this help..

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a DevExpress xtraGrid which I want to bind. When I try to
Hy , I have an XtraGrid with AutoFilterRow the default Filter is : Starts
I have a devexpress xtraGrid. One column is editable. When I select the text
I have a grid (DevExpress XtraGrid, if that matters) which is bound to a
i have Devxpress GridControl on the form, and i want to send data on
Have converted devise new session from erb to Haml but doens't work, this is
Have a rather abstract question for you all. I'm looking at getting involved in
I have a XtraGrid with one GridView, with a column with checkbox repository item.
I am using an XtraGrid from DeveloperExpress with a column holding strings, edited via
Have finally got a responsive site working (of a fashion). What I want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.