Ake All Of The Cells 'blank'?
Mar 29, 2010I have a dataridview control whcih is NOT bound.
Is there a simple way to make all of the cells 'blank'?
I have a dataridview control whcih is NOT bound.
Is there a simple way to make all of the cells 'blank'?
How can I skip blank cells:
For x = 0 To datagrid1.Rows.Count - 1
For intI As Integer = 0 To datagrid1.Rows.Count - 1
[code].....
My Visual Basic .Net 2010 application reads data from an EXCEL spreadsheet which will be generated by my "customers". The responses to Alkis last year (23 July 2011) has been a big help and got me over a hump in my application. Now I am down to the last issue - how do I detect a blank cell? Valid data is numeric, starts at a fixed cell (A5 to be specific), and will be continuous until it ends with blank cells. While blank cells appear to print a "zero", when I try to use zero as an end criteria I get a 'System.InvalidCastException'. When I put in a specific end value (-1) in the last cell all works fine but that, of course, is an invitation to a user error.What is the difference between "Value" and "Value2" and where might I find documentation that explains the difference? [code]
View 1 RepliesMy main goal is to have an excel spreadsheet that automatically plots the overall success of my stock portfolio over time (% change over time). I've been able to incorporate stock data into my spreadsheet by linking it to the web, but the trouble is the spreadsheet will keep no history of what the previous stock values were, so I can't graph how things change over time. This sounds like it might be too complicated to be built in to excel, so I was wondering if anyone knew how to program this in Visual Basic. Maybe something like this.... If refresh then new cell plus new time stamp. Another possibility would be to have a whole bunch of cells that refresh only once but at longer and longer intervals, e.g.,
[Code]...
I have a DataTable and want to connect the cells of one of its columns to cells in some other DataTables.
For example:
DataTable1.Rows(0).Item(2) is connected to DataTable2.Rows(4).Item(6)
DataTable1.Rows(1).Item(2) is connected to DataTable4.Rows(2).Item(3)
DataTable1.Rows(2).Item(2) is connected to DataTable3.Rows(11).Item(4)
...
How can I do this?
I have a a ComboBox bound to a DataSet. I would like to have combobox with very first row blank. How can I do this? I've tried following
[Code]....
I am using vb.net.I'll be using a datagridview which is bound to a datasource.Normally it'll load datas in first row(row(0)) to n th row,i want to load datas only from second row.my question is how to left the first row blank.
View 2 RepliesI've got a small VB.net 2010 project I made at home and then brought to work on a flash drive.However, when I opened the project at work, I found that my first form (Form 1) doesn't work correctly.It shows up in the solution explorer with the module icon instead of the form icon and if I open it it's just a blank empty document.When I run the project, it works correctly and Form 1 opens and appears as it should. I can also open the Form 1 design file and all the information is there, I just can't access it when I open the entire project.
View 1 RepliesI have
MyTeam.TabControl1.TabPages.Item(i).Text += myReader("FIRSTNAME") & ", " & myReader("LASTNAME") & vbNewLine
But this just changes the tab title. How do I add text to the blank form below it?
I've got a working chart (ASP.NET/VB.NET), over some selected periods of time it has no data, this is expected. When I select a period of time where there is no data I get no chart displayed, just a rectangle of the background colour of the chart.
What I want is to still display the titles, x and y axes etc when there is no data, just an empty chart.
I toyed with the idea of adding a data point outside the time scale of the chart and this worked, I then got an empty graph, but there must be a cleaner way to achieve this.
I am working on a timekeeping application, using Visual Basic 2008 Express edition with an Access 2000 database.The application requires the user to complete a timesheet by recording in tme and out time daily. Blank fields are perfectly frquent and perfectly legitimate.Using these lines of code it works perfectlywhen there is a time value in the database.[code]This indicates to me that the code to ignore a field containing nothing is not working
View 10 RepliesIts basically to compare the textbox is not blank
if not Convert.ToString(txtbox1.Text)=String.Empty then
or
if txtbox1.Text.Trim.Len>0 then
I am not sure about method to publish my program. But basically when I publish it no errors at all...I have database name usurfdb.mdb. I have set it build action to content and copy to outputdirectory = copy if newer.Should I amend anything on my usurfdbdataset1.xsd as well like I did on my .mdb?
Dim con As New OleDb.OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0;Data Source=|DataDirectory|u-surfdb.mdb;")
I am wondering, When I try to locate the location of my database after the program
I have 2 inputs from 0-180 for x and y i need to add them together and stay in the range of 180 and 0 i am having some trouble since 90 is the mid point i cant seem to keep my data in that range im doing this in vb.net
following is the code at button event which copy data from one DGV (dgvAccesList) to another DGV (dgvProbReport) and its working properly. Its paste data to 3rd and 4th column of destination DGV.But the problem is that, if at source DGV first column and second column have data..lets say up to 2 rows..then its copied data starting from 3rd row..for the 3rd and 4th column..which is incorrect..its should be always start with first row of third and fourth column.
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
For Each dgvRow As DataGridViewRow In dgvAccesList.SelectedRows
Dim dgvNewRow As New DataGridViewRow
dgvNewRow.CreateCells(Inward.dgvProbReport)
[code]....
Basically I would like to have an sql statement which selects all the bookings from a table in microsoft access callled tblBookings where a certain date (selected by a datetimepicker) selected in vb.net.
The field the date is in access is bookingsdate and that is a shortdate aswell.
The problem is that even if the dates are the same the headers come up in the datagridview but no data.
This is my code:
Dim con As New OleDb.OleDbConnection
Dim OleDBCon As System.Data.OleDb.OleDbConnection
Dim ds As New DataSet
[Code].....
i have coded as below but once the record deleted and when the application write to text file again it gives an error says index was outside the bounds of the array any solution?
Dim stream As New IO.StreamWriter("C:Documents and SettingsAdministratorDesktopBill PaymentBillPaymentRecords.txt", False)
stream.WriteLine("")
stream.Close()
How could i insert blank row in excel using vb dot.code?
View 1 RepliesAll about datagridview,i entry the data from textbox to dtgridview the format is DATE normally ,if the textbox have a date that dtgridview can accept but when i leave blank and add to dtgridview..the message error""could'not store<> field".
My question is it possible make conversion from date to string??What code to put at the textbox or in cell_formating??what i try is..
if dgv.row(e.rowIndex).cell("dateRec").value="" then
e.value=""
e.formattedapplied=true
end if
in VB6, to reset an xml file was XMLfile.code = " " used? this is in my code and i would like to know how this can be changed over to VB.Net, I also have XMLfile.tabstyle = "RA" and XMLfile.frame = "all" how can i do this in .Net, also i would like to set XMLfile to have the structure of an XML document like i would set the counter 'i' to be an integer.
Is this possible? What namespace is it in? If you're not living on the edge, you're taking up too much room
following is the code at button event which copy data from one DGV (dgvAccesList) to another DGV (dgvProbReport) and its working properly. Its paste data to 3rd and 4th column of destination DGV.But the problem is that, if at source DGV first column and second column have data..lets say up to 2 rows..then its copied data starting from 3rd row..for the 3rd and 4th column..which is incorrect..its should be always start with first row of third and fourth column.[code]
View 2 RepliesI decided to explore deeper into how blank forms and controls are created.I don't know where to start. I'm not expert by any means I believe I just now the basics.I tried and start new project but instead of windows form template I used Blank Project. Added a module and creating sub main.I created a new class and copied few lines from a previous project and it gave me several errors.Brushes, Color, Font, Graphics are not defined. I am not sure if it's correct but when I added System.Drawing Reference and System.Drawing Namespace the errors was removed.Moreover, 'My' is not declared.
I would like to know what basic references and namespaces I need to add.(Note: I tried to add all the referenced and namespaces found when I create a windows form project but the errors was not removed)Moreover, how to create my own form and controls.
read code below as soon as user lefts field blank he should get the mesage thats what i am creating but ofcorse this code creates a bug and i get that message once for first textbox then for second and this process continues till i stop the project app gets stucked between thease two textboxes?
Private
Sub fname_LostFocus(ByVal sender As Object, ByVal e As System.EventArgs) Handles fname.LostFocus
If fname.Text = "" Then
[code]....
I try to view a datagrid with one empty row in it when the form loads. The datagrid has to be bound to a datatable all the time.I get a NullReferenceException with the following
Dim dt As DataTable
dt = CType(Me.grdDataGrid1.DataSource, DataTable)
Dim newrow As DataRow = dt.NewRow()
newrow(0) = 1100
dt.Rows.Add(newrow)
The error occurs on the line where dt.NewRow() is used.The problem occurs when the datatable (and the datagrid) is empty. If they have data, this works ok.What do I have to do to get this to work with empty datagrids?
I have an open file dialog that shows when a button is clicked. Last night it was working fine. This morning I am testing some code and when I click the button to open the dialog the entire form is blank accept the dropdown for filename and the ok and cancel buttons. What happened? I have tried deleting the dialog and the put it back but it still does the same thing.
View 7 Repliesi've made a webbrowser and its simple and i make a code for the pop up window like open a newwindow of the webbrowser... however i will post my code and my pop up screen with the source code of the pop up
View 3 RepliesMy Gridview has following Fields
ID Product Price ($)
1 Pencil 1
2 Pen 1
3 Rubber 2
I want to calculate the total price of price fields in Gridview Footer ...ie..
Total Price = 4
How to do it using VB.NET ?
I wonder how I can subtract cells in VBA? I want to use an For-loop that subtract column "B" with column "C". I want it to take all the values in kolumn "B" minus ( - ) all values in column "C" in the whole range.
View 12 RepliesI'm trying to make a notepad, but I can not get it to open files on start up.what i mean, example, I right click on a text file on my desktop and select open with and then my program(it opens the program with a blank textbox, it does not open the text file)I do not know the code for makin this come true
View 4 RepliesAnyone know why the following is not working?
[Code]...
I get no errors, it just returns a blank string.
I have an array x in size of objects (between 1 and 100) and I want to increase the size to 101 ... I've resized the array and that adds the objects but unfortunatly (not suprising) the added items have not been initialised, do I've reverted to using a do while loop and adding the elements indiviually, but looking at the code around it where addrange is used extensivily, I was just wondering if that was a neat vb.net way of doing the same thing
Bit of a learning question, just looking for neat ways to do the same thing