//let me assume you have object called IntPoint that store x and y values and list holder
List<intpoint> pointList = new List<intpoint>();
//when you want add to list check//let assume you have new IntPoint object called intPointif (!pointList.Contains(intPoint))
hope will help
dhaim program is hobby that make some money as side effect
As I said avoid adding duplicates initially. This code will attempt to add Point(1,1) ten times but the list will only contain the one entry.
List<Point> listPoint = new List<Point>();
pointToAdd = new Point(1, 1);
for (int i = 0; i <= 10; i++)
If you really need to remove, I think the way is to create a new 'clean list' by iterating through the current list, checking before adding to the new list and then assigning the clean list to the old one.
List<Point> CleanList(List<Point> listPoint)
List<Point> cleanList = new List<Point>();
foreach (Point currentPoint in listPoint)
Then you can simply call listPoint = CleanList(listPoint);
The free PowerCollections [^] library has methods for this kind of thing. It's very easy to use if you're already comfortable with generic collections (which you should be if you're using .NET 2 or higher).
In a Forum we Help people Who got Stuck while Attempted to do something. You did not Attempt anything and you did not Attempt to make a reseasrch on Google on what is needed to build a POS System. please Next time Google before you ask Questions or else you will get negavite answers from other members
I didn't think of that type of concept for the Tag property.
Regards, Thomas Stockwell
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.
I have a gridview, with a rowcommand. When I try to debug I can see it dosn't call the rowCommand (DeleteImage) Please can anyone tell me, why it does not run that rowCommand?
<code><asp:GridViewID="grdImages"runat="server"AutoGenerateColumns="false"AutoGenerateEditButton="false"BorderColor="Transparent"CellPadding="2"GridLines="vertical"CellSpacing="0"DataKeyNames="filename"ForeColor="Black"ShowHeader="false"onsorting="grdImages_Sorting"onrowcommand="grdImages_RowCommand"><RowStyleBorderStyle="Dotted"/><Columns><asp:TemplateField><ItemTemplate><imgsrc='<%#Eval("imgImage")%>'alt="Image"width="50px"height="50px"/></ItemTemplate></asp:TemplateField><asp:TemplateField><ItemTemplate><asp:LabelID="filename"runat="server"Text='<%#Eval("filename")%>'></asp:Label></ItemTemplate></asp:TemplateField><asp:TemplateField><ItemTemplate><asp:ButtonCssClass="buttonsSmall"ID="btnDeleteImage"OnClientClick="return confirm('Billedet vil ikke længere kunne vises på livesitet. Er du sikker på, du vil slette billedet?');"Font-Size="8pt"runat="server"Text="Slet"CommandName="DeleteImage"CommandArgument='<%# Eval("filename")%>'/></ItemTemplate><HeaderStyle/><ItemStyleHorizontalAlign="Center"/></asp:TemplateField></Columns><RowStyleCssClass="rowcolor"/><AlternatingRowStyleCssClass="alternatingrowcolor"/></asp:GridView>
protected void grdImages_RowCommand(object sender, GridViewCommandEventArgs e)
if (e.CommandName == "DeleteImage")
int imagename = Convert.ToInt32(e.CommandArgument);
string imagepath = Convert.ToString(Session["uploadpath"]);
File.Move(imagepath + '/' + imagename, Constants.ImageRecycleBin.UploadPath + imagename);
LoadImages(Convert.ToString(Session["uploadpath"]), "filename", "ASC");
You are redirecting standard output. As soon as make fills the output buffer, it will pause and wait until you read from the standard output. So you have a deadlock there, make is waiting for your process to consume output, and your process is waiting for make to finish. You need to start reading output right away after starting the make process.
the data does get bound, but the weird part is when i select a value in any one of the combo boxes ALL the combo boxes selected items change to that...
any ideas as to why? i really dont feel like making separate data sources for each one, it'll be redundant cuz all the combos have the same data.... but them sharing the same data source is the only reason that i can see for this strange behavior.
Harvey Saayman - South Africa Junior Developer .Net, C#, SQL
Well if you want your Combobox to Display data from one Data Source , it will be Simple, but the Behavior of Combox boxes in the Form will do , that am not sure why, but if you a for example searching based on what is selected , it will not give you a Problem, dont worry about it, i have never experienced a problem before and i understand what you mean. and if you want to bind your data fied to your Combobox, next time you can do it like this
//create a new dataset
DataSet dataSet = new DataSet();
//create sql command
SqlCommand selectCommand = new SqlCommand("Proc_SelectTimeCategoryName", sqlConn);
selectCommand.CommandType = CommandType.StoredProcedure;
//create data adapter
SqlDataAdapter dataAdapter = new SqlDataAdapter();
dataAdapter.SelectCommand = selectCommand;
//Fill the dataset
//Data Bind the combo boxes // //You Should Bind it like this /*
* comboBox6.DataSource = datasetname;
comboBox6.DisplayMember = "Tablename.Field";
comboBox2.DataSource = tCatTable;
comboBox2.DisplayMember = "tCat.TCat_Name_VC30";
comboBox3.DataSource = tCatTable;
comboBox3.DisplayMember = "tCat.TCat_Name_VC30";
comboBox4.DataSource = tCatTable;
comboBox4.DisplayMember = "tCat.TCat_Name_VC30";
comboBox5.DataSource = tCatTable;
comboBox5.DisplayMember = "tCat.TCat_Name_VC30";
comboBox6.DataSource = tCatTable;
comboBox6.DisplayMember = "tCat.TCat_Name_VC30";
Sometimes its not Necessaryto use datatable .remove that ValueMember property.
Hope it helps
Sorrow is Better than Laughter, it may Sadden your Face, but It sharpens your Understanding