|
Well, I guess you were right I was remembering the web control listbox. Still I think you can get something to work. The listbox has a SetSelected method on it, which takes an index and true or false if the item should be selected. So I would suggest you keep track of the index of the items that are double clicked and then on the click method check to see if they just clicked on one of the indexes that is not suppose to be selectedable and then call the SetSelected method and set that index back to false.
Hope that helps.
Ben
|
|
|
|
|
ok thankyou very much, your idea wud be indeed helpfull.
May God help u solv ur problems as well,thx in advance!!
|
|
|
|
|
now i made this code
cmd.CommandText = "select distinct * from reglz where fatrname LIKE '%" & TextBox1.Text & "%' "<br />
DataGridView1.Refresh()<br />
<br />
ad.SelectCommand = cmd<br />
ad.Fill(ds, "reglz")<br />
DataGridView1.DataSource = ds.Tables("reglz")<br />
this code will give me some data in the datagride
so what i need to do now is ,to select a number of records to edit in the "fatrname" filed
from datagrideview
but after i select these number of records i dont know how to edit all the field of this "fatrname" or any field for all the records that i select
please help me
very importnat
|
|
|
|
|
1 - use real variable names
2 - this code is ripe for SQL injection attacks, you should read up on this and fix it
3 - try using sensible subject lines, so people know what you want
At the end of all that, I'm not sure if a datagridview supports editing fields. What does google say ?
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Almost all his posts are 'help' or 'urgent.' He's now on my list.
_____________________________________________
Flea Market! It's just like...it's just like...A MINI-MALL!
|
|
|
|
|
I am creating deployment setup for windows based application by cutomising deployment project, using User Interface editor and Custom Action editor.
In my custome action i want to know the path(location) at which this application is being install.
Basically when setup program runs the first screen pop's up and ask user to select the location to install the application. This path i want to access in my later custom actions.
If any one knows how, please kindly let me know. I appreciate your help.
Thank you very much.
|
|
|
|
|
Hi forum,
i like to create a UserControl with some textboxes, buttons and so on.
This is no problem, starting with a UserControl project, placing the textboxs, buttons on the control panel, compiling, adding the dll to any project. It works perfect.
My problem now is: Placing MyUserControl on any form, it is possible to code in the calling form MyUserControl.Controls.Items(...).... to get a collection of controls.
Using this collection, it's possible to get direct access to all controls placed on MyUserControl.
Who to prevent direct access from any forms to the controles placed on the MyUserControl using the Controls Collection ?
Any comments pls ?
|
|
|
|
|
There's really no way to stop people accessing your controls this way. Why would you want there to be ? I mean, if someone starts manipulating the controls on your control, then that's their problem.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Thank you for your quick reply, this answer i expected, after some testing, that there is no way.
Why to prevent modifying the control - well, isn't a control just some code for any specific task? Istn't it better to prevent modifyiny?
But ok, you are right, people modifying an control my be it's there problem .....
|
|
|
|
|
Hello Friends,
I am creating one vb6.0 project and i have the reqirement to display Crystal Report in Picturebox,so can anyone tell me how this is possible pls send me te code to dispay Crystal report on picturebox control in vb 6.0.
Thanks and Regards,
Girish B, Shukla
GIRISH
|
|
|
|
|
A picturebox shows a picture. Therefore, you need to render your report to a bitmap, then you can put that bitmap in a picturebox.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
hi! i am using vb.net 2003. but now i have started getting an error "object reference not set to an instance of an object" and that too as soon as i start coding. as soon as i enter the editor, the first thing i do select an "oledb connection control" from the toolbox. and next in the property tab of the oledbconnection, as soon as i select the connectionstring value, the abovementioned error occurs. i just can't understand y this is happening as i haven't even started coding! ne1 ever encountered this error b4???
|
|
|
|
|
Prem Ranjan wrote: ne1 ever encountered this error b4???
Please stick to English...
What you can do is open a second instance of the IDE, attach the debugger to the first instance, and see where you end up when it crashes.
Christian Graus - Microsoft MVP - C++
"I am working on a project that will convert a FORTRAN code to corresponding C++ code.I am not aware of FORTRAN syntax" ( spotted in the C++/CLI forum )
|
|
|
|
|
Christian Graus wrote: stick to English...
Text speak is turned off right now...b4 didn't compile for a minute there
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
hi guys
i have a string
like "12007" or "112007"
in this string last four characters denotes to a specific year and the rest shows month ,
i want to get a the month either ir is 1 or 12 or 10 ,, i cannot use sunstring because i am not sure about its lenth it might me 1 or two , so how could i get the exazct month ,,,
thansk in advance
hello
|
|
|
|
|
Unless someone sticks the day of the month in there, then you got some trouble.
You have to assume that the last four are the year, then anything before that is going to be the month. Assuming the day of month isn't going to be there, you will have to check the length of the string. If it is 5 then you have one digit for the month, else if the length is 6, then you have two digits for the month. Find the length of the string first, then you can use SubString(....) to pick it apart.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer
|
|
|
|
|
Why not look at the total length of the string then subtract 4 (the number of digits for the year portion) and use that data to know the rest?
Its just working backwards.
|
|
|
|
|
chop last 4 chars and parse, I would say.
|
|
|
|
|
Can someone please help me filling a DataGrid without a DataSource. I'm used to work with a component called the True DBGrid made by ComponentOne for VB6, and it was a walk in the park to change the cells' value. Surely there's a way to modify the values without a source, right?
Thanks in advance!
|
|
|
|
|
I Don't know if I understand your question correcly, but if you are using VS2005, and a DataGridView control, you can do this:
'Drop the control on your form
'Add two columns
Me.DataGridView1.Columns.Add("Col1", "FirstColName")
Me.DataGridView1.Columns.Add("Col2", "SecondColName")
'Add some rows - 5 in this case
Me.DataGridView1.Rows.Add(5)
'Modify the Data in the control
Me.DataGridView1.Item(0, 0).Value = "Hello" 'Row 0, Column 0
Me.DataGridView1.Item(0, 1).Value = "Dude" 'Row 1, Column 0
|
|
|
|
|
You could do how Richard described, but if you're going to save the data in the grdi, you'd be better off binding the grid to a DataTable you create. The DataTable object can save, and load, the data into/from an XML file without a pile of code on your part.
|
|
|
|
|
Hi, would you please explain the two lines of code below that are high lighted.
DataSet ds = new DataSet();
SqlDataAdapter da = new SqlDataAdapter(qry, con);
da.Fill(ds);
ListBox1.DataSource = ds;
ListBox1.DataValueField = "SingerID";
ListBox1.DataTextField = "Singer";
ListBox1.DataBind();
Are "SingerID" and "Singer" the names of fields in a database. The comment to the right of "Singer"; says that the name of singers will be displayed. How will it be displayed, in grid or something else? Thanks for your help.
|
|
|
|
|
SingerID is the id (probably primary key) of the Singer, and Singer contains the text of the name. What happens is if the user selects a name from the listbox, then the SelectedValue property of the listbox is the corresponding SingerID for that particular name.
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|
|
Suppose instead of having Singer and SingerID as the names of the fields in the database, I have ResumeID and Resumes as the names, and Resumes contains resumes of different people. Can I use the same technique that was used to display the content Singer to display the content of Resumes if Resumes is of type nvarchar or text? Thanks for responding.
-- modified at 22:32 Monday 23rd July, 2007
|
|
|
|
|
Singer looks as if it is the field in the database holding the names of the singers. In your case, you can change SingerID to ResumeID , and Singer to Resumes . It should work.
"I've seen more information on a frickin' sticky note!" - Dave Kreskowiak
|
|
|
|