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

Datagrid Bind Value update on the fly

Hi

I have a Winforms Datagrid and created myDataView and bind to datagrid.
It works great.

DataGrid1.SetDataBinding(myDataView, "")

Above code line shows me below data in datagrid.

CustomerID CustomerName City
------------------------------------
001 AAA Company NY
002 DDD Company FL
003 CCC Company NY
004 PPP Company FL
------------------------------------

There is a requirement when showing the grid data, I need to show as
below.

CustomerID CustomerName City
------------------------------------
001 AAA Company New York
002 DDD Company Florida
003 CCC Company New York
004 PPP Company Florida
------------------------------------

What I mean is i have to show 'City' datagrid column with 'NY'=New York
and 'FL'=Florida in datagrid

Waiting for your reply.

Thanks in advance

Jul 21 '05 #1
4 1299
Hi
I have a Winforms Datagrid and created myDataView and bind to datagrid.

It works great.
DataGrid1.SetDataBinding(myDat*aView, "")
Above code line shows me below data in datagrid.
CustomerID CustomerName City
------------------------------*------
001 AAA Company NY
002 DDD Company FL
003 CCC Company NY
004 PPP Company FL
------------------------------*------
There is a requirement when showing the grid data, I need to show as
below.
CustomerID CustomerName City
------------------------------*------
001 AAA Company New York
002 DDD Company Florida
003 CCC Company New York
004 PPP Company Florida
------------------------------*------
What I mean is i have to show 'City' datagrid column with 'NY'=New York

and 'FL'=Florida in datagrid
Waiting for your reply.
Thanks in advance

ka***@hotmail.com

Jul 21 '05 #2
I would begin by reading up on validation tables used to enforce
business
rules. Create a table States with a primary key State and a column State
Name.
Enforce a one to many relationship so that Customer table State column
is a
foreign key to the primary key State in the States table. Once you
establish
the proper database design you can generate an SQL query that appears as
you request without fear that a State in the Customer table does not
have a
valid State Name in the States table.

Regards,
Jeff

*** Sent via Developersdex http://www.developersdex.com ***
Jul 21 '05 #3
Hi Jeff

Thanks for your reply. Appreciate it.

I think I have not mention my problem properly. Let me expalin again.

What i have to do is i generate the dataset via sql then bind it to
datagrid so it shows in datagrid.

My problem is when I bind it, It shows 'NY' 'FL' etc. in 'City
Column'

Actually I want a way to update/change text in the datagrid's CITY
column (only) with text 'New York' 'Florida' etc.... and I do not have
a table in my database to actually join two tables.... and also need
to give user an option so that thay can specify 'From Text' (NY) to 'To
Text" (New York) etc. so that they can manage themselves.

Hope this may help you to understand.

Please reply in this post for any query.

Regards

Kakaiya

Jul 21 '05 #4
kakaiya... I just finished working a 12 hour shift and cannot respond
with
much intelligence. I think that you are trying to implement a "lookup"
There
are plenty of examples for a States lookup using a combo box. I just
don't
have the energy to try this for a dataset, but it seems to me you can
manipulate the values in the dataset programmatically and then bind the
dataset to a datagrid.

Regards,
Jeff

*** Sent via Developersdex http://www.developersdex.com ***
Jul 21 '05 #5

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

Similar topics

2
by: Manish | last post by:
Hey folks I am having a weird problem in ASP .Net. My page is in C#. I have a datagrid, which populates based on selection in drop down box on ASP page. This datagrid has template textbox colum in...
3
by: Jim Heavey | last post by:
Trying to figure out the technique which should be used to add rows to a datagrid. I am thinking that I would want an "Add" button on the footer, but I am not quite sure how to do that. Is that...
0
by: mike | last post by:
Hi there: I've read an excellent "how to"-article by Microsoft (no. 306227) - partly cited cited at the end of this email). I have implemented the code related to the part "How to Add a...
0
by: Steve | last post by:
I have a datagrid that is created at run time DataGrid dgG = new DataGrid(); BoundColumn bcB; dgG.CellPadding = 5; dgG.CellSpacing = 0; dgG.GridLines = GridLines.Both; dgG.CssClass =...
3
by: D. Shane Fowlkes | last post by:
I have a Datagrid which in theory, should allow you to edit and update the records. I've stripped my test page down so that it's only attempting to update one field - "description". Yet when I...
5
by: Hennie | last post by:
When trying to update a record in an editable datagrid I ran into a few problems. My update procedure is just not working. Can someone please have a look at my code and see what am I doing wrong....
3
by: Ryan Smith | last post by:
I have a Datagrid that I can't seem to get to work. I can populate the grid from a database but I can't figure out how to update the DB when the user edits a templated column. I have done it...
17
by: A_PK | last post by:
I have problem databinding the DataGrid with DataView/DataSet after the filter... I create the following proceudre in order for user to filter as many as they want, but the following code is only...
0
by: arlie_maija | last post by:
Hey - I'm writing a control that contains a DataGrid, and I'm unable to get the update event to fire. When I click the update link, the edit event fires. heres the details... my control...
13
by: shookim | last post by:
I don't care how one suggests I do it, but I've been searching for days on how to implement this concept. I'm trying to use some kind of grid control (doesn't have to be a grid control, whatever...
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: 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?
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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
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.