|
hi all,
i have a few textboxes and a datagridview.
SelectionMode is 'FullRowSelect'. when the selected row changes, i want to change the textboxes.texts to change according to the data in datagridview.
i have a code like this :
txtKullanici.Text = dataGridView3.Rows[dataGridView3.SelectedRows.Count -1 ].Cells[0].Value.ToString();
txtSifre.Text = dataGridView3.Rows[dataGridView3.SelectedRows.Count -1 ].Cells[1].Value.ToString();
txtSifreT.Text = txtSifre.Text;
cmbYetkiS.Text = dataGridView3.Rows[dataGridView3.SelectedRows.Count -1].Cells[2].Value.ToString();
in which event should i put these codes ?
help please,
thanks in advance.
|
|
|
|
|
Never worked with DataGridView , but after a quick glance at the docs I would say SelectionChanged sounds suitable.
"Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning." - Rick Cook
www.troschuetz.de
|
|
|
|
|
Try this:
private void DataGridView1_RowEnter(object sender, DataGridViewCellEventArgs e)
{
if(DataGridView1.CurrentRow != null)
textbox1.Text = DataGridView1.Rows[e.RowIndex].Cells[0].Value.ToString();
}
Regards.
Success is not something to wait for, its something to work for.
|
|
|
|
|
Hello all,
I have been call all methods of dll by DllImport[]. But how to call constructor of structure from C#.
Divyang Mithaiwala
|
|
|
|
|
See this : http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmxspec/html/vcmg_accessingcodefromframeworkobjects.asp
First : you must write a code in Managed C++ to wrap your Unmanaged C++ code.
Second : Use your Managed C++ Classes in your C# Code.
|
|
|
|
|
smile because it happened.
my qq:759508
smile because it happened.
|
|
|
|
|
|
how to insert values from controls to different interrelated tables in database
-- modified at 3:28 Tuesday 6th June, 2006
|
|
|
|
|
The best way is to write a stored procedure and call it with the values from your controls.
What's the database ? Have you looked on the site for examples ( in the articles section ) ? What about msdn ? You can use google to search msdn by putting site:msdn.microsoft.com at the end
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
plz give JavaScript tutorial.
|
|
|
|
|
foysal mamun wrote: plz give JavaScript tutorial
visit:
http://www.w3schools.com/js/[^]
You might better to join Web Development forum.
Best Regards.
Success is not something to wait for, its something to work for.
|
|
|
|
|
please post in the right forum
please dont ask 1 line questions
please dont use SMSSPK
Current blacklist
svmilky - Extremely rude | FeRtoll - Rude personal emails | ironstrike1 - Rude & Obnoxious behaviour
|
|
|
|
|
Hello!
I have the code below, but I really don´t know how to make it work in C#.
"Type" in C# is like "struct" ??
Should I use "ref BrouseInfo lpbi" in order to refer to my "struct" or "Type" in the SHBrowseForFolder calling and/or declaration???
Const BIF_RETURNONLYFSDIRS = 1
Const BIF_DONTGOBELOWDOMAIN = 2
Const MAX_PATH = 260
Private Declare Function SHBrowseForFolder Lib "shell32" ( _
lpbi As BrowseInfo) As Long
Private Declare Function SHGetPathFromIDList Lib "shell32" ( _
ByVal pidList As Long, _
ByVal lpBuffer As String) As Long
Private Declare Function lstrcat Lib "kernel32" Alias "lstrcatA" ( _
ByVal lpString1 As String, _
ByVal lpString2 As String ) As Long
'Tipo para def
Private Type BrowseInfo
hWndOwner As Long
pIDLRoot As Long
pszDisplayName As Long
lpszTitle As Long
ulFlags As Long
lpfnCallback As Long
lParam As Long
iImage As Long
End Type
nextcode :
Private Sub cmdSearchFolder_Click()
Dim lpIDList As Long
Dim sBuffer As String
Dim szTitle As String
Dim tBrowseInfo As BrowseInfo
'Personaliza a procura
szTitle = "Type the source folder for the search : "
With tBrowseInfo
.hWndOwner = Me.hWnd
.lpszTitle = lstrcat(szTitle, "")
.ulFlags = BIF_RETURNONLYFSDIRS + BIF_DONTGOBELOWDOMAIN
End With
lpIDList = SHBrowseForFolder(tBrowseInfo)
If (lpIDList) Then
sBuffer = Space(MAX_PATH)
SHGetPathFromIDList lpIDList, sBuffer
sBuffer = Left(sBuffer, InStr(sBuffer, vbNullChar) - 1)
'This is the Textbox
txtFolder.Text = sBuffer
End If
End Sub
|
|
|
|
|
Use System.Windows.Forms.FolderBrowserDialog
or see this article : http://www.codeproject.com/useritems/SHBrowseForFolder_in_NET.asp
|
|
|
|
|
|
Hi there,
On a article posted related to Treelistview control(http://www.codeproject.com/cs/miscctrl/treelistview.asp) .In this example if i enable the checkbox property, all Items in this control display checkbox near to them .
How can i customise this control so that only last leaf node or any particular node display the checkboxes all other nodes will not display the checkboxes.
can some one send me example so get the same functionality
Regard
Anilesh
Anilesh Singh Lakhtakia..........................................................................................................................................................................................................................
-- modified at 6:56 Tuesday 13th June, 2006
|
|
|
|
|
Create User and then Create Role and give different role for different user using C# as front end or UI and for SQLServer
|
|
|
|
|
You want what ? To create a user and a role using code ?
Christian Graus - Microsoft MVP - C++
|
|
|
|
|
Hi..
How could i make the installation (for my setup project) starts automatically when the user insert the CD that includs it(without open the CDROM directory)?
I am too late but i will never give up
|
|
|
|
|
Just add a file autorun.inf in your CD root directory.
For example : if your setup file is setup.exe, just add these line to your autorun.inf:
open=setup.exe
|
|
|
|
|
Hi,
I want to clone a compound object by MemoryStream.
I wrote the code in the following.
<code>
public object CloneAnObject(object objectToClone)
{
MemoryStream readStream = new MemoryStream();
BinaryFormatter binaryFormatter = new BinaryFormatter();
binaryFormatter.Serialize(readStream, objectToClone);
MemoryStream writeStream = new MemoryStream(readStream.GetBuffer());
return binaryFormatter.Deserialize(writeStream);
close(readStream);
close(wroteStream);
}
</code>
The code usually works well, but sometimes an IOException occurs.
In the help of MemoryStream.GetBuffer(), it seems the memoryStream should be closed before GetBuffer() is executed.
Thank you!
|
|
|
|
|
I want to know how long a particular function in my program takes to run. How can I get the number of milliseconds between two DateTime objects? Or is there a better way to do this?
|
|
|
|
|
I'm no .net expert so I can only give you the Win32 way.
Use QueryPerformanceCounter() and QueryPerformanceFrequency()
Very high resolution timer, I used it all the time when doing game development on Win32. Milliseconds aren't really good enough for this sort of timing btw.
|
|
|
|
|
try this (C#)..
double totalMillisecs = (dt2-dt1).TotalMilliseconds;
rsankarindia
|
|
|
|
|
Thats what I was after. Thank you.
Objects in mirror are closer than they appear
|
|
|
|