|
how can I code a whole column cell to unactive in datagrid?
I have 3 column in my datagrid, and I only want my first column cell to be active. the rest of them should not be active. is everybody know how to code it?
Thanks
Lisa
|
|
|
|
|
Derive a new ColumnStyle from DatagridTextBoxColumn and override its Edit method with return. Use that column style for your Inactive column.
Public Class DataGridInactiveColumn<br />
Inherits DataGridTextBoxColumn<br />
<br />
Protected Overloads Overrides Sub Edit(ByVal source As System.Windows.Forms.CurrencyManager, ByVal rowNum As Integer, ByVal bounds As System.Drawing.Rectangle, ByVal [readOnly] As Boolean, ByVal instantText As String, ByVal cellIsVisible As Boolean)<br />
Return<br />
End Sub<br />
End Class
|
|
|
|
|
I have this code to slected row and return row number. In my datagrid, I have entity_id, name, description, and I hide my entity_id column. when user selected the row, then it returned the entity_id instead of that rowNumber. Is anybody know how to change the code below to enable to return entity_id instead of row number?
Public Function GetSelectedRows(ByVal dg As DataGrid) As System.Collections.ArrayList
Dim al As New ArrayList
Dim cm As CurrencyManager = Me.BindingContext(dg.DataSource, dg.DataMember)
Dim dv As DataView = CType(cm.List, DataView)
Dim i As Integer
For i = 0 To dv.Count - 1
If dg.IsSelected(i) Then
al.Add(i)
End If
Next
Return al
End Function
Lisa
|
|
|
|
|
Change function as
Public Function GetSelectedRows(ByVal dg As DataGrid) As System.Collections.ArrayList
Dim al As New ArrayList
Dim cm As CurrencyManager = Me.BindingContext(dg.DataSource, dg.DataMember)
Dim dv As DataView = CType(cm.List, DataView)
Dim idCol As Integer
idCol = 2
Dim i As Integer
For i = 0 To dv.Count - 1
If dg.IsSelected(i) Then
al.Add(dg.Item(i, idCol))
End If
Next
Return al
End Function
Assign idCol the Index of entity_id column. I have used 2 for sample
Sanjay Sansanwal
www.sansanwal.com
|
|
|
|
|
Thanks! It works..
Lisa
|
|
|
|
|
creation of dataadapter through coding... no wizards..
sm
|
|
|
|
|
MustInherit Public Class DataAdapter
Inherits Component
Implements IDataAdapter
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatacommondataadaptermemberstopic.asp
|
|
|
|
|
You're going to have to be MUCH more specific about what you want. Your initial post is very vague. But, based on what you posted so far...
Dim myDA As New DataAdapter()
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I really need help on DoubleClick Event of ListView. I know that double click event is only for selected listview item in listview.
ie.:
Private Sub lstvNote_DoubleClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles lstvNoteBACKGROUND.DoubleClick
if lstvNote.SelectedItem.Count > 0 then
'do something
end if
End Sub
-------------------------------------------------
However, is it possible that I could have a double click event on outside of listview items ??
|
|
|
|
|
Trap MouseDown event
Sanjay Sansanwal
www.sansanwal.com
|
|
|
|
|
I need help to convert a system variable to IP
the system variable is %clientname% and it will hold ex. P192168010004
if ya take away the P you have 192168010004 then I need a '.' every 3rd number like 192.168.010.004
Soo iam total noob with VB scripting and I would gladly take all help I can..
Thanks alot..
|
|
|
|
|
It would help if you were a little more specific about what your are having trouble with, but here's the whole solution anyway...
Dim WshShell, strEnvString, strIPAddress
Set WshShell = WScript.CreateObject("WScript.Shell")
strEnvString = WshShell.ExpandEnvironmentStrings("%ClientName%")
' Just ignore the first character, we can start parsing out the address anywhere we want.
strIPAddress = Mid(strEnvString, 2, 3) & "." & _
Mid(strEnvString, 5, 3) & "." & _
Mid(strEnvString, 8, 3) & "." & _
Mid(strEnvString, 11, 3)
WScript.Echo "The machine IP is " & strIPAddress
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Please suggest a solution, wherein a client application in VB.NET needs to pick the db connection string from a remote server. I do not wish the client app to be supplied with the db connectivity details, but on successful login [using remote class] be supplied with the db connection string.
Thanks in advance
|
|
|
|
|
If your using a remote class, what's stopping you from passing back a string value with the connection string?
After a successful login, the client could just use Remoting to request the connection string from the server using the same method that was used to perform the authentication...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
Hi,
I need to modify some registry value with a vb.net application.
I can modify easyly string value but I can't modify DWORD value.
Any1 know how to change DWORD value ?
thx
Sybux
|
|
|
|
|
You might want to post the code your having problems with because writing a DWORD value is no different than writing an SZ value to the registry.
Dim testSettings As RegistryKey = Registry.CurrentUser.CreateSubKey("TestSettings")
testSettings.SetValue("Level", "Intermediate") ' String to SZ value
testSettings.SetValue("ID", 123) ' Integer to DWORD value
Using teh Win32.Registry methods, you have no control over what value type is written to the registry. It's just set by teh SetValue method based on the type of data that is passed into the 2nd parameter of the SetValue method.
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
im encountering this error when i'm browsing my crystal reports...
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: <b>BC30389: 'C' is not accessible in this context because it is 'Private'.</b>
Source Error:
Line 12: <body MS_POSITIONING="GridLayout">
Line 13: <form id="Form1" method="post" runat="server">
Line 14: <CR:CrystalReportViewer id=CrystalReportViewer1 style="Z-INDEX: 101; LEFT: 192px; POSITION: absolute; TOP: 35px" runat="server" Width="1029px" Height="1090px" ReportSource="<%# C:\\inetpub\wwwroot\reports\top10.rpt %>">
Line 15: </CR:CrystalReportViewer>
Line 16: </form>
Source File: c:\inetpub\wwwroot\Reports\WebForm1.aspx Line: 14
|
|
|
|
|
try to change C:\\inetpub\wwwroot\reports\top10.rpt
in
'C:\inetpub\wwwroot\reports\top10.rpt'
beware of the ' !
|
|
|
|
|
tried doing that already but its not yet working... i think it has something to do with the OS..
|
|
|
|
|
I'll stake my like on it NOT being the OS. The problem is in your code.
You have something like this:
<CR:CrystalReportViewer id=CrystalReportViewer1 style="Z-INDEX: 101; LEFT: 192px; POSITION: absolute; TOP: 35px" runat="server" Width="1029px" Height="1090px" ReportSource="<%# C:\\inetpub\wwwroot\reports\top10.rpt %>">
The problem is that everything inside the <%# > is being interpreted as CODE and not a filename. Whatever code your using to put that filename in that place is where the problem is. the end result line should look like this:
><CR:CrystalReportViewer id=CrystalReportViewer1 style="Z-INDEX: 101; LEFT: 192px; POSITION: absolute; TOP: 35px" runat="server" Width="1029px" Height="1090px" ReportSource="C:\inetpub\wwwroot\reports\top10.rpt">
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
i followed your advice but there was still an error..
Parser Error Message: Cannot create an object of type 'System.Object' from its string representation 'c:\inetpub\wwwroot\reports\top10.rpt' for the 'ReportSource' property.
hope you can help me again! thanks!
|
|
|
|
|
Like I said in my previous post ... Post the code. WIthout it, we can't see what's going on...
RageInTheMachine9532
"...a pungent, ghastly, stinky piece of cheese!" -- The Roaming Gnome
|
|
|
|
|
I'm taking a vb.net class. During one of the exercises demonstrated was how the keyboard responds to keypress,keydown, and keyup with a message box showing each action occuring. but the keyup never displayed the keyup message. can someone explain why the keyup did not display?
thanks
g
|
|
|
|
|
Messagebox.show runs modally and therefore will stop the keyup firing. If you use debug.writeline, or set the text of a label, you see the events firing, as in this code example below.
Create a form with a textbox (Textbox1) and three labels (Label1, Label2, Label3)
Add the following code
Private Sub TextBox1_KeyDown(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyDown
Me.Label1.Text = "KeyDown Fired : " & e.KeyData.ToString
End Sub
Private Sub TextBox1_KeyPress(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TextBox1.KeyPress
Me.Label2.Text = "KeyPress Fired : " & e.KeyChar
End Sub
Private Sub TextBox1_KeyUp(ByVal sender As Object, _
ByVal e As System.Windows.Forms.KeyEventArgs) Handles TextBox1.KeyUp
Me.Label3.Text = "KeyUp Fired : " & e.KeyData.ToString
End Sub
|
|
|
|
|
Hi,
We are trying to develop an tool that renders rtf from XML.
All things work fine, the styled view is OK
The major problem is rendering of table
The table is rendered correctly but the text donot wrap in the cell it flows across the boundaries.
From the search on Microsoft sites we found that the RichEdit dll version 4.1 supports it. It uses MSFTEdit.dll to solve the problem
But I don't know why the RichTextBox Control in System.Windows.Forms namespace in .Net is not functioning corectly. It looks like the control still refers to old version of DLL
Can someone help me in solving this problem. As it has come to a stage where the project cannot proceed and may be canned if this doesn't work
More details
OS: Windows XP and Windows 2000
.Net Framework: 1.1
Visual Studio.Net Version: 2003
Looking for a solution!!
Regards,
Nasir
|
|
|
|