|
I have created a Datagrid with Checkboxes. On the click of a button I am trying to find out all the checked rows and process accordingly.
But the issue I am getting is, I don't find the FindControl Method through which I can check whether a checkbox is checked or not. Am I missing something in the code below or is there any other way of getting the result.
I am trying to use the following code:
For i As Integer = 0 To DataGridView1.Rows.Count - 1
ch = CType(DataGridView1.Rows(i).Cells(0).FindControl("gridchkbox"), CheckBox)
Next
But VB is giving an error
"FindControl is not an member of System.Windows.Forms.DatagridviewCell"
I am sorry if it is a very naive question but any help in this matter will be highly appreciated.
I have checked many sites and many books but could not get any solution to this issue.
As I am new to VB .Net I am stuck at this position.
Thanks in advance.
|
|
|
|
|
I believe that you need this instead:
ch = CType(DataGridView1.Rows(i).FindControl("gridchkbox"), CheckBox)
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Thanks Wes for the reply.
Unfortunately still I am not able to get this FindControl Method. Not sure if I am missing anything. It just declines to come in the dropdown when I give "Rows(i).".
Since I am new to .Net I don't know if it is related to any Namespace or anything of that sort which I may not have added in the Project.
|
|
|
|
|
suppose I have database access:
Dim Conn As ADODB.Connection
Set RS = Nothing
Set RS = New Recordset
Set Conn = New ADODB.Connection
Conn.Open ConnectionStringHere
RS.Open "SELECT Fields " & _
"FROM Table WHERE Whatever = ?"
Conn, adOpenStatic, adLockOptimistic
Datagrid.DataSource = RS
when you perform the insert, delete, add new data, datagrid refresh the data can not although I have to use appearance Datagrid.Refresh new data is entered but does not appear, check the data in have access but do not anticipate new output datagrid except close all open programs to emerging new data on the grid, the operations insert, delete, add items via the command. Execute (strSQL ), why not refresh the datagrid? and how to fix?
|
|
|
|
|
Why are you using VB6? It's dead, unsupported, and teaches you bad habits.
Without you supplying code to do the update, insert and delete operations on the database, none of those operations are going to happen. Nothing ever happens "automagically".
|
|
|
|
|
Dave Kreskowiak wrote: Why are you using VB6? It's dead, unsupported, and teaches you bad habits
I don't know why people are still using it. Seems the poster is from Vietnam, but even then that isn't an excuse to not get VB.NET...
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
|
Who is this post aimed at?
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
Richard MacCutchan wrote: Who
No one... he is spamming.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Thanks, flagged.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
im not sure about the title , but i will try to explain , if you use a program like resourcehacker and check the bitmap files in C:\Windows\System32\shell32.dll there is 2 bitmap files Bitmap_633 and Bitmap_632 these 2 files are the leftside panel in the control panel features like windows firewall ,as far as i understood the Bitmap_632 is a layer to add effects to Bitmap_633 so my question is what is this technique called and if there is a tut on how to use it in vb.net would be great
|
|
|
|
|
There are plenty of tutorials here on CodeProject[^], and a similar search on Google will probably find lots more.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
|
You are probably referring to alpha blending which makes bitmaps semi-transparent. In older systems each pixel in a bitmap consisted of 3 fields Red, Green and Blue. With alpha-blending a fourth field, Alpha, is added which gives the opacity of the pixel, from 0 meaning opaque to 255 meaning transparent.
One of these days I'm going to think of a really clever signature.
|
|
|
|
|
I need to read and process a textfile with fixed filesize from an unc network path. The content of the file gets updated in different time intervals (from 0.5 - 10 secs). Anybody is having any idea to accomplish this task?
|
|
|
|
|
annodomini wrote: any idea to accomplish this task
Plenty of ideas. What have you tried and where are you stuck?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
I thought of using FileSystemWatcher to respond to file system changes but file system monitoring of remote shares is always going to be somewhat unreliable. Maybe a polling mechanism could do the job (don't know how to adapt to the different time intervals)?
|
|
|
|
|
annodomini wrote: I thought of using FileSystemWatcher to respond to file system changes but file system monitoring of remote shares is always going to be somewhat unreliable.
True.
annodomini wrote: <layer>Maybe a polling mechanism could do the job (don't know how to adapt to the different time intervals)?
..check the remote file, every .5 second? What does realtime mean here? I'm guessing that it needs be refreshed within 10 seconds, given the remote folder.
Do you "need" the share? Or could you run an app on that remote computer that reads it locally (!) and then updates all connected clients?
Bastard Programmer from Hell
if you can't read my code, try converting it here[^]
|
|
|
|
|
hi
can any one help plz
i have application in vb.net and sql server 2005 db,
many users can login by using there Username and password,
I need to add a form for chatting any user login to the program his name show in that for so any one can chat with hem. I hop i clear my need
SO PLEASE HELP ME
THANKS SO MACH
|
|
|
|
|
A simple google search should give you all the help you could ever want as this is asked at least twice a week here.
Member 4048188 wrote: SO PLEASE HELP ME
THANKS SO MACH
Not screaming helps a great deal.
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
i search in google for many days i get nothing except tcp\ip chating
|
|
|
|
|
Member 4048188 wrote: tcp\ip chating
So what? You have some other requirement other than using the Internet Protocol for Internet chatting?
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
Member 4048188 wrote: i get nothing except tcp\ip chating
So how do you epect the messages to get across the Internet?? Carrier Pigeon?
|
|
|
|
|
Dave Kreskowiak wrote: Carrier Pigeon
lol... someday I would like to try that smoke signal protocol....
Why is common sense not common?
Never argue with an idiot. They will drag you down to their level where they are an expert.
Sometimes it takes a lot of work to be lazy
Please stand in front of my pistol, smile and wait for the flash - JSOP 2012
|
|
|
|
|
It predates the Internet and is still used today, so they've got to be doing something right with it!
|
|
|
|