AdvancedList (from Resco)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Has anybody used AdvancedList from Resco? I am trying to populate a List without using a database. All the examples provided seem to be using a database

The contents of each row (textcell, imagecell, etc..) need to be loaded at run-time through a return value of a method. I am not using any databse to do all the loading

I'm not sure which methods or properties of the AdvanvcedList I need to use...can anybody please help me with this

Thanks!
 
Thanks for your help. Do you know if there is a way I can add a background to the main AdvancedList control? And to the rows? Or atleast make them transparent so that the form's background shows up

Thanks!
 
MalawiBwana said:
Thanks for your help. Do you know if there is a way I can add a
background to the main AdvancedList control? And to the rows? Or atleast
make them transparent so that the form's background shows up?

never tried, no idea
 
I'm not able to find an appropriate attribute or method for Row or DataRow
that returns this object.

not sure exactly sure what you're asking, but does this help?

Dim ubound As Integer = row.FieldCount - 1
Dim objarr(ubound) As Object
row.GetData(objarr)
 
There is a problem with the EndInit Method. Please see the code below. I know this works. The newActiveParticipant method is called at runtime by another object, and it can be called multiple times within very short periods. The code works when I call the newActiveParticipant method with a "hard-coded" value by using a button like this

private void button1_Click(object sender, System.EventArgs e

Participant p = new Participant ("1234", "Swami", "house" "www.c.edu", false, false, false)
newActiveParticipant (p)



However, when I run it the proper way, the rows are not added. I tried debugging, and the code stops at this statement:

this.advancedList1.EndInit ()

What could the problem be? It just doesn't like that statement..



--- CODE ---------------------------------------------------------------------------

public void newActiveParticipant(Participant p) // change to participant late

string name = p.ShortDesc
string loc = p.Location
string [] columns = new string [] {"ParticipantName", "Location", "Time", "Service1", "Service2"}
Mapping columnMap = new Mapping (columns)

// *** Add Participant (Preview view) **
RowTemplate rt = new RowTemplate()
rt.Height = 32
rt.BackColor = System.Drawing.Color.Honeydew

TextCell tc1 = new TextCell()
TextCell tc2 = new TextCell()
TextCell tc3 = new TextCell()


tc1.Bounds = new System.Drawing.Rectangle(0, 0, 160, 19)
tc1.CellSource.ColumnName = "ParticipantName"
tc1.TextFont = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular)

tc2.Bounds = new System.Drawing.Rectangle(187, 20, -1, 12)
tc2.CellSource.ColumnName = "Time"
tc2.TextFont = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular)

tc3.Bounds = new System.Drawing.Rectangle(0, 20, 160, 12)
tc3.CellSource.ColumnName = "Location"
tc3.TextFont = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Italic)



rt.CellTemplates.Add(tc1)
rt.CellTemplates.Add(tc2)
rt.CellTemplates.Add(tc3)




// *** list of services (Master View) ***
RowTemplate rt2 = new RowTemplate()
rt2.Height = 80
rt2.BackColor = System.Drawing.Color.PaleGoldenrod

TextCell tc4 = new TextCell()
TextCell tc5 = new TextCell()
TextCell tc6 = new TextCell()

LinkCell lc1 = new LinkCell()
LinkCell lc2 = new LinkCell()



tc4.Bounds = new System.Drawing.Rectangle(0, 0, 160, 19)
tc4.CellSource.ColumnName = "ParticipantName"
tc4.TextFont = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular)

tc5.Bounds = new System.Drawing.Rectangle(187, 20, -1, 12)
tc5.CellSource.ColumnName = "Time"
tc5.TextFont = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Regular)

tc6.Bounds = new System.Drawing.Rectangle(0, 20, 160, 12)
tc6.CellSource.ColumnName = "Location"
tc6.TextFont = new System.Drawing.Font("Arial", 8.25F, System.Drawing.FontStyle.Italic)

lc1.Bounds = new System.Drawing.Rectangle (40, 48, -1, 16)
lc1.CellSource.ColumnName = "Service1"
lc1.Name = null

lc2.Bounds = new System.Drawing.Rectangle(40, 64, -1, 16)
lc2.CellSource.ColumnName = "Service2"
lc2.Name = null;

rt2.CellTemplates.Add(tc4)
rt2.CellTemplates.Add(tc5)
rt2.CellTemplates.Add(tc6)
rt2.CellTemplates.Add(lc1)
rt2.CellTemplates.Add(lc2)


this.advancedList1.BeginInit()

this.advancedList1.Templates.Add(rt)
this.advancedList1.Templates.Add(rt2)


int templateIndex = advancedList1.Templates.Count - 2;
int selectedTemplateIndex = templateIndex + 1;


Row row = new Row(templateIndex, selectedTemplateIndex, new object[] {p.ShortDesc, p.Location, DateTime.Now.TimeOfDay, "Service A", "Service B"}, columnMap)


this.advancedList1.DataRows.Add (row)

this.advancedList1.EndInit ();




public void participantInactive (string rfid

//Iterate through advancedList1 and remove the item whose RFID equals rifd

int numRows = this.advancedList1.DataRows.Count;
for (int i = 0; i < numRows; i++)
{
Participant p = null;
object o = null;
Row row = this.advancedList1.DataRows ;
IEnumerator iterator = row.GetEnumerator();
iterator.Reset();
if (iterator.MoveNext())
o = iterator.Current;

p = (Participant) o;

if (p.RFID == rfid)
{
this.advancedList1.DataRows .Delete ();
break;
}
}
}
 
MalawiBwana said:
There is a problem with the EndInit Method. Please see the code below. I
know this works. The newActiveParticipant method is called at runtime by
another object, and it can be called multiple times within very short
periods. The code works when I call the newActiveParticipant method with a
"hard-coded" value by using a button like this:


i ran this test and didn't have any problem so i would suspect the (timing?)
problem is elsewhere in your code

private void button1_Click(object sender, System.EventArgs e)
{
string str;
for (int i = 0; i<25; i++)
{
str = "test" + i.ToString();
newActiveParticipant(new Participant(str, str, str, str, false, false,
false));
}
}

i didn't use the participantInactive method, so if it was important for
something i missed it

also, does removing the begininit/endinit solve your problem?
 
Back
Top