|
The error message suggests that you are trying to use some invalid value in the settings. What does strbaud contain?
Despite everything, the person most likely to be fooling you next is yourself.
|
|
|
|
|
strbaud is Global Integer Variable.
This will contain bandwidth. Normally it contain 9600.
|
|
|
|
|
try this....
replace
.settings =strbuad & "n,8,1"
with
.settings = str(strbuad) & ",n,8,1"
Rajesh B --> A Poor Workman Blames His Tools <--
|
|
|
|
|
in my application i want to disable or visible a perticular cell in datagridview in load time the grid by coding
i write just like this
me.gridview1.row(2).cells(4).visible = false
in this coding that give me the error of readonly properity
can i visible or disable to perform in perticular cell please help me in this and give me some example please it's urgant....
|
|
|
|
|
I don't think you can hide a cell, you can hide a row or column and you may have control of enable on the cell.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
As the previous poster said, I don't think you can hide a cell but you can disable it with the 'ReadOnly' property. i.e.
me.gridview1.row(2).cells(4).ReadOnly = true
|
|
|
|
|
Thanks to Replay
I know that this thing ?
if u have a some idea of cell will be visibel false so please give me some example
modified on Wednesday, January 7, 2009 7:10 AM
|
|
|
|
|
You can't make a cell invisible, well at least I pretty sure you can't. Ypu can make an entire column invisible but not a single cell. All you can do is disable it by making it readonly.
For what purpose do you want the cell not to be visible? Maybe there is another solution to your problem.
|
|
|
|
|
that's use in userrigths
1) in my application first i fill all data in the datagridview through dataset
2) than after i want to give the rights like add,update and delete
3) in my application the delete are not in some form so that not display in gridview just that's purpose i want to not show that perticular cell in datagridvie
my datagridview look like this
colum 1 colum 2 colum 3 colum 4 colum 5 colum 6 colum 7 colum 8
checkbox formname checkbox add checkbox delete checkbox update
remark: checkbox manse thats are checkbox cell
Add: Add meanse that's just the heading of colum 5 of the checkbox of add rigths
example :
in my shiftmaster form delete are not in so in that time in grid view the colum 5 and colum 6 are not display
if u have a another idea so please give me thanks you
|
|
|
|
|
I would highly suggest changing your design. You can NOT hide individual cells in a DataGridView. Changing the colors of the cell so the foreground matches the background also will not work because the user can just select the contents of the cell to invert the color of the background. The only way I can think of doing this would be to override the drawing of the DataGridViewColumn this data is in and paint it only if your conditions are met. But, this is quite a bit work to pull off and way beyond the scope of a forum post. I suggest Google for something like "Ownerdraw DataGridViewColumn" for examples.
|
|
|
|
|
Hi
I am having the following problem with a data grid (This is my child grid). My data grid is bound to a binding source which is bounded to a dataset filled with data.
I want the user to be able to add new rows and as they add rows certain fields needs to be populated (There fields is not visible in my grid) with data from my parent dataset.
I add the data in the following handler
AddHandler dataset.table.TableNewRow, AddressOf AddNewPreRow
Private Sub AddNewPrePopulatedWarehouseLocationRow(ByVal sender As Object, ByVal e As System.Data.DataTableNewRowEventArgs)
e.Row.Item("ColumnName") = CStr(SelectedParentRow.ColumnName)
End Sub
If the user moves to a new row the values is populated (if I make the invisible columns visible I can see that they do get populated) and if the user goes back the row
disappears like i want to. I also do a validation on the CellEndEdit and in here I make use of the rowindex.
But the problem comes when the user goes to the new line enter a value in the first cell (By this time the dgv seems to be taking this as a new row and it is not "Dirty anymore"
And it shows a new line with * beneath this line) which is all ok.....
This far we have 2 lines -
1. The line that i just created and added info into the first column (This line has a pencil next to it)
2. An empty line beneath it (This line has a * next to it)
If i use the mouse and click on another row
1. The newly add line with the pencil next to it cleans itself (I suppose this is because i did not enter all the required fields yet and the data binding discards the data)
But the empty line remains there
2. Now the validation fires for this line and a get a Index <XX> does not have a value
3. There is now 2 empty lines then new one now has a Play button sign and the line beneath it has a *
In my validation i check for the following to execute validation
If (dgv.Rows(RowIndex) IsNot Nothing) AndAlso Not dgv.Rows(RowIndex).IsNewRow AndAlso dgv.IsCurrentRowDirty Then --> result in true
Please if someone knows how to fix this i will appreciate it.
Thanks,
Chris
|
|
|
|
|
sorry I'm not going to be able to help I gave up on grid editing in VB5.
I use a different design paradign, Grids are stupid, they are ONLY used for displaying and sorting lists. I used to use listviews but a grid is actually faster loading. I then add a context menu for Add/Edit/Delete which open a seperate dialog where the user does the CRUD work. When the user returns the grid is repopulated from the database.
This eliminates ALL the hassles you have around user interaction with the grid and which events to handle. Think about the DetailBlock in ASPx. the only issues is reloading the DGV and the inevitable flash as it reloads
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
I agree with Mycroft. I try not to allow any editing in a DGV, unless absolutely necessary. Using a seperate data entry form gives you more flexibility and maintainability with lower cost in code.
|
|
|
|
|
Hi
Thanks for your comments. Appreciate it.
The reason why I want to use grids is because I have 2 tabs on my form....
Summary And Detail tabs. The summary is an Overview of my header (DGV) and the details display the parked line of the summary tab with some more information in text/combo/check....
Below that I have another tab control with child related information.
....for argument sake...
I have a Summary Tab that displays Lecturers at a varsity. A details tab with more information about the lecturer. Below that I have a tab controls with tabs about which classes does this lecturer have...
If I make this a separate window again I think the form will be too cluttered.
What I have done in the mean time (but I think it is dodgy coding) is catching a IndexOutOfRange exception and do nothing about it.
Thanks,
Chris
|
|
|
|
|
Hi all,
I'm trying to use an XPath query on an HTML page, but XPathDocument throws an error and will not continue. The code I am using at the moment is this:
Dim doc As XPathDocument
Dim nav As XPathNavigator
Dim elems As XPathNodeIterator
Dim req As WebRequest = WebRequest.Create("http://www.geocaching.com/seek/cache_details.aspx?guid=e77eaad6-4a01-4c14-827f-808e9d771270")
Dim response As HttpWebResponse = CType(req.GetResponse(), HttpWebResponse)
'Create an XPathDocument from the stream
doc = New XPathDocument(response.GetResponseStream) '<<<<<<----- Error raised on this line
'Create the navigator
nav = doc.CreateNavigator
'Grab something using XPath
elems = nav.Select("id('CacheName')")
The error message I'm given is "'if' is an unexpected token. The expected token is 'CDATA['. Line 13, position 8." as an XmlException. I assume that this is due to invalid HTML, as the code works fine for other URLs.
Any ideas how to get this to work?
Thanks very much in advance.
|
|
|
|
|
Member 4369916 wrote: I'm trying to use an XPath query on an HTML page,
Using the standard XPathNavigator in the .NET Framework, that's not going to work. HTML, though it resembles XML, is not XML. There's too much flexibility allowed in HTML that is totally unacceptable in an XML document, as you've found out.
You'd have to derive your own XPathNavigator class to handle HTML, in which you'd have to provide code for some 20+ methods to get this to work. You can find an example of this here[^].
|
|
|
|
|
Of course, HTML isn't XML unless it's XHTML! Thanks for the link, I think writing my own class to parse the HTML is a bit beyond me but the class on zverovich.net looks pretty good.
Thanks very much for your help!
|
|
|
|
|
Hello
I need to create a save function which saves the changes done to my application at runtime, so it can be openned later. Does anyone have an idea?
Thank You
|
|
|
|
|
|
I have two forms form1 and form 2.
Form1 is added as a control to form 2.
There is a listbox (listbox1) on form2 that i want update from form1 but I am unable to this.Actually i am unable to update anything on the main form from the embedded form.
I typed this in form1,
"form2.listbox1.items.add"
but it isn't working.Please advise
|
|
|
|
|
I would think you would have to use events to trigger changes to a parent form...
|
|
|
|
|
ok....how would the code look like for such an event?
I tried this snippet which i found online but it didnt work
I am quite new to this so i dont know exactly what it does
In child form...
Public Class
Public Event addtolist as EventHandler
'
Private sub()
'
' some code
'
'
RaiseEvent addtolist 'where i want to add to the listbox in parent form
'
'
End Sub
End Class
But I don't know what to do after this.Where do I add the code to add text to the listbox in parent form?
|
|
|
|
|
In your parent class you have to subscribe or handle that event and then trigger whatever you want done. Good use of research, you're making great progress.
|
|
|
|
|
Ok...but how would i handle or subscribe to that event from the child class?
Do i create a sub in the parent class with the same name as the event?
|
|
|
|
|
check this[^], this[^], and this[^].
Specifically do research on the handles[^] keyword. You are throwing an event, you need to handle it.
Best of luck you're almost there.
|
|
|
|