|
Hi,
I'm trying to do something very simple, however I seem to going rouund in circles!
1. I have an Array which is loaded from a file, I then load it into a DataTable, at the same time adding Column names.
2. I create a DataView from the Datatable.
3. I asign the DataView to a Datagrid using Datagrid.DataSource = DataView
4. Run, everything works fine.
The issue...
I want to change the size of the columns and hide some occasionally. I tried using DatagridTableStyles are per several submissions on the web, but it won't work.
Any ideas?
Is there a simple way of doing this?
|
|
|
|
|
Using DataGridTableStyles IS the simple way of doing it, and as it happens, the only way.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Ok, thanks for that at least I'm in the right place.
In that case then please can you help me to understand when the following code doesn't work, it's probably something simple...
I'd really appreciate some assistance...thanks
What Happens > All the data loads fine, the Datagrid1 formating works ok, but the columns are not adopting the table styles I created!
coding...
-->Step 1 load up 'Product' Array with Data
-->Step 2 load up Column collection...
Private Sub LoadColumnCollection()
productColumnCollection.Add("Level3")
productColumnCollection.Add("Level4")
productColumnCollection.Add("Rep_ITEM")
productColumnCollection.Add("Description")
productColumnCollection.Add("Ext_Description")
productColumnCollection.Add("End_Date")
productColumnCollection.Add("Price_From")
productColumnCollection.Add("Price_To")
productColumnCollection.Add("Price_Comments")
productColumnCollection.Add("RRP")
productColumnCollection.Add("Min_ISP")
productColumnCollection.Add("Max_ISP")
productColumnCollection.Add("ISP%SIP")
productColumnCollection.Add("%Margin")
productColumnCollection.Add("Units")
productColumnCollection.Add("SIP")
productColumnCollection.Add("Pack_Priority")
productColumnCollection.Add("Exculsive")
productColumnCollection.Add("Despatch_Date")
productColumnCollection.Add("ITEM_Code")
productColumnCollection.Add("Lenght_Av.")
productColumnCollection.Add("Unit_EAN")
productColumnCollection.Add("Case_EAN")
productColumnCollection.Add("Outer_EAN")
productColumnCollection.Add("Length")
productColumnCollection.Add("Width")
productColumnCollection.Add("Height")
productColumnCollection.Add("Case_Length")
productColumnCollection.Add("Case_Width")
productColumnCollection.Add("Case_Height")
productColumnCollection.Add("Gross_Weight")
productColumnCollection.Add("H")
productColumnCollection.Add("Pallet_Weight")
productColumnCollection.Add("Cases_Per_Layer")
productColumnCollection.Add("Layers_Per_Pallet")
productColumnCollection.Add("Reason_For_Change")
End Sub
Private Sub LoadColumnNames()
Dim row As Integer
Dim dC As DataColumn
' set product table up...
productTable = New DataTable("Product Table")
' construct table columns and names...
Try
For Each Nm As String In productColumnCollection
dC = New DataColumn(Nm)
dC.DataType = System.Type.GetType("System.String")
productTable.Columns.Add(dC)
Next
Catch
End Try
End Sub
-->Step 3 load up Column names into table...
Private Sub LoadColumnNames()
Dim row As Integer
Dim dC As DataColumn
' set product table up...
productTable = New DataTable("Product Table")
' construct table columns and names...
Try
For Each Nm As String In productColumnCollection
dC = New DataColumn(Nm)
dC.DataType = System.Type.GetType("System.String")
productTable.Columns.Add(dC)
Next
Catch
End Try
End Sub
-->Step 4 load up Dataview...
Friend Sub ViewConstructor()
productTableViewDefault = New System.Data.DataView(productTable)
productTableViewDefault.AllowNew = False
productTableViewDefault.AllowDelete = False
productTableViewDefault.AllowEdit = True
End Sub
--> Step 5 Assign view to Datagrid1...
Datagrid1.Datasource = productTable
--> Step 6 Format Datagrid1...
With DataGrid1
.BackColor = Color.GhostWhite
.BackgroundColor = Color.Lavender
.BorderStyle = BorderStyle.None
.CaptionBackColor = Color.RoyalBlue
.CaptionFont = New Font("Tahoma", 12.0!, FontStyle.Bold)
.CaptionForeColor = Color.Bisque
.CaptionText = "Installed Software"
.Font = New Font("Tahoma", 8.0!)
.ParentRowsBackColor = Color.Lavender
.ParentRowsForeColor = Color.MidnightBlue
.HeaderBackColor = Color.DarkBlue
.HeaderForeColor = Color.White
End With
'set up style...
Dim objDataGridTableStyle As New DataGridTableStyle
Dim objTextCol As New DataGridTextBoxColumn
' set alternate background colour...
objDataGridTableStyle.AlternatingBackColor = Color.WhiteSmoke
' set the mappingname for the DataGridTableStyle...
objDataGridTableStyle.MappingName = "productTable"
'set column 1
objTextCol.MappingName = "Level3"
objTextCol.HeaderText = "Level >3"
objDataGridTableStyle.GridColumnStyles.Add(objTextCol)
'set column 2
objTextCol = New DataGridTextBoxColumn
objTextCol.MappingName = "Level4"
objTextCol.HeaderText = "Level >4"
objDataGridTableStyle.GridColumnStyles.Add(objTextCol)
'final step, add datagridtablestyle to datagrid...
DataGrid1.TableStyles.Add(objDataGridTableStyle)
End of code...
Thanks
|
|
|
|
|
I want my application to send a request to search engine(Yahoo.com ,Excite,Altavista,msn) and the search engine should return the URLs of the top 10 sites that match the keywords I sent to the search engine.
I have found google.com contain an API for developers but the other search engines does not provide a similar API or web service.
Thanks in advance
|
|
|
|
|
And your question is?
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
my question is How can I get the top 10 sites that match my request from a search site other than Google
|
|
|
|
|
You'll have to either
1) Write the code for each search engine to parse up the resulting HTML and pull out the information you need.
2) Consult with the search engine to find out if there is some kind of developer interface for you to use. Like Googles...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I need to concatenate a one list of wav files with another list
I found a vb program on the net that uses th dos copy command by creating a batch file on the fly. this doesn't seem to work and although concatenates the files (the file size is bigger) when trying to play the wav file it only plays the first file
The filenames are of the following format:
file1 "hey <text of var length>.wav"
file2 "oh <text of var length>.wav"
I want to run a batch list as there are 108 files of each type. The varying length text is the same for the two files that need to be joined.
Cany anyone help?
Terry
|
|
|
|
|
If only it was so easy as copying files together. Unfortunately, it's not. The header of the .WAV file stores information such as bit rate, encoding, channel format, data length, ... This information is not expected in the middle of a .WAV file and is not interpreted as a new .WAV and played, as you've noticed.
You have a couple of problems. First, joining two .WAV files together means you have to read both files, determine that they share the exact same encoding, bit rate, ... what have you... Then write a new header with a new header built to encompass the data from BOTH files, not just one. Write the audio data from the first file, then append the audio data form the second.
Secondly, what if the encoding is different? How about the bit rate? You'll now have to recode the data from the second file to match the encoding of the first. Same with the bit rate...
I would recommend searching for an audio format processing library to take care of this work for you. I would suggest Googling[^] for "audio processing library VB.NET wav".
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Thanks for the info, that's pretty muuch as I expected the case would be.
Terry
|
|
|
|
|
How can i generate dynamic database fields in crystal reports, pls repla imediately with the help of a sample code
in VB.Net
Jyt
|
|
|
|
|
Dear Friend i have the below string written
and i want to know if could be converted to executable code
"Tree" & "." & "Nodes" & "(" & 0 & ")" & "." & "Nodes" & "." & "Add(" & """0.4""" & ")"
where Tree is a treeview control
i want to add nodes in a complicated treeview and it would be
very easily to me if i could convert such strings as the above
to executable code
ergolabos
|
|
|
|
|
The complexity of the code involved is not worth it. Why on earth could you just use comething like:
Tree.Nodes(someIndexVariable).Nodes.Add("0.4")
It's incredibly easy to build the string you want, but incredibly difficult to convert it to executable code that will work with your TreeView control.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
hello,
i tried to use the ExitWindowsEx() WINAPI in Visual Basic 6,
i use Windows XP OS and i want to reboot my pc after some installation (designed in vb). the parameters include 0 for logoff, 1 for shutdown and 2 for reboot.....
if i use 0 (logoff) it works fine, but when i use 1 or 2 .... it wont execute... enters into err handler...
here is the code...
If ExitWindowsEx(2, 0) = 0 Then<br />
MsgBox "The system could not REBOOT the machine. !"<br />
End If
previous to this we need to define the function..
Public Declare Function ExitWindowsEx& Lib "user32" (ByVal uFlags As Long, ByVal dwReserved As Long)
plz help me...
- thanks,
Basavaraj P.Umadi
|
|
|
|
|
Using ExitWindowsEx isn't really so straight forward. You might want to try looking at the example shown here[^].
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
And people in hell want ice water.
Are you talking about the BETA version? Try here[^]...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
but at that link it requested to enter the msdn id or patner id where i will get that ids to download vs 2005
|
|
|
|
|
Buy an MSDN subscription...
Any other way you get is piracy and noone here will help you with that!
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
|
Sweet.. just ordered the DVD for less than $9.00.
Thanks much
|
|
|
|
|
i added a textbox and a button in my form , now i want to type a id in textbox and on click on button i want to display a crystal report , should be display only filter record with that specific id {not the whole record/table} with sql server or access but first choice is with sql server.
if anyone have the solution please send the code. i would be thank full.
|
|
|
|
|
Hi, I use VB.Net 2003 to get the data from Ms access and present it on the form. I also build a search form and display the result that is found on the list view. So now I want to make a report on it. I made a decision that I would report in one of that two method.
1. When I click on the report button, the result that found in the list view will publish on an HTML file. Does anyone know how to do that? I want the sample code to do that. Because static HTML is general use on any machine that install windows operating system. The machine that just install windows could be able to open the report file without any specific application.
2. If the first method is not possible, I want to export the data from the list view that I found to Microsoft excel. Here I need the sample code to do that too. Does anyone know how to do that? Please let me know.
If any people know only the resource on the web to solve these two problem I still accept.
A thousand mile of journey, begin with the first step.
APO-CEDC
Save Children Norway-Cambodia Office
|
|
|
|
|
How do I set up the parameters and call
Private Declare Function OleCreatePictureIndirect _
Lib "olepro32.dll" (PicDesc As PicBmp, RefIID As GUID, _
ByVal fPictureOwnsHandle As Long, IPic As IPicture) As Long
from VB.NET and retreive the returned picture(image?)?
Thanx in advance
LLINF
|
|
|
|
|
There are no known example of using the function in VB.NET. There is a VB6 example in the Microsoft KB -> How To Capture and Print the Screen, a Form, or Any Window[^]. It can be converted to VB.NET code with a bunch of work.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|