i have problem with datagridview need help please
Hi,
i have two tables with this data:
1-Managements
Manag_ID , int
Manag_Name , nvarchar(150)
2-Departments
Dept_ID , int
Dept_Manage_ID , int
Dept_Name , nvarchar(150)
and this my code - Private Sub FillDataGrid()
-
DG.DefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
-
-
DG.ColumnHeadersDefaultCellStyle.Alignment = DataGridViewContentAlignment.MiddleCenter
-
-
WinClass.FillDataGrid(DG, " select * from Departments ")
-
DG.Columns(0).HeaderText = "Dept_ID"
-
DG.Columns(0).Visible = False
-
'DG.Rows(0).Visible = False
-
DG.Columns(1).HeaderText = "Manage of department"
-
DG.Columns(1).AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
-
DG.Columns(2).HeaderText = "Department name"
-
DG.Columns(2).AutoSizeMode = DataGridViewAutoSizeColumnMode.Fill
-
End Sub
-
.................................................
-
Private Sub DG_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles DG.CellClick
-
-
-
If e.RowIndex >= 0 Then
-
TxtID.Text = DG(0, e.RowIndex).Value
-
CboManag_Name.SelectedValue = DG(1, e.RowIndex).Value
-
TxtDept_Name.Text = DG(2, e.RowIndex).Value
-
-
End If
-
-
End Sub
my question is
my datagridview show the manage_name as number
i want the datagridview show data of table manages
like this - Manage of department Deparments
-
1 Mechanical
-
4 Electrical
-
8 Auto
thanks
1 1028
thanx i resolved the problem by myself
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: João Santa Bárbara |
last post by:
Hi all
i have a datatable with 2500 records, and i want to fill a listview,
my problem is that it take too much time to load them all. is anytihing i
could do to
improve my performançe..... ????
it take about 45 seconds with 2500, i need to put at least 10000 in few
seconds ... :(
See my code below perhaps you can help ..
|
by: t_pantel |
last post by:
I 've got the following structure:
typedef struct GROUPED
{
short val ;
short code;
short group;
short forecast_cd;
short double_ind;
short min;
|
by: cpptutor2000 |
last post by:
I am compiling and running the following code snippet on a Linux box -
I am really
puzzled by the answers. Could someone please tell me what might be
wrong?
void test(){
int m = 0;
int n = 0;
int i = 0;
int j = 0;
|
by: steroche |
last post by:
I would REALLY appreciate help please please please! Im sure it is
probably blindingly obvious to most of you but I am totally in the dark
here!I am lost - i thought i had finally figured out this dataSet
updating lark when i realised that i think i am right back at square
1!!!
Here's my scenario - i have a SQLDB and i retrieve all my data from
that into a dataset and display this to a datagrid(WebForm). I have got
this grid sorted and...
|
by: Khamal |
last post by:
Hello...
The quality of reply is quite bad in this forum.....many post has not
reply.... I/We need Microsoft technical team involve directly in this forum
and put some effort to give us HELP. If there is possible to do like borland
team B did in their news group...
Please reply ''YES'' in this thread if you agree with me....
--
:: KHAMAL ::
| |
by: Asif Mohammed |
last post by:
Hello,
I have a databound datagridview, its allowed to add,remove and edit
I type a value in (in new row), it uses e.cancel = true to invalidate the cell .. and does not let focus go away, but when the focus is in the cell (after invalidating) I click anywhere on form (focus still stays in cell) and then press escape .. and the row does not delete itself, it just blanks out.
This is wrong behaviour, as it should delete. (which it does...
|
by: Daemach |
last post by:
OK, it's time to try the experts :)
I've been doing most of my development work in Firefox because of Firebug. Then, when my projects are fully debugged, sleek and refined I load them in IE and I am humbled without fail. This last project was/is especially painful ;)
Please visit this site: IdeaMill: tableFilter
This demo is a couple of months out of date, unfortunately, but it does demonstrate the specific problem I need your help...
|
by: Ahmed Yasser |
last post by:
Hi all,
i have a problem with the datagridview sorting, the problem is a bit complicated so i hope i can describe in the following steps:
1. i have a datagridview with two columns (LoginName,UserName)
2. the datagridview sorting is set to automatic, so when i click on the column header is sorts well.
3. i put in an event handler for the CellEndEdit Event, so whenever the user of the program changes the content of a cell in the LoginName...
|
by: Peter Forman |
last post by:
I have a windows form that contains a datagridview containing
manipulated data from various sources (numerous sql servers + xml
files). I now need to create a report from the data in the
datagridview.
Do I need to convert the datagridview into something else (dataset?)
or should I have put the data into a dataset in the first place.
Assuming I can create a 'Data Source' from my data, can you advise me
on how to launch a report from a...
|
by: Steve K |
last post by:
to this newline when an enter key is detected.
Update: I tried adding this code:
<code>
public PMDDataGridViewTextBoxEditingControl()
:base()
{
this.Multiline = true;
}
</code>
|
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...
| |
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,...
|
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...
|
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,...
|
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...
|
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...
|
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...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |