|
Another question
In my datagrid would like to paint rows and cells in different color, to mark if changes have been made and so forth. I've made my own textboxcolumns but i'm not pleased with the result, partly because theese columns "overrides" the datagrid function to color up the rows when you click on the rowheader column. Language - vb.net. Tips, anyone???
Evertbylt
|
|
|
|
|
You might want to have a look at these[^] articles on the DataGrid for Windows Forms.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi
I'm working with an application where it would be desirable to preserve several columns in a datagrid for comboboxes (for choosing and searching). I've tried to fix it but it doesn't seem to work. Do anyone have an idea how to do this?? I'm working in VB.NET.
nicek168
|
|
|
|
|
Hi
I have a form with 7 datagrids each with between 2 and 10 columns. These are bound to DataViews which are bound to DataTables. I use DataVeiw.RowFilters to display the required data. I dont want to display all the columns in the DataGrids. Below is code to set up the first two columns of the first datagrid - another 6 to go... Any ideas how I could loop through the columns of each table, and perhaps pass the function an array of the desired column widths (setting hidden columns' column width to 0) for each table?
Tks
Private Sub InitialiseDataGrids()
Dim TextCol As DataGridTextBoxColumn
Dim ts As DataGridTableStyle
ts = New DataGridTableStyle
ts.MappingName = dtBOMDetail.TableName.ToString
TextCol = New DataGridTextBoxColumn
'Table 1 Col 1
TextCol.MappingName = dtBOMDetail.Columns(0).ColumnName
TextCol.HeaderText = dtBOMDetail.Columns(0).ColumnName
TextCol.Width = 200
TextCol.NullText = "0"
ts.GridColumnStyles.Add(TextCol)
'Table 1 Col 2
TextCol = New DataGridTextBoxColumn
TextCol.MappingName = dtBOMDetail.Columns(1).ColumnName
TextCol.HeaderText = dtBOMDetail.Columns(1).ColumnName
TextCol.Width = 300 'Hidden Column
TextCol.NullText = "0"
ts.GridColumnStyles.Add(TextCol)
Me.dgPartsList.TableStyles.Add(ts)
And so on..... another 50 times!!!
|
|
|
|
|
hi,
i have a datagrid with some data, how can i read all the data from the grid, or read some specific data (eg column2, row 3) from the datagrid? coz i need to store them to database, thanz in advance!
elcheah
|
|
|
|
|
A DataGrid doesn't have any data to look at. You should be looking in the DataSource (property) that the DataGrid is using. This is usually a DataSet or DataTable object, which should be retrieved from a database anyway.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hello there
I have a desktop application using webservices at backend. the problem is when I upload the file of more then 100MB it says after some time that "Connection time out". I increased the IIS - webservice time out property but even now the error is coming. my idea is that it is coming due to connection time out property of desktop application.
any information or suggestion will be appreciated to remove the bug
|
|
|
|
|
Hi,
I'm trying to send a windows message from vb6 to a vb.net app. The problem is that I can recieve a message, but the string I send with it is not recieved correctly by the vb.net app. When I try to put it back into a string again I get garbage.
Here is some code from the sending app (vb6):
<code>Private Sub cmdSendData_Click()
Dim sString As String
Dim lHwnd As Long
Dim cds As COPYDATASTRUCT
Dim buf(1 To 255) As Byte
sString = Trim$(txtString)
If sString = "" Then Exit Sub
'
' Get the handle of the target application's visible window.
'
lHwnd = FindWindow(vbNullString, cWINDOW_TITLE)
'
' Copy the string into a byte array,
' converting it to ASCII. Assign lpData
' the address of the byte array.
'
Call CopyMemory(buf(1), ByVal sString, Len(sString))
With cds
.dwData = 3
.cbData = Len(sString) + 1
.lpData = VarPtr(buf(1))
End With
'
' Send the string.
'
Call SendMessage(lHwnd, WM_COPYDATA, Me.hwnd, cds)
End Sub</code>
And here is the recieving app(vb.net):
<code> Protected Overrides Sub WndProc(ByRef m As System.Windows.Forms.Message)
If m.Msg = MainForm.WM_COPYDATA Then
Dim data As CopyData
Dim message As String
' get the data...
data = CType(m.GetLParam(GetType(CopyData)), CopyData)
message = Marshal.PtrToStringAuto(data.lpData, data.cbData \ Marshal.SystemDefaultCharSize)
' add the message
Messages.Items.Add(String.Format("{0}: {1}", DateTime.Now.ToShortTimeString(), message))
' let them know we processed the message...
m.Result = New IntPtr(1)
Else
MyBase.WndProc(m)
End If
End Sub
Private Const WM_COPYDATA As Integer = &H4A
<StructLayout(LayoutKind.Sequential)> _
Private Structure CopyData
Public dwData As IntPtr
Public cbData As Integer
Public lpData As IntPtr
End Structure</code>
If I send the same message from a vb.net app then everything works.
Can anyone tell me what I'm doing wrong?
Thanks!
|
|
|
|
|
ok fixed it!
changes (in the .net code):
[code]
'message = Marshal.PtrToStringAuto(data.lpData, data.cbData \ Marshal.SystemDefaultCharSize)
Dim B(255) As Byte
Marshal.Copy(data.lpData, B, 0, 255)
message = System.Text.Encoding.Default.GetString(B)
[/code]
|
|
|
|
|
In VB.NET that permission read and write file .XML.
In Visual Basic, Can I do similar VB.NET?
|
|
|
|
|
|
|
try XML DOM object in vb6 add it from references.
|
|
|
|
|
In VB.NET that permission read and write file .XML.
In Visual Basic, Can I do similar VB.NET?
|
|
|
|
|
In VB.NET that permission read and write file .XML.
In Visual Basic, Can I do similar VB.NET?
|
|
|
|
|
what kind of english is that ?
i don't understand anything at all...
please re-formulate your question, sir.
TOXCCT >>> GEII power [toxcct][VisualCalc]
|
|
|
|
|
I have a database in Access and a table is there whose values may change run time.One data report is there to show the report from this table. But datareport is not getting refreshed while changing the values of table. Any solution..?
|
|
|
|
|
I've been trying to override the ListView's Paint event as I need to handle this event in my Windows Forms Project.
I've managed to get the Paint event to fire (as desired) but any items that I add to the ListView are not visible. I am completely clueless when it comes to custom draw controls but I suspect that as I'm overriding the paint event I'm going to need to draw the items I add.
Can anyone point me in the right direction in terms of what I need to do to be able to see the ListViewItems that I add to my custom ListView?
Here's the code that I'm using to expose the paint event.
Thanks,
Karl
<br />
Imports System<br />
Imports System.Drawing<br />
<br />
Public Class MyCustomListView<br />
Inherits ListView<br />
<br />
Public Sub New()<br />
<br />
Me.SetStyle(ControlStyles.UserPaint, True)<br />
Me.SetStyle(ControlStyles.DoubleBuffer, True)<br />
Me.SetStyle(ControlStyles.AllPaintingInWmPaint, True)<br />
<br />
End Sub 'New<br />
<br />
Protected Overrides Sub OnPaint(ByVal e As PaintEventArgs)<br />
<br />
MyBase.OnPaint(e)<br />
<br />
End Sub 'OnPaint<br />
<br />
End Class 'MyCustomListView<br />
|
|
|
|
|
Are you saying that your trying to add items to the ListView inside the Paint event? (Not a good idea BTW!)
Or if your just trying to custom paint the thing, search the artciels for "custom listview" and you'll come up with a few examples. They might have what you're looking for.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Dave Kreskowiak wrote:
Are you saying that your trying to add items to the ListView inside the Paint event? (Not a good idea BTW!)
I'm not trying to add items inside the Paint event. I'd like to get away from that as much as possible. I don't even want to custom paint the thing (if I can get away with that).
All I wanted to do was to expose the ListView's Paint event but ever since I did that (using the code shown in my initial thread) any items that I add to the listview don't show up.
If I comment out the line below, any items I add show up, but then of course the Paint event is not exposed anymore:
<br />
Me.SetStyle(ControlStyles.UserPaint, True)<br />
|
|
|
|
|
hi there,
i have a asp page which display record from the database in my database there are 8 record i sorted the record and display only last 3 record but my srno is same as in database that " 3,4,5" i want my srno to display as "1,2,3" can any body help me
this is code
<%=(1)%>
"><%=rst("fileName")%> <%=rst("reportMonth")%> <%=rst("reportYear")%> <%=rst("status")%>regard
ybasha
|
|
|
|
|
check rst.recordcount plus where is the while loop for your code
while not rst.eof
<td><%=(1)%></td>
<td><%=rst("fileName")%></td>
<td><%=rst("reportMonth")%></td>
<td><%=rst("reportYear")%></td>
<td><%=rst("status")%></td>
rst.movenext
wend
|
|
|
|
|
Hi I am learning VB.Net. Right now my knowledge is all in bits and pieces I want to put all this together so I want ot create a small project that covers all the features of vb.net. Do any of you have guidelines to any such project for a vb.net beginner.
Thanks
|
|
|
|
|
A good beginner level project is an address book.
Use a treeview/listview design. Treeview has a top node for each alphabet letter, and names under each letter. List view shows details when you click on a name. Adda menu and a toolbar. Create forms to allow you to add/edit data. Use a small Access database as the data source. Make sure it is normalized. If you don't know what that means, time to learn.
This is a good beginner level exercise that uses a variety of controls and their events, requires field level validation, data binding, data access, and sharing data between forms.
Plus you can actually use it when you are done.
|
|
|
|
|
Ok, I am planning out right now a new VB.Net application and am looking for suggestions.
I will be storing the username & passwords inside a SQL table and need suggestions or pointers for code to handle the read/write and decription for verification of the passwords.
This is a system being developed for the Federal Government so a serious level of security is required for this app.
I have been looking through the Microsoft Enterprise Patterns & Practices but am not sure if this is the way to go.
Suggestions?? or Ideas??
David @ Premier
You are only as good as your last project.
|
|
|
|