Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Change Display format in Datagrid control

Posted on 2006-05-03
2
Medium Priority
?
206 Views
Last Modified: 2010-04-23
Hello,

I tried to bind my database with Datagrid control as code below

grdTS.GridColumnStyles.Add(Cs2)
        Dim Cs3 As New DataGridTextBoxColumn
        With Cs3
            .HeaderText = "Mlx Part?"
            .MappingName = "B_IsMxp"
            .ReadOnly = True
            .Width = 30
        End With

In database B_IsMxp is boolean data type and when it's displayed, it can be only -false- or -True-

Can we change display format to be -Y- for true and -N- for false and blank for null value ?

Thanks and Regards
0
Comment
Question by:mpitak
2 Comments
 
LVL 5

Accepted Solution

by:
tsay earned 60 total points
ID: 16594993
You can use the NullText property to define what should be displayed if the value is null in the database. In your example this would be

grdTS.GridColumnStyles.Add(Cs2)
        Dim Cs3 As New DataGridTextBoxColumn
        With Cs3
            .HeaderText = "Mlx Part?"
            .MappingName = "B_IsMxp"
            .ReadOnly = True
            .Width = 30
            .NullText = ""
        End With

I'll look into formatting the boolean value
0
 
LVL 96

Assisted Solution

by:Bob Learned
Bob Learned earned 90 total points
ID: 16595137
Why don't you use a DataGridBoolColumn, and have a check box.

Bob
0

Featured Post

Upgrade your Question Security!

Add Premium security features to your question to ensure its privacy or anonymity. Learn more about your ability to control Question Security today.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month20 days, 17 hours left to enroll

810 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question