One last attempt...

E

EMW

I'm really getting frustrated..

I'm trying to create an interactive datagrid to be used in a sort of
planning tool.

In my company we have 25 engineers and they run a 24/7 call duty once a
month.
Every week 6 engineers are on call duty according to a planning.

At the moment an excel sheet is used to create the planning and comments are
used to give extra information like one engineer starts at 8 am and another
will take over from 5pm to 11pm and then the former engineer is continueing
his watch.
This because they also have private lives ;)

What I'm now trying to create is a page, written in ASP.NET, with a datagrid
as the excel-like sheet.
The first four columns are bound to some information in a XML file (names,
etc..)
Then 31 columns for each day in the month. Ofcourse the days that are not
applicable in a month are made hidden.
In those 31 columns I put an imagebutton, the columns are template columns.
The IDs of those buttons are im01 to im31.

By putting a OnClick="DoSomething" part in the HTML source, I can use sub
DoSomething to figure out which button ID has been clicked on.
Then I know the column.
Now comes my frustrating part: how can I get the row index, because with 25
rows of different names, in each column (01 to 31) there is a imagebutton,
so each row has buttons named im01 to im31.

Once I know which button exaclty was clicked on, I can do something with the
image of the button.

Please help me with this or I will not be able to sleep normal ever
again....

rg.
Eric
 
A

Alvin Bruney [MVP]

If you keep one of the columns as the name of the engineer, you only need to
reference the name of the engineer to find out where you are in the grid.
you wouldn 't need which row you are on, on the column index representing
the engineer's name.

I'm not great fan of your design because different engineers are on call
different days and it is problematic to hide columns based on row
information for different rows. It may be better to have 6 columns
initially, the extra column containing the engineers name and the final
colum containing a calendar image. So for row 10, with engineer john doe,
the user clicks the calendar button next to john doe and you go get the data
based on row index = john doe.
 
J

Jim Corey

If you're designing from an existing spreadsheet, you might want to look
at this:
http://www.exceleverywhere.com/home/


Otherwise, this is a similar way to use LinkButtons (I would think
ImageButtons work the same way)

Protected Sub DataGrid1_ItemCommand(ByVal source As Object, ByVal e
As System.Web.UI.WebControls.DataGridCommandEventArgs) Handles
DataGrid1.ItemCommand

Dim oLinkButton As LinkButton = CType(e.CommandSource,
LinkButton)
Dim sID As String = oLinkButton.ID
Select Case sID
Case "01"
....


HTH,
Jim
 
E

EMW

Thanks for replying.

I'm not sure what you mean about "to reference the name of the engineer to
find out where you are in the grid" part.
Could you please explain a little bit more, some code(vb.net) would be
great.

As for the second part: By showing all the engineers of which there are 6 on
call every month, everybody can see who is on call and by switching months,
they can see who are next in line and so on.
This is only needed for the planning-design part, because the manager needs
to be able to select who is on call, make the changes for the ones with a
private life and add comments to it about this.

rg,
Eric


Alvin Bruney said:
If you keep one of the columns as the name of the engineer, you only need to
reference the name of the engineer to find out where you are in the grid.
you wouldn 't need which row you are on, on the column index representing
the engineer's name.

I'm not great fan of your design because different engineers are on call
different days and it is problematic to hide columns based on row
information for different rows. It may be better to have 6 columns
initially, the extra column containing the engineers name and the final
colum containing a calendar image. So for row 10, with engineer john doe,
the user clicks the calendar button next to john doe and you go get the data
based on row index = john doe.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
EMW said:
I'm really getting frustrated..

I'm trying to create an interactive datagrid to be used in a sort of
planning tool.

In my company we have 25 engineers and they run a 24/7 call duty once a
month.
Every week 6 engineers are on call duty according to a planning.

At the moment an excel sheet is used to create the planning and comments
are
used to give extra information like one engineer starts at 8 am and
another
will take over from 5pm to 11pm and then the former engineer is
continueing
his watch.
This because they also have private lives ;)

What I'm now trying to create is a page, written in ASP.NET, with a
datagrid
as the excel-like sheet.
The first four columns are bound to some information in a XML file (names,
etc..)
Then 31 columns for each day in the month. Ofcourse the days that are not
applicable in a month are made hidden.
In those 31 columns I put an imagebutton, the columns are template
columns.
The IDs of those buttons are im01 to im31.

By putting a OnClick="DoSomething" part in the HTML source, I can use sub
DoSomething to figure out which button ID has been clicked on.
Then I know the column.
Now comes my frustrating part: how can I get the row index, because with
25
rows of different names, in each column (01 to 31) there is a imagebutton,
so each row has buttons named im01 to im31.

Once I know which button exaclty was clicked on, I can do something with
the
image of the button.

Please help me with this or I will not be able to sleep normal ever
again....

rg.
Eric
 
A

Alvin Bruney [MVP]

so, if you put the engineers name in a row like so
col0 col1 col2 1 2 3
john x x
Jacob x x
Anna x x

When you click on your button to find data, you can grab the data
where e.item.cells[0] == "john" in your itemdatabound.
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
EMW said:
Thanks for replying.

I'm not sure what you mean about "to reference the name of the engineer to
find out where you are in the grid" part.
Could you please explain a little bit more, some code(vb.net) would be
great.

As for the second part: By showing all the engineers of which there are 6
on
call every month, everybody can see who is on call and by switching
months,
they can see who are next in line and so on.
This is only needed for the planning-design part, because the manager
needs
to be able to select who is on call, make the changes for the ones with a
private life and add comments to it about this.

rg,
Eric


Alvin Bruney said:
If you keep one of the columns as the name of the engineer, you only need to
reference the name of the engineer to find out where you are in the grid.
you wouldn 't need which row you are on, on the column index representing
the engineer's name.

I'm not great fan of your design because different engineers are on call
different days and it is problematic to hide columns based on row
information for different rows. It may be better to have 6 columns
initially, the extra column containing the engineers name and the final
colum containing a calendar image. So for row 10, with engineer john doe,
the user clicks the calendar button next to john doe and you go get the data
based on row index = john doe.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
EMW said:
I'm really getting frustrated..

I'm trying to create an interactive datagrid to be used in a sort of
planning tool.

In my company we have 25 engineers and they run a 24/7 call duty once a
month.
Every week 6 engineers are on call duty according to a planning.

At the moment an excel sheet is used to create the planning and
comments
are
used to give extra information like one engineer starts at 8 am and
another
will take over from 5pm to 11pm and then the former engineer is
continueing
his watch.
This because they also have private lives ;)

What I'm now trying to create is a page, written in ASP.NET, with a
datagrid
as the excel-like sheet.
The first four columns are bound to some information in a XML file (names,
etc..)
Then 31 columns for each day in the month. Ofcourse the days that are not
applicable in a month are made hidden.
In those 31 columns I put an imagebutton, the columns are template
columns.
The IDs of those buttons are im01 to im31.

By putting a OnClick="DoSomething" part in the HTML source, I can use sub
DoSomething to figure out which button ID has been clicked on.
Then I know the column.
Now comes my frustrating part: how can I get the row index, because
with
25
rows of different names, in each column (01 to 31) there is a imagebutton,
so each row has buttons named im01 to im31.

Once I know which button exaclty was clicked on, I can do something
with
the
image of the button.

Please help me with this or I will not be able to sleep normal ever
again....

rg.
Eric
 
E

EMW

I get what you mean now, but it is not what I meant.
The thing is that everytime the manager clicks on a imagebutton in a cell, I
need to know exactly which cell it is.
Because the imagebutten can have three states (with pictures) off, on and on
with an exclamation mark to show that there is more information stored for
the perticular cell.

I am beginning to think this is not possible.

Would this be a possiblity:

When the manager clicks on a button on my aspx page, an windows excutable is
transferred to his/her computer, which automaticly starts, gives the manager
full control on how to fill in the planning (and me with programming it),
then the excutable uploads the outcome in an xml file back to the server and
finally the executable is stopped, deleted if possible.

It's only at the local intranet so the transfering would not be a problem.

rg,
Eric



Alvin Bruney said:
so, if you put the engineers name in a row like so
col0 col1 col2 1 2 3
john x x
Jacob x x
Anna x x

When you click on your button to find data, you can grab the data
where e.item.cells[0] == "john" in your itemdatabound.
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
EMW said:
Thanks for replying.

I'm not sure what you mean about "to reference the name of the engineer to
find out where you are in the grid" part.
Could you please explain a little bit more, some code(vb.net) would be
great.

As for the second part: By showing all the engineers of which there are 6
on
call every month, everybody can see who is on call and by switching
months,
they can see who are next in line and so on.
This is only needed for the planning-design part, because the manager
needs
to be able to select who is on call, make the changes for the ones with a
private life and add comments to it about this.

rg,
Eric


Alvin Bruney said:
If you keep one of the columns as the name of the engineer, you only
need
to
reference the name of the engineer to find out where you are in the grid.
you wouldn 't need which row you are on, on the column index representing
the engineer's name.

I'm not great fan of your design because different engineers are on call
different days and it is problematic to hide columns based on row
information for different rows. It may be better to have 6 columns
initially, the extra column containing the engineers name and the final
colum containing a calendar image. So for row 10, with engineer john doe,
the user clicks the calendar button next to john doe and you go get the data
based on row index = john doe.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
I'm really getting frustrated..

I'm trying to create an interactive datagrid to be used in a sort of
planning tool.

In my company we have 25 engineers and they run a 24/7 call duty once a
month.
Every week 6 engineers are on call duty according to a planning.

At the moment an excel sheet is used to create the planning and
comments
are
used to give extra information like one engineer starts at 8 am and
another
will take over from 5pm to 11pm and then the former engineer is
continueing
his watch.
This because they also have private lives ;)

What I'm now trying to create is a page, written in ASP.NET, with a
datagrid
as the excel-like sheet.
The first four columns are bound to some information in a XML file (names,
etc..)
Then 31 columns for each day in the month. Ofcourse the days that are not
applicable in a month are made hidden.
In those 31 columns I put an imagebutton, the columns are template
columns.
The IDs of those buttons are im01 to im31.

By putting a OnClick="DoSomething" part in the HTML source, I can use sub
DoSomething to figure out which button ID has been clicked on.
Then I know the column.
Now comes my frustrating part: how can I get the row index, because
with
25
rows of different names, in each column (01 to 31) there is a imagebutton,
so each row has buttons named im01 to im31.

Once I know which button exaclty was clicked on, I can do something
with
the
image of the button.

Please help me with this or I will not be able to sleep normal ever
again....

rg.
Eric
 
A

Alvin Bruney [MVP]

No, it's possible. How are you adding the images?

If you add the images at runtime, then you can set the image id to a unique
identifier. Your click event would cast the sender argument to an
imagecontrol and extract the unique identifier out from it and you would
know where you are.

image i = (image)sender
string s = i.ID

It just depends on how you are adding the buttons.
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
EMW said:
I get what you mean now, but it is not what I meant.
The thing is that everytime the manager clicks on a imagebutton in a cell,
I
need to know exactly which cell it is.
Because the imagebutten can have three states (with pictures) off, on and
on
with an exclamation mark to show that there is more information stored for
the perticular cell.

I am beginning to think this is not possible.

Would this be a possiblity:

When the manager clicks on a button on my aspx page, an windows excutable
is
transferred to his/her computer, which automaticly starts, gives the
manager
full control on how to fill in the planning (and me with programming it),
then the excutable uploads the outcome in an xml file back to the server
and
finally the executable is stopped, deleted if possible.

It's only at the local intranet so the transfering would not be a problem.

rg,
Eric



Alvin Bruney said:
so, if you put the engineers name in a row like so
col0 col1 col2 1 2 3
john x x
Jacob x x
Anna x x

When you click on your button to find data, you can grab the data
where e.item.cells[0] == "john" in your itemdatabound.
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
EMW said:
Thanks for replying.

I'm not sure what you mean about "to reference the name of the engineer to
find out where you are in the grid" part.
Could you please explain a little bit more, some code(vb.net) would be
great.

As for the second part: By showing all the engineers of which there are 6
on
call every month, everybody can see who is on call and by switching
months,
they can see who are next in line and so on.
This is only needed for the planning-design part, because the manager
needs
to be able to select who is on call, make the changes for the ones with a
private life and add comments to it about this.

rg,
Eric


"Alvin Bruney [MVP]" <vapor at steaming post office> schreef in bericht
If you keep one of the columns as the name of the engineer, you only need
to
reference the name of the engineer to find out where you are in the grid.
you wouldn 't need which row you are on, on the column index representing
the engineer's name.

I'm not great fan of your design because different engineers are on call
different days and it is problematic to hide columns based on row
information for different rows. It may be better to have 6 columns
initially, the extra column containing the engineers name and the
final
colum containing a calendar image. So for row 10, with engineer john doe,
the user clicks the calendar button next to john doe and you go get
the
data
based on row index = john doe.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
I'm really getting frustrated..

I'm trying to create an interactive datagrid to be used in a sort of
planning tool.

In my company we have 25 engineers and they run a 24/7 call duty
once a
month.
Every week 6 engineers are on call duty according to a planning.

At the moment an excel sheet is used to create the planning and
comments
are
used to give extra information like one engineer starts at 8 am and
another
will take over from 5pm to 11pm and then the former engineer is
continueing
his watch.
This because they also have private lives ;)

What I'm now trying to create is a page, written in ASP.NET, with a
datagrid
as the excel-like sheet.
The first four columns are bound to some information in a XML file
(names,
etc..)
Then 31 columns for each day in the month. Ofcourse the days that
are
not
applicable in a month are made hidden.
In those 31 columns I put an imagebutton, the columns are template
columns.
The IDs of those buttons are im01 to im31.

By putting a OnClick="DoSomething" part in the HTML source, I can
use
sub
DoSomething to figure out which button ID has been clicked on.
Then I know the column.
Now comes my frustrating part: how can I get the row index, because
with
25
rows of different names, in each column (01 to 31) there is a
imagebutton,
so each row has buttons named im01 to im31.

Once I know which button exaclty was clicked on, I can do something
with
the
image of the button.

Please help me with this or I will not be able to sleep normal ever
again....

rg.
Eric
 
E

EMW

I added the imagebuttons in the ItemCommand part of the TemplateColumn at
design time, but I guess it would be better do add them at runtime?

rg,
Eric


Alvin Bruney said:
No, it's possible. How are you adding the images?

If you add the images at runtime, then you can set the image id to a unique
identifier. Your click event would cast the sender argument to an
imagecontrol and extract the unique identifier out from it and you would
know where you are.

image i = (image)sender
string s = i.ID

It just depends on how you are adding the buttons.
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
EMW said:
I get what you mean now, but it is not what I meant.
The thing is that everytime the manager clicks on a imagebutton in a cell,
I
need to know exactly which cell it is.
Because the imagebutten can have three states (with pictures) off, on and
on
with an exclamation mark to show that there is more information stored for
the perticular cell.

I am beginning to think this is not possible.

Would this be a possiblity:

When the manager clicks on a button on my aspx page, an windows excutable
is
transferred to his/her computer, which automaticly starts, gives the
manager
full control on how to fill in the planning (and me with programming it),
then the excutable uploads the outcome in an xml file back to the server
and
finally the executable is stopped, deleted if possible.

It's only at the local intranet so the transfering would not be a problem.

rg,
Eric



Alvin Bruney said:
so, if you put the engineers name in a row like so
col0 col1 col2 1 2 3
john x x
Jacob x x
Anna x x

When you click on your button to find data, you can grab the data
where e.item.cells[0] == "john" in your itemdatabound.
--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
Thanks for replying.

I'm not sure what you mean about "to reference the name of the
engineer
to
find out where you are in the grid" part.
Could you please explain a little bit more, some code(vb.net) would be
great.

As for the second part: By showing all the engineers of which there
are
6
on
call every month, everybody can see who is on call and by switching
months,
they can see who are next in line and so on.
This is only needed for the planning-design part, because the manager
needs
to be able to select who is on call, make the changes for the ones
with
a
private life and add comments to it about this.

rg,
Eric


"Alvin Bruney [MVP]" <vapor at steaming post office> schreef in bericht
If you keep one of the columns as the name of the engineer, you only need
to
reference the name of the engineer to find out where you are in the grid.
you wouldn 't need which row you are on, on the column index representing
the engineer's name.

I'm not great fan of your design because different engineers are on call
different days and it is problematic to hide columns based on row
information for different rows. It may be better to have 6 columns
initially, the extra column containing the engineers name and the
final
colum containing a calendar image. So for row 10, with engineer john doe,
the user clicks the calendar button next to john doe and you go get
the
data
based on row index = john doe.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
I'm really getting frustrated..

I'm trying to create an interactive datagrid to be used in a sort of
planning tool.

In my company we have 25 engineers and they run a 24/7 call duty
once a
month.
Every week 6 engineers are on call duty according to a planning.

At the moment an excel sheet is used to create the planning and
comments
are
used to give extra information like one engineer starts at 8 am and
another
will take over from 5pm to 11pm and then the former engineer is
continueing
his watch.
This because they also have private lives ;)

What I'm now trying to create is a page, written in ASP.NET, with a
datagrid
as the excel-like sheet.
The first four columns are bound to some information in a XML file
(names,
etc..)
Then 31 columns for each day in the month. Ofcourse the days that
are
not
applicable in a month are made hidden.
In those 31 columns I put an imagebutton, the columns are template
columns.
The IDs of those buttons are im01 to im31.

By putting a OnClick="DoSomething" part in the HTML source, I can
use
sub
DoSomething to figure out which button ID has been clicked on.
Then I know the column.
Now comes my frustrating part: how can I get the row index, because
with
25
rows of different names, in each column (01 to 31) there is a
imagebutton,
so each row has buttons named im01 to im31.

Once I know which button exaclty was clicked on, I can do something
with
the
image of the button.

Please help me with this or I will not be able to sleep normal ever
again....

rg.
Eric
 
J

John Saunders

EMW said:
I'm really getting frustrated..

By putting a OnClick="DoSomething" part in the HTML source, I can use sub
DoSomething to figure out which button ID has been clicked on.
Then I know the column.
Now comes my frustrating part: how can I get the row index, because with 25
rows of different names, in each column (01 to 31) there is a imagebutton,
so each row has buttons named im01 to im31.

You can pass parameters to your DoSomething function:

<tag onclick="DoSomething(1, 2)" /> <!-- Row 1, column 2 -->
 
E

EMW

It wouldn't be that simple, would it?
If it works, I have been searching for days for a solution....

rg,
Eric
 
E

EMW

Ok, I now have for each during runtime added iamgebutton a separate ID and
argument.

How can I put the OnClick part in the HTML during runtime?
If I have this I have what I wanted!! (I'm getting happy again!)

rg,
Eric


Alvin Bruney said:
yes it's that simple.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
EMW said:
It wouldn't be that simple, would it?
If it works, I have been searching for days for a solution....

rg,
Eric
 
E

EMW

Ok I now have a datagrid with lots of imagebuttons added during runtime and
each button as it's own ID and Argument.
One last thing: How can I add the OnClick="" part in the HTML for eacht
button?


rg,
Eric


Alvin Bruney said:
yes it's that simple.

--
Regards,
Alvin Bruney
[ASP.NET MVP http://mvp.support.microsoft.com/default.aspx]
Got tidbits? Get it here... http://tinyurl.com/27cok
EMW said:
It wouldn't be that simple, would it?
If it works, I have been searching for days for a solution....

rg,
Eric
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top