Sometimes we require to show a two line display in a grid cell. This usually happens when we have columns like OrderNo and Order Code and we want to display both in one cell. It is also a useful practice when we have too many columns and we want to display all the details. So the values can be shown using a line seperator in the cell.

This can be achieved using ” InitializeRow” event. This event is fired for every row. So we can set the details here like this:

Visual Basic .NET Code:

e.row.cells.fromKey(“OrderNo”).Text=e.row.cells.fromKey(“OrderNo”).Text +”
” + e.row.cells.fromKey(“OrderCode”).Text

or
e.row.cells.fromKey(“OrderNo”).Text=e.row.cells.fromKey(“OrderNo”).Text +ControlChars.crlf + e.row.cells.fromKey(“OrderCode”).Text

The fromkey collection can be used or you can also use the cell index to find the appropriate cell. Offcourse, you have to hide OrderCode column in the “InitializeLayout” event.

~Sandeep

Thoughts on Life, Events and Current Happenings
Sandeep Joshi
Enterprise agility ✔ Engineering Excellence ✔ DevOps ✔ Data Science, IOT, RPA and Cognitive
An accomplished agile leader with a successful track record for building high growth engineering organizations, transforming traditional teams to be agile and scaling operations.

A change leader with rich experience in defining enterprise vision, strategy in alignment with business roadmap, articulating to “C” level executives, and taking charge for end to end delivery (inception to design to deploy and support).

Known for delivery excellence, product focus and technical leadership. An enterprise products guy who enjoys putting disruptive technology and tools to transform legacy teams.

Interests

IT Directions | Strategy | Innovation | Design thinking
Agile transformations | Coaching | Scaling
DevOps | Continuous delivery | Application Lifecycle
Lean Product Management | Program Management
IT Leadership | Strategy | Innovation | Mentoring
High Scale Enterprise Architecture | API Development
Cloud Computing (Azure, AWS, Private Cloud)
Containers | Microservices | Test Automation
Data Analytics | Machine Learning | Cognitive
Audit, Compliance and Data Privacy (SOX, PCI)

Share this:

Leave a Reply

Your email address will not be published. Required fields are marked *