|
Any1 can advise me what to do if i wan to search an item inside a ListView fill by a datatable according to what user type in a text box.
http://img.photobucket.com/albums/v608/mjay83/lookup.jpg[^]
above is a screenshot i taken from a software, i just wonder how they do it, user type inside the lookup textbox, then the list view will auto jump and point to the item which match or nearly match with the user input.
Any1 please?
|
|
|
|
|
The listbox responds to two messages:
CB_FINDSTRING and CB_FINDSTRINGEXACT
These messages are used to find a value in a listbox or a ComboBox.
---
Hakuna-Matada
It means no worries for the rest of your days...
It's our problem free, Philosophy
It’s rather simple to write an unmanaged C++ application that crashes when it performs a callback. It’s impossible to write a managed application that does the same, thanks to delegates. - Jeff Prosise
|
|
|
|
|
sorry but i dun really get ur mean....
i am using a listview instead of a listbox
|
|
|
|
|
on text boxs textchange event u can try following codes
foreach(ListViewItem itr in listView1.Items)
{
if(itr.SubItems[1].Text==textBox3.Text)
{
//itr.Focused=true;
itr.Selected=true;
}
else
itr.Selected=false;
}
where subitems[1] is second column so u can write column number which u want to match
rahul
|
|
|
|
|
hi, thanks for reply
i gonna try tat out
but 1 thing is, my listview contains more than 7k item,
if using this way i think is quite not resource efficency
is there other better way?
|
|
|
|
|
Hi,
is there a simple way to copy/paste a ToolStrip at designtime from one project to another project without loosing all the events that are connected to the toolbuttons?
The code behind the events is existing in both projects. When I copy the toolstrip in project1 and paste it in project2, the toolstrip with all buttons will be copied but not the events that are linked to them
I am working with VS2005 and C#
Thanks
Dirk
|
|
|
|
|
You could copy/paste the concerned code from/to the InitializeComponent method.
"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
|
|
|
|
|
I feared that this will be the answer It's not my favourite solution as it is time consuming and error-prone, but obviously the only way to copy controls from one app to the other.
Thanks anyway
Dirk
|
|
|
|
|
I had a look at the Drawarc method but i can't understand a thing. I need a draw arc method that requiers : the coordenates for the center of the circle, the radius and the angle it sweeps!
rzvme
|
|
|
|
|
It's not that hard.
Instead of a center point and radius the method takes a rectangle which specifies the bounds of the arc. Imagine it the other way round. You have an arc and put a rectangle over it so that the arc touches all sides of the rectangle.
It's simple mathematics to calculate the dimension and position of the rectangle from a center point and radius.
Furthermore the two angle parameters shouldn't be that hard to understand. If the textual description isn't sufficient, simply experiment a bit with them.
"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
|
|
|
|
|
Hi, I am using ReportViewer reports for my reporting.
I want to use the Image control(instead of Chart control) report item to draw the graphs. I need a drawing surface to draw the graph using methods from Graphics Class and show it in the Image control when I view the report . Thanking you in anticipation.
Ramith Sivanarain
|
|
|
|
|
Hi,
Can any one help me in changing the attribute value of a child attribute when the parent attribute value is changed .
eg
parent property
[readonly(true)]
parent {get{return child;}set{child =value;}}
child class
class child
{
a {get{return 1;}set{1 =value;}}
}
for this eg if i channge read only attribute for parent it should affect child also,
Thank you
regards
Praveen
|
|
|
|
|
Create an event and fire it when parent properties get changes.in that event pass the object of parent classs.Now you can set you desired child Properties
|
|
|
|
|
hi,
I guess you understood wrongly what i meant was
if i change read only attribute for parent it should affect child also,
eg
parent property
[readonly(true)]
parent {get{return child;}set{child =value;}}
child class
class child
{
a {get{return 1;}set{1 =value;}}
}
Thank you
regards
Praveen
|
|
|
|
|
praveenqwe wrote: if i change read only attribute for parent it should affect child also
Hi Praveen,
What sam# suggest, is right. See this[^] and this too[^]. Hope these articles may help in giving you a solution.
By the way, what is the meaning of this:
praveenqwe wrote: a {get{return 1;}set{1 =value;}}
also, my c# compiler gives me an error on the statement 1 = value; , which is The left-hand side of an assignment must be a variable, ...
Regards
_____________________________
Success is not something to wait for, its something to work for.
|
|
|
|
|
Hi ,
I want to open the foder. That is on a button click
I want to show folder open in explorer. How to do that?
Rahul Kulkarni.
|
|
|
|
|
Maybe this article will help you ?
My english is not so good. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
Thanks For your response.
I want to show the folder content. Take an example,
"path = c:\test\" and now normally if we want to see content of this folder
We have to go through click on My Computer then c: and finally test.
But i want to open test through programming in C#.Net. How to do that?
Rahul Kulkarni
|
|
|
|
|
Try this code:
<br />
System.Diagnostics.Process.Start("explorer.exe", "c:\\Test");<br />
My english is not so good. Please, correct my errors.
Best regards, Alexey.
|
|
|
|
|
|
I have a datatable as the datasource for a datagridview.
One of the columns displays IDs for another datatable (this relationship is specified in the dataset).
Is there any way to specify that this column should be a comboboxcolumn, bound to the related table, rather than just a textboxcolumn?
|
|
|
|
|
Yes there is.
Use the DataGridView designer to modify the properties for the column.
Also try using a BindingSource (bound to your DataSet) as the data source for the DataGridView. That way you can bind the DataGridView rows to one table and the ComboBoxColumn drop-down to another table easily through the designer.
- Xint0
|
|
|
|
|
The table is dynamically generated, so not really accessible to the designer.
I'm not sure how I'd use the BindingSource alternative. Is there a good tutorial or some such on how I might do this?
Thanks.
-- modified at 23:57 Thursday 2nd November, 2006
Maybe I should be more specific.
I have a table of employees, and a table of shifts available to work.
There is a table which links the 2 via foreign keys to represent a many-to-many relationship.
For easier editing, I create a custom datatable at runtime, where each column represents one of the shifts, and there is one column for specifying the employee's ID.
I would like the employee ID column to be a combobox column with the combobox values taken from the employee table (ValueMember = id, DisplayMember = name).
Currently, after creating the custom table, I assign it as the datasource of a datagridview, but the default situation is that the column is simply displayed as a textboxcolumn.
Is there a way (outside of the designer), to easily do this (I'm still looking into the bindingsource option)?
Any help would be appreciated, this has really got me stumped.
|
|
|
|
|
I finally figured it out.
I create the comboboxcolumn before binding to the datatable, bind the column to the employee table, and set its DataPropertyName to the name of the custom table's employee ID column name, and the column from the datatable gets pushed into it.
|
|
|
|
|
Hi everyone,
I am at wits end. I think I've read every article on CP and searched for them on the web and I just can't figure this out. I have built an application that has a lot of group boxes and controls within those group boxes on the form. I designed it with a screen resolution of 1280x1024 in mind because that is what all of us use. The controls fit just right when maximized. Now, I get this one user who is still using 1024x768 and I'm hosed!
There are some group boxes and some comboboxes/textboxes that I can resize and make smaller (when they entered data, it would scroll out of the box, but no big deal).
So now I have to re do this application to make it so that it resizes certain controls in certain group boxes when the form size is changed. (ie, they resize the control, I need one of the group boxes to get bigger, and a control or two within that groupbox to get bigger too)
I have tried playing with DOCK and ANCHOR on end. I can't get it to work right. Setting an anchor property of TOP,LEFT,RIGHT,BOTTOM resizes the group box that I want, but the problem is that when it is resized too much, that group box runs into the next group box below it. I just cannot figure out how to use panels, flowlayoutpanels, dock and anchor properties to only resize some controls but do not interfere with other controls (there are buttons / textboxes next to each other, and above and below each other, each time I've tried one of the buttons will resize itself and overrun the next) I can't get them all to just work nicely with one another!
I went to the store and bought two books and read for three hours today before posting this. I'm super peaved at myself for not being able to figure this one out. Any help, a link or anything would be seriously appreciated!
TIA
|
|
|
|