473,659 Members | 2,651 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Datagrid headaches

Hi Al

I have two questions about a datagrid, I need to decide which way to go....

I have a datagrid that will show me all the entries in a table. When I click on any cell(actually I would prefer if It could rather select the whole row, where ever I click), I want the data in that datagrid to populate the corresponding textbaoxes on my form, so that the user can edit the values and save them back to the database, and the update the datagrid. How do I do this

Otherwise, what I would like to do is to cut out the populating of the corresponding textboxes and just have the datagrid here I could edit and add new rows, but there are some columns that are lookup columns eg, I have a Manufaturers table, that holds all the possible manufacturers, and a ManufacturersDe tail table that holds all the possible contacts for that Manufacturer, So I want to be able to select the manufacturer, then it must filter the possible contacts, but I don't know first of all how to implement the lookup functionality in the datagrid, or the filtering of one field based on the selection of
another field within a datagrid! I have no idea about how to do this. This would definitly be 1st prize, Please can somebody help me, I'm really stuck on this one.And obviously the data stored for the manufacturer/manufacturerDet ails are numbers not the actaul description, so I need to store the number but display the description for the manufacturers and manufaturersdet ail

Please I need help on this problem desparatly

Thanks soooo much in advanc

Kevin
Nov 15 '05 #1
5 1342
Cor
Hi Kevin,

The datagrid itselfs holds no data, so you have to look to the underlaying
datasource.

That is mostly a datatable as part of a dataset.

When you use a currencymanager to keep track of the current active row in
the datagrid, and also look at datbinding from the textboxes and to the
dataview and its rowfilter, I think you are halfway to your solution,

I hope this helps?

Cor
I have two questions about a datagrid, I need to decide which way to go.....
I have a datagrid that will show me all the entries in a table. When I click on any cell(actually I would prefer if It could rather select the
whole row, where ever I click), I want the data in that datagrid to populate
the corresponding textbaoxes on my form, so that the user can edit the
values and save them back to the database, and the update the datagrid. How
do I do this?
Otherwise, what I would like to do is to cut out the populating of the corresponding textboxes and just have the datagrid here I could edit and add
new rows, but there are some columns that are lookup columns eg, I have a
Manufaturers table, that holds all the possible manufacturers, and a
ManufacturersDe tail table that holds all the possible contacts for that
Manufacturer, So I want to be able to select the manufacturer, then it must
filter the possible contacts, but I don't know first of all how to implement
the lookup functionality in the datagrid, or the filtering of one field
based on the selection of another field within a datagrid! I have no idea about how to do this. This would definitly be 1st prize, Please can somebody help me, I'm really stuck
on this one.And obviously the data stored for the
manufacturer/manufacturerDet ails are numbers not the actaul description, so
I need to store the number but display the description for the manufacturers
and manufaturersdet ail.
Please I need help on this problem desparatly!

Thanks soooo much in advance

Kevin

Nov 15 '05 #2
But is there no way I can do all this in the datagrid itself? I would really like to stp away from the textboxes and try to doo all the stuff in the datagris, like adding, updating and deleting records. But my biggest problem is creating a combobox field and filtering one combobox filed based on another combobox's selection. I need to know how to do this, if there is now way I suppose I'll have to settle for the textboxe idea... :(

Kevin
Nov 15 '05 #3
Cor
Hi Kevin,

A lot of approaches, one approach is to make a simple select of manufacurers
and let that dataset be the source for the datasource from a combobox.

With that datasource you choose the manufacturer and do a new select from
the contacts that builds a new dataset of the contacts that is the
datasource of your grid.

Than one button to save the dataset, one button to delete a row from the
dataset, and one button to reset the dataset from it status at the select.

Try to make a simple solution as this first, it is that difficult and you
have your sample.

Cor
But is there no way I can do all this in the datagrid itself? I would really like to stp away from the textboxes and try to doo all the stuff in
the datagris, like adding, updating and deleting records. But my biggest
problem is creating a combobox field and filtering one combobox filed based
on another combobox's selection. I need to know how to do this, if there is
now way I suppose I'll have to settle for the textboxe idea... :((
Kevin

Nov 15 '05 #4
Hi Co

Sorry for the late repl

When I was talking about the combobox, i meant a combobox inside a datagrid, not the native combobox that you put onto a form. I want to know how to make a cell in my datagrid a combobox,and upon the selection of that combo box filter the possible values of another combobox in another datagrid cell- is this even possible

Thanks for your help so far

Kevin
Nov 15 '05 #5
Cor
Hi Kevin,

Have a look at this one.

<http://dotnet.leadit.b e/extendeddatagri d>

Cor

Sorry for the late reply

When I was talking about the combobox, i meant a combobox inside a datagrid, not the native combobox that you put onto a form. I want to know
how to make a cell in my datagrid a combobox,and upon the selection of that
combo box filter the possible values of another combobox in another datagrid
cell- is this even possible?
Thanks for your help so far.

Kevin

Nov 15 '05 #6

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

Similar topics

8
7904
by: Ashish Shridharan | last post by:
Hi All I have been trying to add a control to the header cell of a datagrid on my ASP.NET page. These controls are defined in the HTML as ASP.NET web controls. They are being added into the header of the datagrid in the "ItemDataBound" method of the grid. However, once, they are added in the grid, i seem to lose the event handler for the same control. Is there anyone who has tried this before and knows why this is hapenning ??
6
18281
by: Shivang | last post by:
Hello Everybody, I am using Datagrid in VB.net. I don't want the auto generation of rows in the datagrid (last row shouldnt be the new row with empty values)..in addition to this the datagrid should not be readonly..that is I should be allowed to edit the values in datagrid. You help will be appreciated.
5
1346
by: darrel | last post by:
I'm new to ASP in general. Have been doing a bunch of stuff using classic ASP and a bit of stuff with ASP.NET (all with VBscript). The .NET stuff i've been doing has been fairly simple...generating a report from an Access table. The Datagrid along with some TemplateColumns seemed to work well for that. I'm not needing to now pull data from our Homemade CMS database to present on our public site.
1
4314
by: Rick | last post by:
Hello all, I hope all is well with you. I am having a seriously difficult time with this problem. Allow me to set up the problem. I have a System.Web.UI.Page with the following controls (watch the layout, some have child controls):
1
2397
by: Andrea Williams | last post by:
I'm trying to bind to a Template Item that I created and fill the dropdown with a value from the datagrid DataSet. However, if the value is "", then I want to Insert a "" option to the list. I'm trying to do this as the binding takes place, but it's not working. The extra option is not added. Any advice? The goal: do in-line editing inside the datagrid without adding code to the ASPX page. I want it all in the code behind. It's got...
2
6398
by: CSL | last post by:
I am using the DataGrid in a Windows Application, how can I adjust the widths of each column individually.
2
1227
by: Meir Rotfleisch | last post by:
HI Newbie to Dot Net with lots of headaches!!! I am trying to do the following 2 things with the Datagrid and can't find the methods... 1) Change Column Widths and Visibility 2) When Clicking on a cell have the entire row get selected..
4
1663
by: jaYPee | last post by:
anyone know how can i save record from datagrid back to sql server using datacommand? im trying to use dataset but no luck. the source has a join table and when i use the dataadapter wizard it says in the update statement and delete statement that "Could not determine which columns uniquely identify..." now i read from msdn that a datacommand can update directly to the database and i want to know how can i save record from datagrid. ...
5
1288
TheServant
by: TheServant | last post by:
Hey guys, I am trying to generate a table automatically, but I am having headaches using foreach loops: $raw_user_rankings = mysql_query("SELECT user_id, user_name, user_clan_id, user_pop, user_race FROM users LIMIT 120, 30 "); $user_rankings = mysql_fetch_array($raw_user_rankings);
0
8339
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8535
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8629
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7360
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5650
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4176
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2757
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1982
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1739
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.