Data Formatting Expression

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello.

I could not find a Web discussion group (only saw Web Services) so am
posting my question here. I have a C# Web application that has a form with a
datagrid. One of the columns of the data grid is filled with a column from a
table that is varChar(500). I only want to display the first 50 character of
that column. I want to be able to use the "Data Formatting Expression" in the
datagrid columns property page.

I could only find formatting examples for dates, numerics and currency.
Is there a formatting expression I can use for my needs?

TIA.

Rita
 
RitaG said:
Hello.

I could not find a Web discussion group (only saw Web Services) so am
posting my question here. I have a C# Web application that has a form with a
datagrid. One of the columns of the data grid is filled with a column from a
table that is varChar(500). I only want to display the first 50 character of
that column. I want to be able to use the "Data Formatting Expression" in the
datagrid columns property page.

I could only find formatting examples for dates, numerics and currency.
Is there a formatting expression I can use for my needs?

TIA.

Rita
You cannot do that with format strings AFAIK.
The DataGridView (2.0) has a MaxInputLength property for the column
though so that might help.
Otherwise you can only select the first 50 chars.

JB
 
Thanks John, I didn't think so but wanted to confirm.

I'll land up using MyFormat(DataBinder.Eval(Container.Dataitem,
"MyColumn")) since the Stored Procedure that gets the data is used in several
different places, some of which require the whole column.

We're not on (2.0) yet.
 

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