473,837 Members | 1,436 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 3070
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********@dis cussions.micros oft.com> wrote in message
news:D3******** *************** ***********@mic rosoft.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********@dis cussions.micros oft.com> wrote in message
news:D3******** *************** ***********@mic rosoft.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********@dis cussions.micros oft.com> wrote in message
news:F8******** *************** ***********@mic rosoft.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********@dis cussions.micros oft.com> wrote in message
news:D3******** *************** ***********@mic rosoft.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********@dis cussions.micros oft.com> wrote in message
news:F8******** *************** ***********@mic rosoft.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********@dis cussions.micros oft.com> wrote in message
news:D3******** *************** ***********@mic rosoft.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
3011
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 added to the data grid. My current code is coming up with errors, dt and drv are unknown in the else part of the if statement. if (this.dgPrivileges.DataSource == null) {
0
1628
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 doesn't stay on the cell after selected almost as if the combobox is on top of the cell and after u select an item and click next cell or column the select dissapear? ================================================= //this part pulls from db and puts...
3
3010
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, System.EventArgs e) {try{ DataSet ds = dgMembers.DataSource as DataSet;
4
1542
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 from that category. For instance: say the first combo has in it: meat dairy
4
301
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
3772
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 corresponding to permissions to certain data classes. I want to put the permission values in combo boxes in the grid and instead of displaying the numeric values, have the combo box display a string that corresponds to the numeric value (i.e. No...
3
4282
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. Assistance would be greatly appreciated! I am trying to allow certain users to be able to preview a database's contents without being able to update which I've accomplished. I've created a "Preview" button and set the datagrid to READ ONLY. Now I want...
0
1043
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 the value of a cell, based on a combo box selection. For example, in a timesheet data entry, we want to enter what type of leave the person may have had. eg, sick leave, annual leave etc.
2
1631
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 data entry screen. The existing Access app writes to a table (tblTimesheetHours). In the data entry screen, the fields, like employee name, job, etc are bound to combo
7
1856
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 in a different dataset. One combo box is displaying the Employees payroll ID. The other is
0
9839
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10871
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10564
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10621
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
10268
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
9396
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...
1
7806
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5668
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
4474
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

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.