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

asp.net combo in datagrid

Hi All

I Have a datagrid on asp.net.
i need to add a combo box column that chages it's data
according to a spefiiec row in a datagrid.
Please help me ??

Thnaks
Ziv Riezman
Nov 18 '05 #1
4 3040
Ziv,

You can use template columns to have a column with a combobox. And you can
use ItemDataBound event to populate the combobox with the data from the row.

Eliyahu

"Ziv Riezman" <Zi********@discussions.microsoft.com> wrote in message
news:D3**********************************@microsof t.com...
Hi All

I Have a datagrid on asp.net.
i need to add a combo box column that chages it's data
according to a spefiiec row in a datagrid.
Please help me ??

Thnaks
Ziv Riezman

Nov 18 '05 #2
Hi

Thanks for the replay, can you be more specific about your answer, I'm using the combo in a template column, and setting the data source to a function on the asp page, how can this function know which row currently being updated ?
Or if using your solution please give some more information,

Thnaks in advnace
"Eliyahu Goldin" wrote:
Ziv,

You can use template columns to have a column with a combobox. And you can
use ItemDataBound event to populate the combobox with the data from the row.

Eliyahu

"Ziv Riezman" <Zi********@discussions.microsoft.com> wrote in message
news:D3**********************************@microsof t.com...
Hi All

I Have a datagrid on asp.net.
i need to add a combo box column that chages it's data
according to a spefiiec row in a datagrid.
Please help me ??

Thnaks
Ziv Riezman


Nov 18 '05 #3
Ziv,

Looks like you are almost on the right track. What are you using as a
combobox? A DropDownList? What DataSource are you setting to a function?

In any case, I don't think you can databind the control you are using as a
combo, since you want to populate it from a datagrid row and not from any
separate data source. I think you can achieve what you want much easier in
ItemDataBound event. The event gets a parameter that contains a reference
to the datagrid item that is being databound. You should filter out the
header, the footer and process only data items. Data item is a data row from
your table. It contains a collection of cells. So, you have access to all
the cells on the current row. You can populate the combo control out of the
cell values.

Eliyahu

"Ziv Riezman" <Zi********@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
Hi

Thanks for the replay, can you be more specific about your answer, I'm using the combo in a template column, and setting the data source to a
function on the asp page, how can this function know which row currently
being updated ? Or if using your solution please give some more information,

Thnaks in advnace
"Eliyahu Goldin" wrote:
Ziv,

You can use template columns to have a column with a combobox. And you can use ItemDataBound event to populate the combobox with the data from the row.
Eliyahu

"Ziv Riezman" <Zi********@discussions.microsoft.com> wrote in message
news:D3**********************************@microsof t.com...
Hi All

I Have a datagrid on asp.net.
i need to add a combo box column that chages it's data
according to a spefiiec row in a datagrid.
Please help me ??

Thnaks
Ziv Riezman


Nov 18 '05 #4
Hi Again

First I'm using a dropdownlist, second the dropdownlist should be populated every row with different datasource depanding on value stored in the current row in a different column for example DB_Grip has column A and column B (DropDownList)
Column B on every row should have different values depending on the value in Column A

Thanks for the help
Thnaks for the help

"Eliyahu Goldin" wrote:
Ziv,

Looks like you are almost on the right track. What are you using as a
combobox? A DropDownList? What DataSource are you setting to a function?

In any case, I don't think you can databind the control you are using as a
combo, since you want to populate it from a datagrid row and not from any
separate data source. I think you can achieve what you want much easier in
ItemDataBound event. The event gets a parameter that contains a reference
to the datagrid item that is being databound. You should filter out the
header, the footer and process only data items. Data item is a data row from
your table. It contains a collection of cells. So, you have access to all
the cells on the current row. You can populate the combo control out of the
cell values.

Eliyahu

"Ziv Riezman" <Zi********@discussions.microsoft.com> wrote in message
news:F8**********************************@microsof t.com...
Hi

Thanks for the replay, can you be more specific about your answer, I'm

using the combo in a template column, and setting the data source to a
function on the asp page, how can this function know which row currently
being updated ?
Or if using your solution please give some more information,

Thnaks in advnace
"Eliyahu Goldin" wrote:
Ziv,

You can use template columns to have a column with a combobox. And you can use ItemDataBound event to populate the combobox with the data from the row.
Eliyahu

"Ziv Riezman" <Zi********@discussions.microsoft.com> wrote in message
news:D3**********************************@microsof t.com...
> Hi All
>
> I Have a datagrid on asp.net.
> i need to add a combo box column that chages it's data
> according to a spefiiec row in a datagrid.
> Please help me ??
>
> Thnaks
> Ziv Riezman


Nov 18 '05 #5

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

Similar topics

4
by: Mike L | last post by:
I'm open for any suggestions on how to better program this. I want the user to select a license from a combo box, cboPrivilege and then the user will click the add button, then a record will be...
0
by: JL3574 l | last post by:
i have a datagrid with a combo box added in it's columns . the combobox pulls values from a database in it's dropdownlist fashion. my problem is that when i pick a select on the combo box it...
3
by: Doug | last post by:
Hi I have the following code (not mine) that populates a datagrid with some file names. But I want to replace the datagrid with a combo box. private void OnCurrentDataCellChanged(object sender,...
4
by: Steve Chatham | last post by:
I have a page where I have some combo boxes on it. A click on each one spawns another box, and another until each area has been selected, or until they choose to pull all items into a datagrid...
4
by: Ziv Riezman | last post by:
Hi All I Have a datagrid on asp.net. i need to add a combo box column that chages it's data according to a spefiiec row in a datagrid. Please help me ?? Thnaks Ziv Riezman
6
by: Ron L | last post by:
I have a dataset whose source is a SQL 2k stored procedure that I am trying to display in a datagrid. This datasource has 4 columns that I am interested in here, a text column and 3 value columns...
3
by: Frustrated Developer via DotNetMonster.com | last post by:
I have posted a couple times on here already and found the user community to be very helpful. I took on a project before I realized how difficult a time I'm having working with a database....
0
by: Ausclad | last post by:
Hi all, I have a datagrid, which is bound to a datatable. In the datagrid, I have changed some of the fields to be combo boxes. In the datagrid I want to be able to allow the user to change...
2
by: Ausclad | last post by:
How Would you implement this? I have an existing Access application that needs to be converted to .net I am restricted to use the existing database design. One of the areas is a timesheet...
7
by: Ausclad | last post by:
Ok, ill try again..... It seems fairly simple. I have two combo boxes in a datagrid. The datagrid is bound to a a table in a dataset. The two combo boxes are bound to a single data table...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.