698 Posted Topics

Member Avatar for Sarazine

You dont have a StoreItem class. Youare trying to instantiate an object from a class that doesnt exist. Did you write a class and not include it here? If not, how does a StoreItem differ a SaleItem?

Member Avatar for Geekitygeek
-1
136
Member Avatar for ctrl-alt-del

Bookmarked! Respect earned, and rep to follow shortly :p Nice article, i can guarantee your code will be popping up in my apps from now on :D

Member Avatar for Geekitygeek
0
287
Member Avatar for sivananda2009

there are a great many tutorials on how to work with datagrid's and external data sources: [URL="http://www.google.co.uk/search?hl=en&source=hp&q=tutorial+datagrid+bind&meta=&aq=f&oq="]tutorials[/URL]. If you get stuck with a specific problem you can start a specific thread to get help :) Remember to mark the thread as solved

Member Avatar for sivananda2009
-2
153
Member Avatar for tryongliph

Collections and arrays in C# are 0-based. That is, the first item in the collection is at index 0. So if your prevData contains 3 items they will be indexed 0,1 and 2. Do you have more than three items in the list?

Member Avatar for Geekitygeek
0
195
Member Avatar for freddyfly

[QUOTE=sknake;1007885]Since this is more of a parent:child relationship would it be acceptable to have a second grid that would list the swimmer's times when you chose a name in the main grid?[/QUOTE] seconded, i would either populate a gridview or a combobox with the swimmer names, then put their times …

Member Avatar for sknake
0
1K
Member Avatar for mldardy

Try changing this: [CODE] if (item.Name == "Real Estate Forms 2d") { objCart.TaxRate = 0.06; } objCart.TaxRate = 0.00; [/CODE] to this: [CODE] if (item.Name == "Real Estate Forms 2d") { objCart.TaxRate = 0.06; } else { objCart.TaxRate = 0.00; } [/CODE] Without the else, you are setting the taxrate …

Member Avatar for mldardy
-1
126
Member Avatar for ammaiappan

There is a lot of info online about using a datagridview. I recommend you start [URL="http://msdn.microsoft.com/en-us/library/e0ywh3cz.aspx"]here[/URL]. For the calculated column, you can check out[URL="http://msdn.microsoft.com/en-us/library/system.data.datacolumn.expression(VS.80).aspx"]this article[/URL]. If you get stuck feel free to open a new thread with specific problems. Remember to mark this thread as solved.

Member Avatar for Geekitygeek
0
87
Member Avatar for vinnijain

try replacing [icode]private static char[] GetChars()[/icode] with [icode]private static List<char> GetChars() [/icode] and [icode]private static readonly char[] allowedCharacters = GetChars()[/icode] with [icode]private static readonly List<char> allowedCharacters = GetChars() [/icode]

Member Avatar for vinnijain
0
337
Member Avatar for avirag

try this: [CODE] string text = textBoxEquation.Text; int index = textBoxEquation.SelectionStart; text = text.Insert(index, "รท"); textBoxEquation.Text = text; textBoxEquation.Focus(); textBoxEquation.SelectionStart = index + 1; textBoxEquation.SelectionLength = 0; [/CODE] That will result in the character being added wherever the user is currently typing rather than on the end of the string …

Member Avatar for Geekitygeek
0
193
Member Avatar for avirag

Google keep ther algorythm to themselves since it is the cornerstone of their business. If everyone had the algorythm then anyone could build a competitive search engine. But as for how search engines work and rank pages there is a lot of info out htere so use that secret google …

Member Avatar for Diamonddrake
4
149
Member Avatar for omotoyosi

Rather than perform a postback every time the text changes, you can use Javascript locally to change the buttons visiblity whenever a key is pressed in textbox: [CODE] Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load TextBox1.Attributes.Add("onKeyUp", "ChangeButton()") End Sub [/CODE] then your javascript in page …

Member Avatar for Geekitygeek
0
118
Member Avatar for RunTimeError

That will make the snake grow, but didnt the snake traditionally grow at the tail end, not the head end? What i mean is, when you hit an apple, the head moves on as normal but the tail stays put for one turn, thus the snake grows by one square …

Member Avatar for Geekitygeek
0
380
Member Avatar for Gaurav arora

Shilpa88, if you have a problem that you need help with, please look for a relevant thread or start a new one yourself. Please dont add unrelated questions to current threads.

Member Avatar for Geekitygeek
0
253
Member Avatar for avirag

Hey sknake :) Great code, i just had one query. Is it better to manually loop through the array to find matches? I use predicates with the List.Find method. Is there any kind of performance boost for either approach?

Member Avatar for avirag
0
146
Member Avatar for ShailaMohite

Hi, are you studying the same course as Vidya? You have both posted the same problem twice now :) Its usually best to see if someone has a similar problem before you post your own...that way replies and all relevent code are kept in one place. Heres what i told …

Member Avatar for Geekitygeek
0
127
Member Avatar for VidyaYadav

Heres some code demonstrating how to name the control at creation and adding an event handler to its Click() event. I have used the click event to delete the control: [CODE] namespace WindowsApplication3 { public partial class Form1 : Form { public Form1() { InitializeComponent(); } private void Form1_Load(object sender, …

Member Avatar for Geekitygeek
-1
2K
Member Avatar for ShailaMohite

You can select an image by clicking on it if you capture its Click() event. The following example shows how to add an event handler to the control at creation. When a picturebox is clicked on a border is added to highlight it and it is stored in a variable …

Member Avatar for Geekitygeek
0
6K
Member Avatar for procomp65

Hi, I would seriously recommend checking out some of the many tutorials on Regular Expressions. It is a powerful tool to have under your belt. Heres a function that will check your data and only allow the valid characters you listed. It will return false if there are double digits(if …

Member Avatar for Geekitygeek
0
2K
Member Avatar for EvilLinux

Hey, im about to nip out so i havent got time to go through it thoroughyl..but at first glance i noticed your calling the s.ToString() when you add the student to the list view. You haven't overriden that method so it will be calling the base method. In student class …

Member Avatar for DdoubleD
-1
967
Member Avatar for eeyc

Im not sure how to add the menu item, but to help make things clearer, by 'mark' you mean 'highlight' :) And the menu you are trying to add to is the context menu :) So you want to add an item to the context menu when right clicking on …

Member Avatar for Diamonddrake
-1
128
Member Avatar for wil0022

The point ddanbe was trying to make is that at Daniweb we help those who help themselves :[URL="http://www.daniweb.com/forums/announcement61-2.html"]http://www.daniweb.com/forums/announcement61-2.html[/URL] Your lecturer would have given you the basic concepts that you need to use, your job is to understand them by reading about them and experimenting with them. We will gladly help …

Member Avatar for ddanbe
-1
126
Member Avatar for theories

As i understand it a global variable is one that is accessible to ANY code in the program...that would be public static (as sknake mentioned) if im not mistaken. Global variables are best avoided, if you need to pass data between forms/classes use public properties. However, a private class level …

Member Avatar for theories
-1
191
Member Avatar for yorro

That depends. Are the values all of the same type? If so you can have the function return a typed list: [CODE] Public Function MultipleReturn() As List(Of String) Dim places As New List(Of String) places.Add("A") places.Add("B") places.Add("C") places.Add("D") return places [/CODE]

Member Avatar for TomW
-2
6K
Member Avatar for yorro

[CODE=vb] If myDialog.ShowDialog() = DialogResult.OK Then 'perform action based on user response End If [/CODE] Try that :) You call the the ShowDialog() method, then perform some action if the correct response is received.

Member Avatar for yorro
-1
158
Member Avatar for EvilLinux

k...firstly, when you use if/for/foreach/etc structures. You can ignore the {} if the code to be operated is a single line: [CODE] if (i==1) dosomething(); [/CODE] if you have more than one line of code to process within the structure then you need to encase them in {}. Secondly, when …

Member Avatar for Geekitygeek
-1
164
Member Avatar for Ishbir

The error occurs because you have declared item as a variable of type 'Post'. In order to access the members of its child type, you can cast it to the child type. As DdoubleD mentioned, you can use the GetPostType of the parent class to determine what you need to …

Member Avatar for Geekitygeek
-1
138
Member Avatar for Geekitygeek

Im working on a project and i'm stuck on the best route to take in designing a feature. Rather than go into detail about the actual project i'll use a simple example since the concepts are the same :) I have a panel on a form, the panel contains 100 …

Member Avatar for sknake
0
119
Member Avatar for =OTS=G-Man

Gah...beaten at the buzzer :p I was about to post the same thing almost verbatim sknake. Only difference was, i used [CODE]DateTime.ParseExact(date, "yyyyMMddHHmmssFFF", System.Globalization.CultureInfo.CurrentCulture);[/CODE] note to self...must type quicker :)

Member Avatar for Geekitygeek
0
359
Member Avatar for benkyma

I'm not 100% sure, but surely if resStream is a continuous stream of data then count will never reach 0 and your loop wont exit to print to the console? Try putting the Console.WriteLine inside the Do..While loop :)

Member Avatar for VinayRok
0
928
Member Avatar for Diamonddrake

[QUOTE=Diamonddrake;989378]I like the idea, but I would like to see an enum for the height. could that be done? so the height property would no longer be a int, but an emum. any Ideas how this could be done, I realize all this code is BS, but how could I …

Member Avatar for Diamonddrake
1
177
Member Avatar for TinoMclaren

Here you go: [CODE] //in designer: this.dataGridView1.RowsAdded += new System.Windows.Forms.DataGridViewRowsAddedEventHandler(this.dataGridView1_RowsAdded); //in code: private void dataGridView1_RowsAdded(object sender, DataGridViewRowsAddedEventArgs e) { if (cheque == true) { dataGridView1.Rows[e.RowIndex].Cells[2].Style.ForeColor = Color.Red; } else { dataGridView1.Rows[e.RowIndex].Cells[2].Style.ForeColor = Color.Green; } }[/CODE] every time you call dataGridView1.Rows.Add it will fire the event and set the colour :)

Member Avatar for TinoMclaren
0
6K
Member Avatar for Alba Ra

You beat me to it DdoubleD :p I was gonna point out those same points. Only other point i had was to check that GlobalVariables.countresultslots is set correctly at the start of the loop...since your using it to reference an array and incrementing it at the start of the loop …

Member Avatar for Geekitygeek
0
152
Member Avatar for TinoMclaren

Depending on how you want them to appear visually, i usually use a TabControl if i want different sets of controls that the user can switch between. If i want to change them in code in response to input then i normally design each of the panels, then place them …

Member Avatar for TinoMclaren
0
119
Member Avatar for cleonar

You'll probably get more help if you post this in the Web Development section..or the C++ section :)

Member Avatar for marco93
0
148
Member Avatar for ChinnuBlr

You rproblem is here: With cboxseldept .SelectedIndex = -1 you are changing the index whcih will fire the SelectedIndexChanged Event. To stop the tree populating incorrectly, alter the SelectedIndexChanged event to this: If cboxseldept.SelectedIndex > -1 Then PopulateTree()

Member Avatar for Geekitygeek
0
91
Member Avatar for Denxerator

You said the buttons 'name' doesnt change, but you are assigning a value to its Text property. The Text property is the string shown on the button, but the buttons name is used to identify it within the application. The code you have written will change the text on the …

Member Avatar for Geekitygeek
0
241
Member Avatar for TinoMclaren

Hi, your problem is that when you clear the selection of a datagrid it fires the SelectionChanged event...so selecting cell in A clears B which then clears A. Just add a check to ensure the selectionchanged event fired because something was selected: [CODE] private void dgv_B_SelectionChanged(object sender, EventArgs e) { …

Member Avatar for Geekitygeek
0
214
Member Avatar for flit07

You should avoid accessing the value directly, its bad practice (encapsulation). You should create a private variable in Form2 and change its value through a public property: [CODE] 'in form2: Private _myProperty As String Public Property MyProperty() As String Get Return _myProperty End Get Protected Set(ByVal value As String) _myProperty …

Member Avatar for flit07
0
200
Member Avatar for Learning78

The other option is to create a single, class level instance of Random which will be seeded when the form loads. Then use this one for all subsequnet calls. As sknake mentioned, the Random class is seeded based on the current system time in ticks. By creating the instance of …

Member Avatar for Learning78
0
164
Member Avatar for Geekitygeek

I'm currently re-writing a bit of code and i'm in two minds about which way to take it. Advice would be greatly appreciated :) The application is used to control a USB circuit board. The board has 32 analog outputs. The outputs are switched on and off by sending a …

Member Avatar for Geekitygeek
0
194
Member Avatar for phoenix_dwarf

Hi, I ran the same code and it focuses fine. You dont need to call [CODE] tabControl1.Focus(); [/CODE] since you then move focus to the textbox. When you set the SelectedIndex for the tabControl are you selecting the tab page which contains the textbox? The other thing to do is …

Member Avatar for Antenka
0
2K
Member Avatar for Twyce

EDIT: re-read your post and realised you need to poulate the list when the radio is changed, revised code :) Rather than checking each one for the check status, why not handle the controls check changed event to show list: [CODE] //in designer this.rdoHigh.CheckedChanged += new System.EventHandler(this.radioButton_CheckedChanged); this.rdoMedium.CheckedChanged += new …

Member Avatar for Geekitygeek
0
143
Member Avatar for jas05

try adding GridView1.Databind() at the end. also, try changing line 9 from [CODE] GridView1.DataSource = Ds.Tables;[/CODE] to [CODE] GridView1.DataSource = Ds;[/CODE] alternatively, if there is more than one table in the Dataset, then specify a table like so: [CODE] GridView1.DataSource = Ds.Tables[0];[/CODE] also, insert a breakpoint and check that the …

Member Avatar for Geekitygeek
0
102
Member Avatar for wil0022

a List<> is a member of the System.Collections.Generic namespace. It allows you to create a Typed Collection of variables. In this case it is a collection of integers. A list is a very flexible way of storing collections of variables as it allows sorting, finding, adding/deleting and doesnt require you …

Member Avatar for Geekitygeek
0
113
Member Avatar for xtremebeauty

Aye, and still no code...i think its a design issue. If ive read, it right he wants to put in a start and end destination and have the app calculate any landmarks passed along the way. AA autoroute scaled down to a university site.

Member Avatar for Geekitygeek
-2
257
Member Avatar for Geekitygeek

I have a Panel on a form to which i have added a selection of controls with (x,y) coordinates. The panel has Autoscroll enabled. If there are enough controls to require a scrollbar, and the bar has been scrolled down when the paint event fires, the controls all move down …

Member Avatar for Geekitygeek
0
722
Member Avatar for facadie

If all that form2 does is display the question and allow the user to click one of the buttons then you can use the MessageBox class to do the same thing: [CODE] DialogResult result = MessageBox.Show("Do you want to save changes to your setting?", "Save before exit?", MessageBoxButtons.YesNoCancel); if (result …

Member Avatar for Geekitygeek
0
217
Member Avatar for Geekitygeek

Hi, This may be a simple issue, but im gettin nowhere trying to fix it. I have a form with a picturebox, the picturebox shows a map of our greenhouses. I want to be able to create clickable areas on the image. I have created a class to store each …

Member Avatar for ddanbe
0
119

The End.