About datagrid

  • Thread starter Thread starter zhimin
  • Start date Start date
Z

zhimin

Hi
There is a column named IsInUsing which data type is bit in my database(MS
SQL Server 2000). I want to show this column in a datagrid by setting
SqlDataAdapter in GUI design.

But the result of this column shown is true or false, it should shown the
string Yes or No in my idea.

Thanks!
 
zhimin,

In order do to this (assuming you are using the DataGrid in
System.Windows.Forms), you will have to create a class derived from
DataGridColumnStyle which will show Yes or No depending on the value in the
table. Once you have that, you have to add the column to the grid (through
the table styles, then the column styles itself).

Hope this helps.
 
Hi,

As another solution you might utilize Binding.Format event (see .net help
for example).
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top