Search Results

Search found 30 results on 2 pages for 'tlist'.

Page 1/2 | 1 2  | Next Page >

  • Delphi: Problems with TList of Frames

    - by Dan Kelly
    I'm having a problem with an interface that consists of a number of frames (normally 25) within a TScrollBox. There are 2 problems, and I am hoping that one is a consequence of the other... Background: When the application starts up, I create 25 frames, each containing approx. 20 controls, which are then populated with the default information. The user can then click on a control to limit the search to a subset of information at which point I free and recreate my frames (as the search may return < 25 records) The problem: If I quit the application after the initial search then it takes approx. 5 seconds to return to Delphi. After the 2nd search (and dispose / recreate of frames) it takes approx. 20 seconds) Whilst I could rewrite the application to only create the frames once, I would like to understand what is going on. Here is my create routine: procedure TMF.CreateFrame(i: Integer; var FrameBottom: Integer); var NewFrame: TSF; begin NewFrame := TSF.Create(Self); NewFrame.Name := 'SF' + IntToStr(i); if i = 0 then NewSF.Top := 8 else NewSF.Top := FrameBottom + 8; FrameBottom := NewFrame.Top + NewFrame.Height; NewFrame.Parent := ScrollBox1; FrameList.Add(NewFrame); end; And here is my delete routine: procedure TMF.ClearFrames; var i: Integer; SF: TSF; begin for i := 0 to MF.FrameList.Count -1 do begin SF := FrameList[i]; SF.Free; end; FrameList.Clear; end; What am I missing?

    Read the article

  • CVE-2012-1714 TList 6 ActiveX control remote code execution vulnerability in Hyperion Financial Management

    - by chandan
    CVE DescriptionCVSSv2 Base ScoreComponentProduct and Resolution CVE-2012-1714 Remote code execution vulnerability 10 TList 6 ActiveX control Hyperion Financial Management 11.1.1.4 Contact Support Hyperion Financial Management 11.1.2.1.104 Microsoft Windows (32-bit) Microsoft Windows (64-bit) This notification describes vulnerabilities fixed in third-party components that are included in Sun's product distribution.Information about vulnerabilities affecting Oracle Sun products can be found on Oracle Critical Patch Updates and Security Alerts page.

    Read the article

  • Is there a faster TList implementation ?

    - by dmauric.mp
    My application makes heavy use of TList, so I was wondering if there are any alternative implementations that are faster or optimized for particular use case. I know of RtlVCLOptimize.pas 2.77, which has optimized implementations of several TList methods. But I'd like to know if there is anything else out there. I also don't require it to be a TList descendant, I just need the TList functionality regardless of how it's implemented. It's entirely possible, given the rather basic functionality TList provides, that there is not much room for improvement, but would still like to verify that, hence this question.

    Read the article

  • How to modify TList<record> value?

    - by Astronavigator
    How to modify TList < record value ? type TTest = record a,b,c:Integer end; var List:TList<TTest>; A:TTest; P:Pointer; .... .... List[10] := A; <- OK List[10].a:=1; <- Here compiler error : Left side cannot be assined to P:=@List[10]; <- Error: Variable requied

    Read the article

  • Delphi : Handling the fact that Strings are not Objects

    - by awmross
    I am trying to write a function that takes any TList and returns a String representation of all the elements of the TList. I tried a function like so function ListToString(list:TList<TObject>):String; This works fine, except you can't pass a TList to it. E2010 Incompatible types: 'TList<System.TObject>' and 'TList<System.string>' In Delphi, a String is not an Object. To solve this, I've written a second function: function StringListToString(list:TList<string>):String; Is this the only solution? Are there other ways to treat a String as more 'object-like'? In a similar vein, I also wanted to write an 'equals' function to compare two TLists. Again I run into the same problem function AreListsEqual(list1:TList<TObject>; list2:TList<TObject>):boolean; Is there any way to write this function (perhaps using generics?) so it can also handle a TList? Are there any other tricks or 'best practises' I should know about when trying to create code that handles both Strings and Objects? Or do I just create two versions of every function? Can generics help? I am from a Java background but now work in Delphi. It seems they are lately adding a lot of things to Delphi from the Java world (or perhaps the C# world, which copied them from Java). Like adding equals() and hashcode() to TObject, and creating a generic Collections framework etc. I'm wondering if these additions are very practical if you can't use Strings with them.

    Read the article

  • Strange EListError occurance (when accessing variable-defined index)

    - by michal
    Hi, I have a TList which stores some objects. Now I have a function which does some operations on that list: function SomeFunct(const AIndex: integer): IInterface begin if (AIndex > -1) and (AIndex < fMgr.Windows.Count ) then begin if (fMgr.Windows[AIndex] <> nil) then begin if not Supports(TForm(fMgr.Windows[AIndex]), IMyFormInterface, result) then result:= nil; end; end else result:= nil; end; now, what is really strange is that accessing fMgr.Windows with any proper index causes EListError... However if i hard-code it (in example, replace AIndex with value 0 or 1) it works fine. I tried debugging it, the function gets called twice, with arguments 0 and 1 (as supposed). while AIndex = 0, evaluating fMgr.Windows[AIndex] results in EListError at $someAddress, while evaluating fMgr.Windws[0] instead - returns proper results ... what is even more strange, even though there is an EListError, the function returns proper data ... and doesn't show anything. Just info on two EListError memory leaks on shutdown (using FastMM) any ideas what could be wrong?! Thanks in advance michal

    Read the article

  • Do I have to allocate and free records when using TList<T> in Delphi?

    - by afrazier
    The question more or less says it all. Given the following record structure: type TPerson = record Name: string; Age: Integer; end; PPerson = ^TPerson; TPersonList = TList<TPerson>; Is the following code valid? procedure ReadPeople(DataSet: TDataSet; PersonList: TPersonList); begin PersonList.Count := DataSet.RecordCount; if DataSet.RecordCount = 0 then Exit; DataSet.First; while not DataSet.Eof do begin PersonList[DataSet.RecNo].Name := DataSet.FieldByName('Name').AsString; PersonList[DataSet.RecNo].Age := DataSet.FieldByName('Age').AsInteger; DataSet.Next; end; end; Do I have to use GetMem/FreeMem to allocate and free records an instance of TPersonList, or am I free to directly access the TPersonList entries directly? My gut says that the code should be valid, though I'm not sure if there's any wrinkles related to record initialization or finalization.

    Read the article

  • Delphi: Using Enumerators to filter TList<T: class> by class type?

    - by afrazier
    Okay, this might be confusing. What I'm trying to do is use an enumerator to only return certain items in a generic list based on class type. Given the following hierarchy: type TShapeClass = class of TShape; TShape = class(TObject) private FId: Integer; public function ToString: string; override; property Id: Integer read FId write FId; end; TCircle = class(TShape) private FDiameter: Integer; public property Diameter: Integer read FDiameter write FDiameter; end; TSquare = class(TShape) private FSideLength: Integer; public property SideLength: Integer read FSideLength write FSideLength; end; TShapeList = class(TObjectList<TShape>) end; How can I extend TShapeList such that I can do something similar to the following: procedure Foo; var ShapeList: TShapeList; Shape: TShape; Circle: TCircle; Square: TSquare; begin // Create ShapeList and fill with TCircles and TSquares for Circle in ShapeList<TCircle> do begin // do something with each TCircle in ShapeList end; for Square in ShapeList<TSquare> do begin // do something with each TSquare in ShapeList end; for Shape in ShapeList<TShape> do begin // do something with every object in TShapeList end; end; I've tried extending TShapeList using an adapted version of Primoz Gabrijelcic's bit on Parameterized Enumerators using a factory record as follows: type TShapeList = class(TObjectList<TShape>) public type TShapeFilterEnumerator<T: TShape> = record private FShapeList: TShapeList; FClass: TShapeClass; FIndex: Integer; function GetCurrent: T; public constructor Create(ShapeList: TShapeList); function MoveNext: Boolean; property Current: T read GetCurrent; end; TShapeFilterFactory<T: TShape> = record private FShapeList: TShapeList; public constructor Create(ShapeList: TShapeList); function GetEnumerator: TShapeFilterEnumerator<T>; end; function FilteredEnumerator<T: TShape>: TShapeFilterFactory<T>; end; Then I modified Foo to be: procedure Foo; var ShapeList: TShapeList; Shape: TShape; Circle: TCircle; Square: TSquare; begin // Create ShapeList and fill with TCircles and TSquares for Circle in ShapeList.FilteredEnumerator<TCircle> do begin // do something with each TCircle in ShapeList end; for Square in ShapeList.FilteredEnumerator<TSquare> do begin // do something with each TSquare in ShapeList end; for Shape in ShapeList.FilteredEnumerator<TShape> do begin // do something with every object in TShapeList end; end; However, Delphi 2010 is throwing an error when I try to compile Foo about Incompatible types: TCircle and TShape. If I comment out the TCircle loop, then I get a similar error about TSquare. If I comment the TSquare loop out as well, the code compiles and works. Well, it works in the sense that it enumerates every object since they all descend from TShape. The strange thing is that the line number that the compiler indicates is 2 lines beyond the end of my file. In my demo project, it indicated line 177, but there's only 175 lines. Is there any way to make this work? I'd like to be able to assign to Circle directly without going through any typecasts or checking in my for loop itself.

    Read the article

  • Getting Serial Port Information in C#

    - by Jim Fell
    I have some code that loads the serial ports into a combo-box: List<String> tList = new List<String>(); comboBoxComPort.Items.Clear(); foreach (string s in SerialPort.GetPortNames()) { tList.Add(s); } tList.Sort(); comboBoxComPort.Items.Add("Select COM port..."); comboBoxComPort.Items.AddRange(tList.ToArray()); comboBoxComPort.SelectedIndex = 0; I would like to add the port descriptions (similar to what are shown for the COM ports in the Device Manager) to the list and sort the items in the list that are after index 0 (solved: see above snippet). Does anyone have any suggestions for adding the port descriptions? I am using Microsoft Visual C# 2008 Express Edition (.NET 2.0). Any thoughts you may have would be appreciated. Thanks.

    Read the article

  • is back_insert_iterator<> safe to be passed by value?

    - by afriza
    I have a code that looks something like: struct Data { int value; }; class A { public: typedef std::deque<boost::shared_ptr<Data> > TList; std::back_insert_iterator<TList> GetInserter() { return std::back_inserter(m_List); } private: TList m_List; }; class AA { boost::scoped_ptr<A> m_a; public: AA() : m_a(new A()) {} std::back_insert_iterator<A::TList> GetDataInserter() { return m_a->GetInserter(); } }; class B { template<class OutIt> CopyInterestingDataTo(OutIt outIt) { // loop and check conditions for interesting data // for every `it` in a Container<Data*> // create a copy and store it for( ... it = ..; .. ; ..) if (...) { *outIt = OutIt::container_type::value_type(new Data(**it)); outIt++; // dummy } } void func() { AA aa; CopyInterestingDataTo(aa.GetInserter()); // aa.m_a->m_List is empty! } }; The problem is that A::m_List is always empty even after CopyInterestingDataTo() is called. However, if I debug and step into CopyInterestingDataTo(), the iterator does store the supposedly inserted data!

    Read the article

  • Declare Locally or Globally in Delphi?

    - by lkessler
    I have a procedure my program calls tens of thousands of times that uses a generic structure like this: procedure PrintIndiEntry(JumpID: string); type TPeopleIncluded = record IndiPtr: pointer; Relationship: string; end; var PeopleIncluded: TList<TPeopleIncluded>; PI: TPeopleIncluded; begin { PrintIndiEntry } PeopleIncluded := TList<TPeopleIncluded>.Create; { A loop here that determines a small number (up to 100) people to process } while ... do begin PI.IndiPtr := ...; PI.Relationship := ...; PeopleIncluded.Add(PI); end; DoSomeProcess(PeopleIncluded); PeopleIncluded.Clear; PeopleIncluded.Free; end { PrintIndiEntry } Alternatively, I can declare PeopleIncluded globally rather than locally as follows: unit process; interface type TPeopleIncluded = record IndiPtr: pointer; Relationship: string; end; var PeopleIncluded: TList<TPeopleIncluded>; PI: TPeopleIncluded; procedure PrintIndiEntry(JumpID: string); begin { PrintIndiEntry } { A loop here that determines a small number (up to 100) people to process } while ... do begin PI.IndiPtr := ...; PI.Relationship := ...; PeopleIncluded.Add(PI); end; DoSomeProcess(PeopleIncluded); PeopleIncluded.Clear; end { PrintIndiEntry } procedure InitializeProcessing; begin PeopleIncluded := TList<TPeopleIncluded>.Create; end; procedure FinalizeProcessing; begin PeopleIncluded.Free; end; My question is whether in this situation it is better to declare PeopleIncluded globally rather than locally. I know the theory is to define locally whenever possible, but I would like to know if there are any issues to worry about with regards to doing tens of thousands of of "create"s and "free"s? Making them global will do only one create and one free. What is the recommended method to use in this case? If the recommended method is to still define it locally, then I'm wondering if there are any situations where it is better to define globally when defining locally is still an option.

    Read the article

  • Query in data population using select in jsp

    - by sarah
    I am populating data using <select name="test"> <option value='<%=session.getAttribute("tList")%>'><%=session.getAttribute("tList") %></option> </select> but the values are getting display in a single row in the combo box not row wise,where i am going wrong ?

    Read the article

  • how to access a type defined in one .ml file in another .ml file

    - by user339261
    Hi, I m very new to ocaml and i m facing the problem below, In a.ml a record type t is defined and is also defined transparently in a.mli, i.e. in d interface so that the type definition is available to all other files. a.ml also has a function, func, which returns a list of t. Now in another file, b.ml i m calling func, now obviously ocaml compiler wud nt be able to infer d type of objects stored in d list, for compiler its just a list. so in b.ml, i hav something like dis, let tlist = A.func in let vart = List.hd tlist in printf "%s\n" vart.name (name is a field in record t) Now here i get a compiler error sayin "Unbound record field label name" which makes sense as compiler can't infer d type of vart. my first question: how do I explicitly provide d type of vart as t here? i tried doing "let vart:A.t = " but got the same error. I also tried creating another function to fetch the first element of d list and mentioning return type as A.t, but then i got the "Unbound value A.t". I did this: let firstt = function [] - 0 | x :: _ - A.t x ;; The problem is compiler is unable to recognize A.t (a type) in b.ml but is able to recognize function A.func. If I remove A.t from the b.ml, i don'get any compiler errors. Please help, its urgent work. Thanks in advance! ~Tarun

    Read the article

  • Struts2 Converting Enum Array fills array with single null value

    - by Kyle Partridge
    For a simple action class with these member variables: ... private TestConverterEnum test; private TestConverterEnum[] tests; private List<TestConverterEnum> tList; ... And a simple enum: public enum TestConverterEnum { A, B, C; } Using the default struts2 enum conversion, when I send the request like so: TestConterter.action?test=&tests=&tList=&b=asdf For test I get a null value, which is expected. For the Array and List, however, I get and Array (or list) with one null element. Is this what is expected? Is there a way to prevent this. We recently upgraded our struts2 version, and we had our own converters, which also don't work in this case, so I was hoping to use the default conversion method. We already have code that is validating these arrays for null and length, and I don't want to have to add another condition to these branches. Is there a way to prevent this bevavior?

    Read the article

  • Get type of the parameter from list of objects, templates, C++

    - by CrocodileDundee
    This question follows to my previous question Get type of the parameter, templates, C++ There is the following data structure: Object1.h template <class T> class Object1 { private: T a1; T a2; public: T getA1() {return a1;} typedef T type; }; Object2.h template <class T> class Object2: public Object1 <T> { private: T b1; T b2; public: T getB1() {return b1;} } List.h template <typename Item> struct TList { typedef std::vector <Item> Type; }; template <typename Item> class List { private: typename TList <Item>::Type items; }; Is there any way how to get type T of an object from the list of objects (i.e. Object is not a direct parameter of the function but a template parameter)? template <class Object> void process (List <Object> *objects) { typename Object::type a1 = objects[0].getA1(); // g++ error: 'Object1<double>*' is not a class, struct, or union type } But his construction works (i.e. Object represents a parameter of the function) template <class Object> void process (Object *o1) { typename Object::type a1 = o1.getA1(); // OK }

    Read the article

  • String generation with regex criteria

    - by menjaraz
    I wonder wether it is feasible to implement an optimal string generator Class meeting the following requirements: Generation criteria using regex Lexicographical order enumeration. Count propetry Indexed access I don't feel comfortable with regular expression: I cannot come up with a starting piece of code but I just think of a naive implementation using a TList as a base class and use a filter (Regex) against "brute force" generated string. Thank you.

    Read the article

  • Repeating procedure for every item in class

    - by Hendriksen123
    Data.XX.NewValue := Data.XX.SavedValue; Data.XX.OldValue := Data.XX.SavedValue; I need to do the above a large number of times, where XX represents the value in the class. Pretending there were 3 items in the list: Tim, Bob, Steve. Is there any way to do the above for all three people without typing out the above code three times? (Data is a class containing a number of Objects, each type TList, which contain OldValue, NewValue and SavedValue)

    Read the article

  • How to publish a list of integers?

    - by Mason Wheeler
    I want to make a component that includes a list of integers as one of its serialized properties. I know I can't declare a TList<integer> as a published property, because it doesn't descend from TPersistent. I've read that you can define "fake" published properties if you override DefineProperties, but I'm not quite sure how that works, especially when it comes to creating a fake property that's a list, not a single value. Can someone point me in the right direction?

    Read the article

  • Are TClientDataSets part of your toolkit, or have they been replaced by something else?

    - by Tom1952
    I have 50 or 60 records of four or five fields. I need to load the records into RAM (From a CSV file), search on different fields, enumerate, etc. Not a lot of data, not a lot of functionality. I was all excited to use the new (to me in D2010) TDictionary or TList, but thought that a TClientDataset (which I've never used before) might be more appropriate. With a TClientDataSet, I can use .Locate on any field, enumerate with while NOT CDS.EOF, etc. And, what exactly is this MidasLib that I have to use with CDS? Can I reasonably expect it to be supported in the future? Is TClientDataSet still considered state-of-the-art, or is it showing its age and somewhat deprecated (literally and figuratively)? I've seen colleagues use DX's TdxMemData. Why use it (or any of the other handful of memory datasets I've seen while googling this issue) rather than a CDS? Related question: http://stackoverflow.com/questions/274958/delphi-using-tclientdataset-as-an-in-memory-dataset

    Read the article

  • delphi idhttp post related question

    - by paul
    hello All im new to delphi. and also almost new to programming world. i was made some simple post software which using idhttp module. but when execute it , it not correctly working. this simple program is check for my account status. if account login successfully it return some source code which include 'top.location =' in source, and if login failed it return not included 'top.location =' inside account.txt is follow first and third account was alived account but only first account can check, after first account other account can't check i have no idea what wrong with it ph896011 pk1089 fsadfasdf dddddss ph896011 pk1089 following is source of delphi if any one help me much apprecated! unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, IdBaseComponent, IdComponent, IdTCPConnection, IdTCPClient, IdHTTP, IdCookieManager, ExtCtrls; type TForm1 = class(TForm) Button1: TButton; IdHTTP1: TIdHTTP; Memo1: TMemo; IdCookieManager1: TIdCookieManager; lstAcct: TListBox; result: TLabel; Edit1: TEdit; Timer1: TTimer; procedure Button1Click(Sender: TObject); //procedure FormCreate(Sender: TObject); //procedure FormClose(Sender: TObject; var Action: TCloseAction); private { Private declarations } public AccList: TStringList; IdCookie: TIdCookieManager; CookieList: TList; StartCnt: Integer; InputCnt: Integer; WordList: TStringList; WordNoList: TStringList; WordCntList: TStringList; StartTime: TDateTime; end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); var i: Integer; //temp: String; lsttemp: TStringList; sl : tstringlist; //userId,userPass: string; begin InputCnt:= 0; WordList := TStringList.Create; CookieList := TList.create; IdCookie := TIdCookieManager.Create(self); if FileExists(ExtractFilePath(Application.ExeName) + 'account.txt') then WordList.LoadFromFile(ExtractFilePath(Application.ExeName) + 'account.txt'); WordNoList:= TStringList.Create; WordCntList := TStringList.Create; lsttemp := TStringList.create; sl :=Tstringlist.Create; try try for i := 0 to WordList.Count -1 do begin ExtractStrings([' '], [' '], pchar(WordList[i]), lsttemp); WordNoList.add(lsttemp[0]); //ShowMessage(lsttemp[0]); WordCntList.add(lsttemp[1]); //ShowMessage(lsttemp[1]); sl.Add('ID='+ lsttemp[0]); sl.add('PWD=' + lsttemp[1]); sl.add('SECCHK=0'); IdHTTP1.HandleRedirects := True; IdHTTP1.Request.ContentType := 'application/x-www-form-urlencoded'; memo1.Text:=idhttp1.Post('http://user.buddybuddy.co.kr/Login/Login.asp',sl); if pos('top.location =',Memo1.Text)> 0 then begin application.ProcessMessages; ShowMessage('Alive Acc!'); //result.Caption := 'alive acc' ; sleep(1000); Edit1.Text := 'alive acc'; lsttemp.Clear; Memo1.Text := ''; //memo1.Text := IdHTTP1.Get('https://user.buddybuddy.co.kr/Login/Logout.asp'); Sleep(1000); end; if pos('top.location =', memo1.Text) <> 1 then begin application.ProcessMessages; ShowMessage('bad'); Edit1.Text := 'bad'; //edit1.Text := 'bad'; lsttemp.Clear; memo1.Text := ''; sleep(1000) ; end; Edit1.Text := ''; end; finally lsttemp.free; end; StartCnt := lstAcct.items.Count; StartTime := Now; finally sl.Free; end; end; end.

    Read the article

  • javascript server issue

    - by sarah
    Onchage of selection i am calling a javascript to make a server call using struts1.2 but its not making a call.Please let me know where i am going wrong,below is the code <html:form action="/populate"> <html:select property="tName" onchange="test()">"> <html:option value="">SELECT</html:option> <html:options name="tList" /> </html:select> </html:form> and stuts-config has <action path="/populate" name="tForm" type="com.testAction" validate="false" parameter="method" scope="request" > <forward name="success" path="/failure.jsp" /> </action> and javascript is function test(){ var selObj = document.getElementById("tName"); var selIndex = selObj.selectedIndex; if (selIndex != 0) { document.form[0].selIndex.action="/populate.do?method=execute&testing="+selIndex; document.form[0].submit(); } }

    Read the article

  • Avoiding "variable might not have been initialized"

    - by Mason Wheeler
    I recently ran across a routine that looks something like this: procedure TMyForm.DoSomething(list: TList<TMyObject>; const flag: boolean); var local: integer; begin if flag then //do something else local := ExpensiveFunctionCallThatCalculatesSomething; //do something else for i := 0 to list.Count do if flag then //do something else if list[i].IntValue > local then //WARNING HERE //do something else end; This gives Variable 'local' might not have been initialized even though you can tell by reading the code that you won't hit that line unless the code branch that initializes it has run. Now, I could get rid of this warning by adding a useless local := 0; at the top of the procedure, but I wonder if there might not be a better way to structure this to avoid the issue. Anyone have any ideas?

    Read the article

  • How to get a float value the pointer points to?

    - by aleluja
    Hello, In my app, i've created the TList type list where i store the pointers to 1 string and 2 float(real) values for every 3 items. aList.Add(@sName); //string aList.Add(@x1); //float aList.Add(@x2); //float Then, i want to get the values out from the list, but i could only do that for string sStr := string(lList.items[i]); But i couldn't get the float values as a := real(lList...) will result in an invalid typecast error. So what do i do to get the float values? Of course i have a question if that string casting will actually give me the string value. I'm not good at pointer stuff so i don't know how to do it.

    Read the article

  • perl negative look behind with groupings

    - by user1539348
    I have a problem trying to get a certain match to work with negative look behind example @list = qw( apple banana cherry); $comb_tlist = join ("|", @tlist); $string1 = "include $(dir)/apple"; $string2 = "#include $(dir)/apple"; if( string1 =~ /^(?<!#).*($comb_tlist)/) #matching regex I tried, works The array holds a set of variables that is matched against the string. I need the regex to match $string1, but not $string2. It matches $string1, but it ALSO matches $string2. Can anyone tell me what I am attempting wrong here. Thanks!

    Read the article

  • Dynamic Table CheckBoxes not having a "Checked" true value

    - by LuvlyOvipositor
    I have been working on a web app using ASP.NET with the code base as C#. I have a dynamic table that resizes based on a return from a SQL query; with a check box added in the third cell of each row. The checkbox is assigned an ID according to an index and the date. When users hit the submit button, the code is supposed to get a value from each row that is checked. However, when looping through the rows, none of the check boxes ever have a value of true for the Checked property. The ID persists, but the value of the checkbox seems to be lost. Code for adding the Checkboxes: cell = new TableCell(); CheckBox cb = new CheckBox(); cell.ApplyStyle(TS); cb.ID = index.ToString() + " " + lstDate.SelectedItem.Text.ToString(); if (reader["RestartStatus"].ToString() == "0") { cb.Checked = false; cb.Enabled = true; } else { cb.Checked = true; } cell.Controls.Add(cb); The code for getting the checkbox value: for (int i = 0; i < CompTable.Rows.Count; i++) { int t3 = CompTable.Rows[i].Cells[2].Controls.Count; Control temp = null; if (t3 0) { temp = CompTable.Rows[i].Cells[2].Controls[0]; } string t2 = i.ToString() + " " + lstDate.SelectedItem.Text.ToString(); if ( temp != null && ((CheckBox)temp).ID == i.ToString() + " " + lstDate.SelectedItem.Text.ToString()) { //Separated into 2 if statements for debugging purposes //ID is correct, but .Checked is always false (even if all of the boxes are checked) if (((CheckBox)temp).Checked == true) { tlist.Add(CompTable.Rows[i].Cells[0].Text.ToString()); } } }

    Read the article

1 2  | Next Page >