Showing posts with label Xtragrid. Show all posts
Showing posts with label Xtragrid. Show all posts

How to get data in a selected row of your Xtragrid

There are many alternative ways to get values of cells in a row in your devexpress xtragrid. This tutorial will describe three simple ways to achieve this task by using the following methods:
  • GetRowCellValue()
  • GetDataRow() 
  • GetRow()
In the example, 
  • gv is your gridview's name 
  • colName is your gridview’s column name 

How to create an auto-incremental column in a Devexpress Xtragrid

Very often you would like a column in your Xtragrid to be entered a new value automatically whenever a new row is added to the grid. This column is usually the first column in your grid.  

How to manually validate users’ input in Devexpress Xtragrids

Ingredients:
  • Developer Express 2010 or above
  • An Xtragrid
  • VS 2008
Devexpress Xtragrids can be used for users’ input. In addition to using masks to validate the inputting values entered by users, you can manually check these values by using the following events:
  • Validate single cells - gridview's ValidatingEditor event. Every time the user enter a value into a grid's cell and press tab or left-click to move to another cell in the same row this event will be raised. You will then check what column is focused and validate the user's input value.

How to add thousand and decimal separators for decimal values in Devexpress Xtragrid columns

Ingredients:
  • Developer Express 2010 or above
  • An Xtragrid
  • VS 2008
Steps:
In the design view of your form, locate the grid's column that contains the decimal value. Left-click that column to choose it and press F4 to open the properties window. In the properties window of your selected column locate the DisplayFormat property. Click the plus symbol near the DisplayFormat property to open the containing hidden properties.

How to add a lookupedit editor to a Devexpress Xtragrid’s column

Ingredients:
  • Developer Express 2010 or above
  • An Xtragrid control + Xtragrid view
  • Two database tables: one displayed in the Xtragrid control and one displayed in the look up edit column of the Xtragrid
  • VS 2008 with CSharp as the programming language
Steps:
In the design view of your form, locate the Xtragrid's column that you want to contain the LookUpEdit editor. Left-click that column to choose it and press F4 to open the properties window. In the properties window of your selected column find the ColumnEdit property. You can then assign it a RepositoryItemLookupEdit by clicking the small down arrow icon on the right and choosing New -> LookUpEdit.

How to enable Devexpress XtraGrid cells edit password value with EditMask

Devexpress XtraGrid can be used to for users' inputting. In some cases, you may want an XtraGrid cell to accept a password. This article will describe how to use PasswordChar property to display password characters.

How to make Devexpress XtraGrid cells accept only telephone numbers or decimal numbers with EditMask property

Devexpress XtraGrid can be used to for users' inputting. In some cases, you may want some XtraGrid cells to accept certain types of value. For example, Phone column in the grid managing Customers' information may accept only number value. This article will describe how to set the mask of your Devexpress XtraGrid column so that you do not need to manually handle user input validation.

Blog Archive

About Me

My photo
I am a software developer with roughly 5 years of experience in developing end-to-end solutions in C#, Java, C/C++, PHP and HTML/CSS/Javascript. At the moment, I am joining the Professional Doctorate in Engineering degree program in Software Technology at Eindhoven University of Technology. My areas of particular interest include software design, data structures and algorithms, problem solving, software security, embedded system, machine learning, and data science.