|
the datagrid must be bound to a dataview. this has a filter property that u can set to filter specific data.
I not 100% how to get this correct, u will have 2 look at the help to get the details, but it will be something like
dataview.Filter = "Address = A Road";
|
|
|
|
|
You may also use ;
// dt is a DataTable instance, address is the filter string
DataRow[] dr = dt.Select("ADRES='" + address+ "'");
cheers...
|
|
|
|
|
With this method, do u have to update the binding between the datagrid and the rows once you have done the select?
|
|
|
|
|
Sure you have to
|
|
|
|
|
thx;
but how do i get just them visible?
dr.visible= true;
and how do i hide the rest?
if (dt.select("h") -> just an example to get all the rows with an h in on screen
{ dr.visible=true;}
else
dr.visible = false;
or are there other ways?
thx
|
|
|
|
|
lo,
i have found a way to init the filter:
db1DataSet.tabel1.DefaultView.RowFilter = " name LIKE '%" +
txt_sort.Text + "%' ";
but here i only look at column "name" and i want to search in every column
also i need to make these visible
hmmm keep thinking :p
|
|
|
|
|
lo;
the solution i found is :
private void btn_sort_Click(object sender, EventArgs e)
{
db1DataSet.tabel1.DefaultView.RowFilter =" name LIKE '%" + txt_sort.Text + "%' ";
dataGridView2.DataSource = db1DataSet.tabel1.DefaultView ;
}
but now i have to make a button that will set the filter to his default
not sure how to do that but ill find it
|
|
|
|
|
my problem is the following:
I have one datagrid and i want to add one column (named Status) which a text description regarding to a item status. This datagrid in binded to a typed dataset, but in this DS the column status is represented as a number (0 [for waiting], 1 [for ok], and so on). What`s the best approach to map the numeric representation in the DS to a textual representation in the datagrid column? (I don`t wanna loop throught my datagrid and change de Status column value.)
Thanks in advance... :]
|
|
|
|
|
i have achieved this by having another table containing the status representations, then binding the status table to the column with the values, and they will automatically set to the status definition.
|
|
|
|
|
i haven`t understand. how can i "automatically" do that?
but i`m thinking about a event do accomplish that. any ideas?
|
|
|
|
|
in the same way you can bind elements in a combo box with the ValueMember and DisplayMember, you could achieve the same effect with a data column (though you would have to derive one from the existing ones).
i have no idea how you would achieve this with an event, and would question if it is even possible. It is is please enlighten me.
|
|
|
|
|
Not sure if this is best forum but...
I am trying to convert some old C# code into a VB.NET version and in the process add some more functionality. Silly me... I don't know any C# at all but having an educated guess. This following bit has me stumped. Can anybody help with the conversion or give an indication of what his code is doing?
<br />
protected void onMenuItemClick(Object sender, EventArgs e) {<br />
MenuItem item = (MenuItem)sender;<br />
if (MyItemClicked != null) {<br />
string fileName = (string)_itemMap[item];<br />
MyItemClicked(this, new MyItemClickedEventArgs(fileName));<br />
}<br />
}<br />
Cheers
Tim
|
|
|
|
|
Hi
I'm not much familiar with vb, but the equivalent for this code in vb should be something like this:
Private Sub MenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem.Click
Dim item As MenuItem
If Not MyItemClicked Is Nothing Then
Dim filename As String
filename = _itemMap(item).ToString()
MyItemClicked(Me, New MyItemClickedEventArgs(filename))
End If
End Sub
if you need, I can explain what this method does, and then you can write the correct code yourself.
HTH
farshad
|
|
|
|
|
This would have been more suited to the VB forum.
As of how to accomplish that have you ever tried Google?
Failing that try .
|
|
|
|
|
The first reply was close...but no cigar. VB equivalents regarding events can be tricky. You'll need (especially note the hidden "MyItemClickedEvent" variable):
Private Sub MenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MenuItem.Click
Dim item As MenuItem
If Not MyItemClickedEvent Is Nothing Then
Dim filename As String
filename = _itemMap(item).ToString()
RaiseEvent MyItemClicked(Me, New MyItemClickedEventArgs(filename))
End If
End Sub
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Clear VB: Cleans up VB.NET code
C# Code Metrics: Quick metrics for C#
|
|
|
|
|
Thanks for your responses.
This now makes sense to me, it was just a syntax issue.
Cheers
Tim
|
|
|
|
|
David,
On further examination of your response, does the following (second line of original code) assign a value to item?
MenuItem item = (MenuItem)sender;
If so, this assignment is missing from your response. After the = is what I am struggling with.
Cheers
Tim
|
|
|
|
|
D'oh!
I started with Farshad's response and I just modified it.
You should definitely have:
Dim item As MenuItem = CType(sender, MenuItem)
David Anton
www.tangiblesoftwaresolutions.com
Instant C#: VB to C# converter
Instant VB: C# to VB converter
Instant C++: C# to C++ converter, VB to C++ converter
Clear VB: Cleans up VB.NET code
C# Code Metrics: Quick metrics for C#
|
|
|
|
|
NOW I get it
Thanks David
|
|
|
|
|
Hi all,
in Visual Studio 2003, we get used to use the "Build comment Web Page" feature to create web page
of the classes with descriptions by xml info.
Do you know how to do that in Visual Studio 2005 ?
Thank you so much...
Have a good day.
'Alper
|
|
|
|
|
That was actually removed from the product and doesn't exist in 2005. It's amazing to me really, I'd think that Microsoft would be all over competing with javadoc. You can still create the XML file by checking an option to do so in the build configuration, but there's no way to generate the HTML.
There are a few options, though. I work for SlickEdit and one of the features we offer does just what you're looking for, check out the product showcase link for more info. There's also NDoc which is open source and very popular. There's another product, too, called VS Docman. Each one does things a little differently, so I suggest looking at each one to see what suits you best.
I don't know if you had seen what VS 2003 spit out when you actually created the web pages, but it was pretty ugly. That's probably the main reason they dropped it.
|
|
|
|
|
Thank you
Too bad to learn that...
|
|
|
|
|
This CP article[^] may help you.
"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 all ,
i wanna ask about creating windows service and let this windows service activate with my GUI , so any help will be usefull for me
:-> regards
abdallah zaid
|
|
|
|
|
Search "windows service" in this site and you will get tons of articles. Start from there.
Post specific questions if you need help in specific areas. Good luck.
Best,
Jun
|
|
|
|