473,398 Members | 2,125 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,398 software developers and data experts.

changing display of the datagrid cell value

Hi all,

I have a datagrid (language C#) populated using a stored procedure. I
want one of the column to display complete name instead of
abbreviation. Can I change the display dynamically in the datagrid or
should I change it in stored procedure?

Aug 23 '06 #1
2 3117
Well... in terms of abstraction I would leave the grid to worry about
displaying the "display" value as UI concerns in the data layer are always a
little minging.

To answer the problem it depends if you are talking about the column header
(which I believe you are), if so, check out the DataGridTableStyle class you
can create one and bung it in the DataGrid.TableStyles collection, with this
you can add DataGridTextBoxColumns (or BoolColumns) which have a
..MappingName and HeaderText property, which map to the data value (e.g the
value in your stored proc) and display in the UI respectively.
The style has a mapping name too which will probably be the table name in
your case but is the name of the collection type if binding collections.

To edit a specific value of a cell in a grid requires: DataGrid[0,0] = "I'm
the first cell".

"harry" <ha*****************@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Hi all,

I have a datagrid (language C#) populated using a stored procedure. I
want one of the column to display complete name instead of
abbreviation. Can I change the display dynamically in the datagrid or
should I change it in stored procedure?

Aug 23 '06 #2
Thank You
Simon Tamman wrote:
Well... in terms of abstraction I would leave the grid to worry about
displaying the "display" value as UI concerns in the data layer are always a
little minging.

To answer the problem it depends if you are talking about the column header
(which I believe you are), if so, check out the DataGridTableStyle class you
can create one and bung it in the DataGrid.TableStyles collection, with this
you can add DataGridTextBoxColumns (or BoolColumns) which have a
.MappingName and HeaderText property, which map to the data value (e.g the
value in your stored proc) and display in the UI respectively.
The style has a mapping name too which will probably be the table name in
your case but is the name of the collection type if binding collections.

To edit a specific value of a cell in a grid requires: DataGrid[0,0] = "I'm
the first cell".

"harry" <ha*****************@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.com...
Hi all,

I have a datagrid (language C#) populated using a stored procedure. I
want one of the column to display complete name instead of
abbreviation. Can I change the display dynamically in the datagrid or
should I change it in stored procedure?
Aug 24 '06 #3

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

Similar topics

1
by: Shawn Benson | last post by:
I have a Windows form where a user enters an order number which returns a dataset that is bound to a datagrid. The problem is when a user clicks on a cell in the datagrid, then enters another...
2
by: Daniel Walzenbach | last post by:
Hi, I created an ASP.NET Datagrid where a single row can be selected by clicking anywhere on the row (according to...
4
by: Suzanne | last post by:
Hi all, I'm having problems with datagrids and the currentcellchanged event. My problem is this: I have a datagrid on a form, if the user changes the text in a cell on the datagrid then tries to...
3
by: Mad Scientist Jr | last post by:
Can someone post a clear example of how to change the background color of an individual datagrid cell for a Windows desktop app? (preferably in vb.net) I found some code on how to do this when...
4
by: tg | last post by:
Visual Studio 2003 My problem is that I am dynamically creating a datagrid on pageload. The datagrid is completely dynamic as it is based on the number of columns returned from a recordset. The...
3
by: Maria Anthonsen | last post by:
I'm using HitTest to get a value from the cells into a textbox. I have put the HitTest code into the MouseDown-event, and everything is working except one thing. When I start the program the value...
10
by: JohnR | last post by:
I have a datatable as the datasource to a datagrid. The datagrid has a datagridtablestyle defined. I use the datagridtablestyle to change the order of the columns (so they can be different than...
3
by: JJ | last post by:
I have a datagrid on my form that displays its data from various tables within a specified dataset. That all works correclty. However, when one cell is selected prior to changed the displayed...
0
by: Mythran | last post by:
I have seen many examples on the Internet that do the following to format data being bound to a DataGrid....IMO, it's sick.. Public Sub MyGrid_ItemDataBound( ... ) Dim value As String =...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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?
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.