473,379 Members | 1,167 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,379 software developers and data experts.

Data Formatting Expression

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

Mar 21 '07 #1
2 3716
RitaG wrote:
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
Mar 21 '07 #2
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.

"John B" wrote:
RitaG wrote:
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
Mar 22 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

21
by: Batista, Facundo | last post by:
Here I send it. Suggestions and all kinds of recomendations are more than welcomed. If it all goes ok, it'll be a PEP when I finish writing/modifying the code. Thank you. .. Facundo
1
by: GGerard | last post by:
Hello Is there a way to use a variable in the Conditional Formatting of a Textbox? Example : I want the background of a textbox in a continuous form to change color when the value of...
3
by: J | last post by:
Is there anyway to format a calculated datacolumn? I would like the following column to display as money (formatted as $#,##0.00). Or how about simply displaying the column formatted as a number...
7
by: ilona | last post by:
Hi all, I store phone numbers in the database as 123447775665554(input mask is used for input, and some numbers have extensions), and I also know from db if the number is Canadian, US, or some...
1
by: Dexter | last post by:
Hello all, I have a DataGrid in my Web Application, and it contains a column that i need to format. The data is 03856219000126 and i need to show as 03.856.219/0001-26. Somebody can help me...
4
by: hope | last post by:
Hi, How can I format a string field using Data Formatting Expression property in datagrid? For example: format last name from BROWN to Brown. Thanks
4
by: michael sorens | last post by:
I have successfully bound an XmlDocument to a DataGridView but all fields seem to be strings. I want to retrofit appropriate datatypes on some of the fields. Let me take this in 2 parts. Part...
6
by: Jack | last post by:
Hi there, Given a standard .NET string, does anyone know what the regular expression would be to locate each (optional) formatting item in the string (or more likely does anyone have a link that...
6
by: Tomasz J | last post by:
Hello developers, I bind my TextBox control specyfying a format stored in my application global ApplicationContext object - it has a static string CurrencyFormat property. The problem - this...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.