Implementing a Filmstrip

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

Guest

I need to duplicate something that is easy to do in Access using a recordset
with its movenext, moveprevious, movefirst, movelast, and move(i) where i is
a positive or negative integer. I do not know how to do this in .NET. None
of the existing data structures dataset, arraylist, etc support this type of
access.

I need pull in the photos in a particular order and show 3 at a time in 3
images boxes. The user has First, Next, Previous, Last and Jump button
(moves 4, 5 or 10, etc at a time after the user enters a number between 1 and
number of photos in the sequence). There can be anywhere from 1 photo to
1000 photos in the list.

The database keeps the path to the photo not the actual photo. So the list
is essentially sequential list (recordset) of paths along with other a few
other fields.

WR
 
Hey WR,

Many of the ways of dealing with data sets (not just the DataSet) don't
really keep a pointer like a DBMS environment. They're often just
referenced ordinally (with a position). To implement this on your own you
can keep whatever the "current" item is in a variable or property and use
that to reference the appropriate row in the table.

With an index value, reference the table's Rows collection appropriately,
like
strPictureLoc = tblPicture.Rows[intCurrentRow]["PictureURL"].ToString();

One way would be to implement a property with the appropriate "move"
methods. Something like...

private DataTable tblPictures;
private int intCurrentRow = 0;
public int CurrentRow
{
get
{
return intCurrentRow;
}
set
{
if (value < 0)
// tried to move prior to top -- move top
intCurrentRow = 0;
else if (value >= tblPictures.Rows.Count)
// Tried to move past end -- move bottom
intCurrentRow = tblPictures.Rows.Count - 1;
else
intCurrentRow = value;
}
}

private void MoveFirst()
{
CurrentRow = 0;
}

private void MovePrevious()
{
CurrentRow--;
}

private void MoveNext()
{
CurrentRow++;
}

private void MoveVaried()
{
// Assumes you have a NumericUpDown control that indicates how many
places to move
CurrentRow += nudMoveRows.Value;
}


There are probably a dozen other approaches, but that is one option!

HTH,

John
 
Thanks for your time and suggestion.

This exactly the ticket.

wr

John Spiegel said:
Hey WR,

Many of the ways of dealing with data sets (not just the DataSet) don't
really keep a pointer like a DBMS environment. They're often just
referenced ordinally (with a position). To implement this on your own you
can keep whatever the "current" item is in a variable or property and use
that to reference the appropriate row in the table.

With an index value, reference the table's Rows collection appropriately,
like
strPictureLoc = tblPicture.Rows[intCurrentRow]["PictureURL"].ToString();

One way would be to implement a property with the appropriate "move"
methods. Something like...

private DataTable tblPictures;
private int intCurrentRow = 0;
public int CurrentRow
{
get
{
return intCurrentRow;
}
set
{
if (value < 0)
// tried to move prior to top -- move top
intCurrentRow = 0;
else if (value >= tblPictures.Rows.Count)
// Tried to move past end -- move bottom
intCurrentRow = tblPictures.Rows.Count - 1;
else
intCurrentRow = value;
}
}

private void MoveFirst()
{
CurrentRow = 0;
}

private void MovePrevious()
{
CurrentRow--;
}

private void MoveNext()
{
CurrentRow++;
}

private void MoveVaried()
{
// Assumes you have a NumericUpDown control that indicates how many
places to move
CurrentRow += nudMoveRows.Value;
}


There are probably a dozen other approaches, but that is one option!

HTH,

John


WhiskyRomeo said:
I need to duplicate something that is easy to do in Access using a recordset
with its movenext, moveprevious, movefirst, movelast, and move(i) where i is
a positive or negative integer. I do not know how to do this in .NET. None
of the existing data structures dataset, arraylist, etc support this type of
access.

I need pull in the photos in a particular order and show 3 at a time in 3
images boxes. The user has First, Next, Previous, Last and Jump button
(moves 4, 5 or 10, etc at a time after the user enters a number between 1 and
number of photos in the sequence). There can be anywhere from 1 photo to
1000 photos in the list.

The database keeps the path to the photo not the actual photo. So the list
is essentially sequential list (recordset) of paths along with other a few
other fields.

WR
 
You might also want to look at the DataGrid control.

It can do all of that for you in a webForm if you bind it to a DataSet.

Thanks for your time and suggestion.

This exactly the ticket.

wr

:

Hey WR,

Many of the ways of dealing with data sets (not just the DataSet) don't
really keep a pointer like a DBMS environment. They're often just
referenced ordinally (with a position). To implement this on your own you
can keep whatever the "current" item is in a variable or property and use
that to reference the appropriate row in the table.

With an index value, reference the table's Rows collection appropriately,
like
strPictureLoc = tblPicture.Rows[intCurrentRow]["PictureURL"].ToString();

One way would be to implement a property with the appropriate "move"
methods. Something like...

private DataTable tblPictures;
private int intCurrentRow = 0;
public int CurrentRow
{
get
{
return intCurrentRow;
}
set
{
if (value < 0)
// tried to move prior to top -- move top
intCurrentRow = 0;
else if (value >= tblPictures.Rows.Count)
// Tried to move past end -- move bottom
intCurrentRow = tblPictures.Rows.Count - 1;
else
intCurrentRow = value;
}
}

private void MoveFirst()
{
CurrentRow = 0;
}

private void MovePrevious()
{
CurrentRow--;
}

private void MoveNext()
{
CurrentRow++;
}

private void MoveVaried()
{
// Assumes you have a NumericUpDown control that indicates how many
places to move
CurrentRow += nudMoveRows.Value;
}


There are probably a dozen other approaches, but that is one option!

HTH,

John


I need to duplicate something that is easy to do in Access using a
recordset

with its movenext, moveprevious, movefirst, movelast, and move(i) where i
is

a positive or negative integer. I do not know how to do this in .NET.
None

of the existing data structures dataset, arraylist, etc support this type
of

access.

I need pull in the photos in a particular order and show 3 at a time in 3
images boxes. The user has First, Next, Previous, Last and Jump button
(moves 4, 5 or 10, etc at a time after the user enters a number between 1
and

number of photos in the sequence). There can be anywhere from 1 photo to
1000 photos in the list.

The database keeps the path to the photo not the actual photo. So the
list

is essentially sequential list (recordset) of paths along with other a
few

other fields.

WR
 
Now that I have a way to find the image in the dataset as the path, it
appears the PictureBox does not have a property to accept a path.

What control will allow this to be done in Windows form?

wr
 
Back
Top