Datagridview With Dynamic Range And Calculating Statistical Functions?
Dec 20, 2010
I have a timer, a textbox and a datagridview with 10 columns. I am running a timmer code (you can see below) and generating randomizes numbers to textbox. Then I am putting distributing this numbers to datagridview. i want to define a dynamic range. This range is important when I am calculating the some statistical function. This range will be used as a calculation period. I want to calculate MAX, MIN, MEDIAN, MODE of the data, written in the first column, in second, third fourth and fifth columns My datagridview is like this and I am trying to calculate MovingAverage, MAX, MIN,MODE and MEDIAN for last 5 data dynamicly!
Im currently working on a car service program on Visual Basic. The user simply selects some radio buttons, enters a couple of values and at the end the lablels are SubTotal, VAT and Total. Can anyone tell me how I calculate the VAT, the VAT rate I need to use is 20%. I currently have an appropiate answer for the Sub Total. I know I need to multiply the SubTotal amount by 0.2 but how do I do this using Procedures and Functions?
Having created a small (Excel Automation) VB Appl. to manipulate and present data from Excel sheets in an organised form, I ran across a problem resulting from creating a named range on a sheet, the code line:
seems to work as expected, my only issue here is that this was written on a System that is US-en, and when trying this on a PC DE-de - we have users with varoius language sets - the code fails with a COMException. The only cure I have found to date, is to write the German language version of this:
How can I write my code / what tools do I need to use, in order that my application will work with any Excel language - and me not having to know all possible equivalents for a particular command or function?
Can anyone provide an example of .NET scripting? Some dynamic languages support functions like eval() or compile() than let you compile and execute a string in run-time. VBCodeProvider seems to be a related namespace, but i can't find an example showing how to compile and execute code. Edit: I'm developing a ASP.NET site using VB.NET. Some behavior need to be dynamic and scripted.
I have probably not a unique issue but I can't seem to figure it out. I need to calculate a datagridview column after it a new row has been added to it. I am adding the row to the datasource and the row is added to the datagridview but how can I automate the two thing together by a single button click. IE: add the row (with a value)to the gridview and then calculate. I have this code but is doesn't work.
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click Dim OwnerID As Integer
I have developed a script in R-Statitical that traces the travel paths of a given person on a network, however, the client is not comfortable using R for this task. They are wanting to use VB or C#. Does anyone know if a conversion/translation tool that can quickly and easily convert from R-Statistical to VB or C#?
Using VB .NET, I am wondering about the best way to get some statistical data out of a Datatable. I would rather not hit the database with another query, but just look through the datatable I already have. So, Linq must be the answer? I have a datatable (dtable) containing two columns: tech_id and colour. From this, I would like a new datatable containing three columns: tech_id, colour, and count. Of course, I'm trying to find out how many times each "tech_id" used each distinct "colour".
Something like: tech_id colour count ------------------------------ JM brown 18 JM purple 10 JM green 3 PB brown 51 PB grey 8 TD brown 4 TD pink 67 TD grey 41
My best attempt with Linq is not at all correct, but is pasted below to show how far I've got: Dim ColourCounts = From p In PGWorkingDataTable.AsEnumerable() _ Group p By p.Field(Of String)("colour") Into Count() _ Select tech_id, colour, ColourCount = Count Dim colourStatsTable As DataTable = ColourCounts.CopyToDataTable()
I'm having problem in my code it doesn't work properly.. please have a look
Imports System.Text.RegularExpressions
Dim mytext1() As String
Dim mytext2() As String
[CODE]...
I want to decide about the sample text that from which of two Richtextboxes it has been take, so i tried my level best to do it but here are some errors. can any one remove them?
I have a datagrid view with some data in it. The first column (0) is called 'Date' and contains the dates I want to work with.What I would like is to be able to filter (only display) the data between a date range selected by the user using 'Datetimepicker1' and 'Datetimepicker2'
This is the code I have. its not right of course, but it may help explain what I'm trying to achieve, I wonder if someone could give me a pointer?
im doing an employee attendance monitoring system, and i need to have a search feature which shows an employee attendance record in a given range of dates
I am pulling data from a SQL server database into a dataset. The date are a DateTime type:
[Code]...
I can see the data in the field reads: 2011-09-09 15:56:29.667. I have tried to convert this by adding convert(varchar(10),DateFrom,103) which results in 09/09/2011 and then Custom Formated the DateTimePicker but still no success.I think I might be going completely off track here so can someone guide me on where I am going wrong here or the best way of doing this
I am using this to populate column1 combobox from a text file and it works fine.[code]I tried to add a number range using this to populate columns 4 and 5..[code]The number range populates the combobox(CB) fine but when i select a number from the CB it causes a error and selects the first item, the error loops evertime the mouse hovers over the CB..[code]
I'm loading a table from a MySQL-server, which loads fine, but I also get the following error: Error 5: Index was out of range, Must be non-negatives and less then the size of the collection. Parameter name: index
This is how I load the database: vb.net mysqlAdapter.SelectCommand = mysqlComm mysqlAdapter.Fill(mysqlTable) mysqlReader = mysqlComm.ExecuteReader
While mysqlReader.Read sbar_progress.Value += 1 beslag_dg_beslag.DataSource = mysqlTable End While
I get an error on the last line of sub where I am trying to assign a combobox to a column which is a textbox.error:Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index[code]....
i'm trying to do something like dynamic search. I got a Datagridview1 and Textbox1, what i want to do is when i type something to Textbox1, Datagridview should change dynamically. When i type something to Textbox1 it gives this error: "No data exists for the Row/Column." Here is my code :
I have a datagridview which get filled with an sql query like this;
Dim strQuery As String = "SELECT * FROM tablename" SQLConn.ConnectionString = ConnectionString SQLConn.Open()
[Code]....
Now I wanted to add a textbox that works like a filter when someone enters some text in the textbox the ontextchange event add's a LIKE filter for that word on columnname1.
Is something like that possible on the way how I fill my datagridview? On google you'll get some examples only those are with a bounded dataset and that's not working with my datagridview.
I need to design a search/filter for a DataGridView. The search contains 2 comboboxes and 1 textbox. combobox1 are the field names, combobox2 is the criteria (=, <>, like), and the textbox is to input values.
For example:Users will select the Road Name field from combobox1, "=" from combobox2, and Main St will be typed in the textbox. After a button is pressed, the datagridview should filter to whatever the user inputs.
I need to do in other platforms but seem to be having some issues with VB .net 2008.I have a datagridview bound to an SQL table that has several comboboxes.the rowSource (is it called that still?) for each of the comboBoxes are SQL lookup tables that I've created and based on the the users selection in ComboBox1, comboBox2's datasource may change.What I want is, if the user picks "Dental" from ComboBox1, I want comboBox2 to load Dental plans (Which I have working, no problem here I think).And if they pick "medical" in ComboBox1, comboBox2 loads medical plans in comboBox2 dropDown list, which, again that part seems to be working.If in the first row in the DGV,the user selects "Dental" for comboBox1 and then a Dental plan in ComboBox2,on the next row, if the user inputs "Medical" in ComboBox1, the first rows ComboBox2's "Dental plan" info disappears.
The medical plan can still be selected and displayed in row 2's comboBox2 (so the changing of the datasource is working)If you then click anywhere in the first row, ComboBox2's dental plan appears again but Row2's combobox2 now no longer displays the medical plan.Becuase whatever value you choose, no matter if it's a medical or dental plan, the info gets saved in the DGV bound table, shouldn't it display the saved information from the DGV's source and not the shifting comboBoxes datasources?
I am relatively new to C# and winforms, although I have been using Java for years, so forgive me if im asking something relatively straightforward!I have a DataGridView, it needs to update regularly so I wish to provide a Collection of objects as its DataSource and NOT a database table.So far I have a List<MyObject> which will be constantly updated via a BackgroundWorker thread. I want my DataGridView to update when a change has been made to the List i.e. if the objects are resorted, added to or deleted from etc.Currently my DataGridView only displays the first object I add to the List, if I add more the DataGridView doesn't update to display the new objects added.This is a basic overview of how im coding it:
private List<MyObject> myList= new List<MyObject>(); myDataGridView.DataSource = myList; Then my BackgroundWorker thread updates the list, e.g.
I am attempting to set up a datagridview that is dynamic based on user input. The user input is a start and end date. The start date defines the first column the next column is the next date... until the end date (x-axis). The y-axis is technicians and the fields will show the assignment for the technician on that date.
All the advise I am seeing on datagridviews is to create a property methods to provide the information for each column. for example:
Dim 12-Oct-2009 as string Dim 13-Oct-2009 as string
[Code]...
How do I create a object data source that allows me to populate the data grid? I want the column headers to be included as a string in row 0 of the multidimensional array. The amount of columns will be dynamic with a minimum of 1 and maximum viewing of 100 days based on what dates are selected in the start date and end date fields.The input dates will be used to generate a query to a database that will populate the multidimensional array.One solution I see is pick a start date and have a set number of dates and code for set number of columns (100) in a row and then set the names of the columns dynamically...ahhhh code repetition!
I am not sure how else to do this but looking for a more suttle way.I am using this to create a simple scheduling tool to see resource schedules by date. There is an unmoveable end date so initially I will need to look ahead 100 days but as the end date gets closer, I will have fewer and fewer dates. So eventually the end date will be that start date.
I am developing a windows application. i have a datagridview whose datasource is a binding source. Also I have this filter applied to the binding source
Dim txt As String = txt_itemcd.Text If String.IsNullOrEmpty(txt) Then bs.RemoveFilter()[code]....
i want when user clicks on any cell of the datagridview, the data in that row should be filled in the respective text boxes. how is that???Actually I had this code
Private Sub dg_item_CellClick(ByVal sender As Object, ByVal e As System.Windows.Forms.DataGridViewCellEventArgs) Handles dg_item.CellClick con.Close()[code]....
but since when i hv applied binding source, the error comes up "Index out of range"
Using: Programming Software: Visual Basic 2008 Express Database Software: Sql Server Express 2008 Here's the quicky on the problem I'm having: I've got a datagridview bound to a dataset and on first load everything runs fine. However, when I remove a record from a table and try to reload the datagridview, I come accoss an error saying the index is out of range. Here's the code:
I am using the following code in the Load method of a VB form to generate random numbers in the range 1 to 8. Without fail after enough loops the range is exceeded and 9 is the random number returned every time. The line using the Rnd function is from: Rnd Function (Visual Basic)
I am getting the error:"Range variable 'sender' hides a variable in an enclosing block or a range variable previously defined in the query expression."for this
Imports System.Data.SqlClient Imports System.Linq Public Class Form1
[code]....
I can select any other item from the table without the error. "sender" has the same properties as "receiver" in the SQL table.