473,385 Members | 1,642 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,385 software developers and data experts.

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 ManufacturersDetail 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/manufacturerDetails are numbers not the actaul description, so I need to store the number but display the description for the manufacturers and manufaturersdetail

Please I need help on this problem desparatly

Thanks soooo much in advanc

Kevin
Nov 15 '05 #1
5 1326
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
ManufacturersDetail 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/manufacturerDetails are numbers not the actaul description, so
I need to store the number but display the description for the manufacturers
and manufaturersdetail.
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.be/extendeddatagrid>

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
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...
6
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...
5
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...
1
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...
1
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...
2
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
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...
4
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...
5
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,...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
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: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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
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...

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.