Is there a way to use a gridview in a timecard application, and if so, how? I
was looking at using a gridview to display a person's hours worked in a
week. To do this, many different data records would have to display on the
same row to make up a week (the database has a new row for each day entered).
But, from what I can tell, this keeps you from being able to use a gridview,
because the gridview relies on one datakey per row (and there are 7 database
records per one gridview row). Is there a way around this, or do I need to
look in a different direction on building my timecard application? 7 3329
Use a DataList control. It is capable of rendering multiple items on a row.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Wannabe" <Wa*****@discus sions.microsoft .comwrote in message
news:C5******** *************** ***********@mic rosoft.com...
Is there a way to use a gridview in a timecard application, and if so,
how? I
was looking at using a gridview to display a person's hours worked in a
week. To do this, many different data records would have to display on the
same row to make up a week (the database has a new row for each day
entered).
But, from what I can tell, this keeps you from being able to use a
gridview,
because the gridview relies on one datakey per row (and there are 7
database
records per one gridview row). Is there a way around this, or do I need to
look in a different direction on building my timecard application?
Thanks for the reply, but unless I don't understand the datalist enough, I do
not think that it will work. I need to be able to list a project once, and
then list all hours in a week associated with that project type (would be
multiple records on one line).
So the timecard would look like this:
Project Name Mon Tue Wed Thu Fri Sat Sun
Total Hours
Project One 1 3 8 8 8
28
Project Two 7 5
12
A record id would need to be associated with each hours entry so if the user
wanted to edit just those hours, they could. That is where the gridview breaks
down. I can have a gridview display records just as I want, but not with a
record id
associated with each hour entry.
Any suggestions?
"Eliyahu Goldin" wrote:
Use a DataList control. It is capable of rendering multiple items on a row.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Wannabe" <Wa*****@discus sions.microsoft .comwrote in message
news:C5******** *************** ***********@mic rosoft.com...
Is there a way to use a gridview in a timecard application, and if so,
how? I
was looking at using a gridview to display a person's hours worked in a
week. To do this, many different data records would have to display on the
same row to make up a week (the database has a new row for each day
entered).
But, from what I can tell, this keeps you from being able to use a
gridview,
because the gridview relies on one datakey per row (and there are 7
database
records per one gridview row). Is there a way around this, or do I need to
look in a different direction on building my timecard application?
Ok, consider the following way:
Reverse to gridview. Databind it to a dataset that will contain a datatable
with the columns corresponding to the ones in the gridview. Populate the
dataset programmaticall y from the database. Updates to the gridview will
update the dataset. Then save dataset date programmaticall y to the database.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin
"Wannabe" <Wa*****@discus sions.microsoft .comwrote in message
news:0A******** *************** ***********@mic rosoft.com...
Thanks for the reply, but unless I don't understand the datalist enough, I
do
not think that it will work. I need to be able to list a project once, and
then list all hours in a week associated with that project type (would be
multiple records on one line).
So the timecard would look like this:
Project Name Mon Tue Wed Thu Fri Sat Sun
Total Hours
Project One 1 3 8 8 8
28
Project Two 7 5
12
A record id would need to be associated with each hours entry so if the
user
wanted to edit just those hours, they could. That is where the gridview
breaks
down. I can have a gridview display records just as I want, but not with a
record id
associated with each hour entry.
Any suggestions?
"Eliyahu Goldin" wrote:
Use a DataList control. It is capable of rendering multiple items on a
row.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Wannabe" <Wa*****@discus sions.microsoft .comwrote in message
news:C5******** *************** ***********@mic rosoft.com...
Is there a way to use a gridview in a timecard application, and if so,
how? I
was looking at using a gridview to display a person's hours worked in
a
week. To do this, many different data records would have to display on
the
same row to make up a week (the database has a new row for each day
entered).
But, from what I can tell, this keeps you from being able to use a
gridview,
because the gridview relies on one datakey per row (and there are 7
database
records per one gridview row). Is there a way around this, or do I
need to
look in a different direction on building my timecard application?
I think, the easy way is to refine your DB query and put your work hours and
ids at one record, and store multiple ids at data keys (you can store array
of key at 2.0 and I assume you use 2.0) and access them later.
Shaw
"Wannabe" wrote:
Thanks for the reply, but unless I don't understand the datalist enough, I do
not think that it will work. I need to be able to list a project once, and
then list all hours in a week associated with that project type (would be
multiple records on one line).
So the timecard would look like this:
Project Name Mon Tue Wed Thu Fri Sat Sun
Total Hours
Project One 1 3 8 8 8
28
Project Two 7 5
12
A record id would need to be associated with each hours entry so if the user
wanted to edit just those hours, they could. That is where the gridview breaks
down. I can have a gridview display records just as I want, but not with a
record id
associated with each hour entry.
Any suggestions?
"Eliyahu Goldin" wrote:
Use a DataList control. It is capable of rendering multiple items on a row.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Wannabe" <Wa*****@discus sions.microsoft .comwrote in message
news:C5******** *************** ***********@mic rosoft.com...
Is there a way to use a gridview in a timecard application, and if so,
how? I
was looking at using a gridview to display a person's hours worked in a
week. To do this, many different data records would have to display on the
same row to make up a week (the database has a new row for each day
entered).
But, from what I can tell, this keeps you from being able to use a
gridview,
because the gridview relies on one datakey per row (and there are 7
database
records per one gridview row). Is there a way around this, or do I need to
look in a different direction on building my timecard application?
Shaw,
Yes, I am using 2.0. You may have hit on something that I can do, but can
you please explain it a little more.
Just to make sure, here is the hours table structure:
recordid int
projectid int
daterecorded datetime
hours decimal
I need to be able to take up to 7 records (could be less) and combine them
into one row, as shown in another post. For each hour, have it associated
with its own recordid. The projectid for each row would be the same for all
hours in that row (and could be changed, if the user picked the wrong one
initially). If you could explain further about using the datakey property,
that would be great. Thanks.
"Shaw" wrote:
I think, the easy way is to refine your DB query and put your work hours and
ids at one record, and store multiple ids at data keys (you can store array
of key at 2.0 and I assume you use 2.0) and access them later.
Shaw
"Wannabe" wrote:
Thanks for the reply, but unless I don't understand the datalist enough, I do
not think that it will work. I need to be able to list a project once, and
then list all hours in a week associated with that project type (would be
multiple records on one line).
So the timecard would look like this:
Project Name Mon Tue Wed Thu Fri Sat Sun
Total Hours
Project One 1 3 8 8 8
28
Project Two 7 5
12
A record id would need to be associated with each hours entry so if the user
wanted to edit just those hours, they could. That is where the gridview breaks
down. I can have a gridview display records just as I want, but not with a
record id
associated with each hour entry.
Any suggestions?
"Eliyahu Goldin" wrote:
Use a DataList control. It is capable of rendering multiple items on a row.
>
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
>
>
"Wannabe" <Wa*****@discus sions.microsoft .comwrote in message
news:C5******** *************** ***********@mic rosoft.com...
Is there a way to use a gridview in a timecard application, and if so,
how? I
was looking at using a gridview to display a person's hours worked in a
week. To do this, many different data records would have to display on the
same row to make up a week (the database has a new row for each day
entered).
But, from what I can tell, this keeps you from being able to use a
gridview,
because the gridview relies on one datakey per row (and there are 7
database
records per one gridview row). Is there a way around this, or do I need to
look in a different direction on building my timecard application?
>
>
>
I am not very sure your database table logic. One possible query is to use
function, such as GetWorkdayHours and GetWorkdayID. So here is a similar
query:
SELECT DISTINCT projected, GetWorkdayHours (‘Monday’, projected ,
weeksatrtday), GetWorkdayHours (‘Tuesday’, projected , weeksatrtday), …,
GetWorkdayID( Monday’, projected , weeksatrtday),
FROM HoursTable
WHERE daterecorded weeksatrtday AND daterecorded < weeksatrtday
To bind keys (VB):
gridView.DataSo urce = dataview_name
gridView.DataKe yNames = New String() {"MondayID", “TuesdayID” ,…}
gridView.DataBi nd()
The best way I think, is to modify your database table to fit your needs.
Hope it works (not sure).
Shaw
"Wannabe" wrote:
Shaw,
Yes, I am using 2.0. You may have hit on something that I can do, but can
you please explain it a little more.
Just to make sure, here is the hours table structure:
recordid int
projectid int
daterecorded datetime
hours decimal
I need to be able to take up to 7 records (could be less) and combine them
into one row, as shown in another post. For each hour, have it associated
with its own recordid. The projectid for each row would be the same for all
hours in that row (and could be changed, if the user picked the wrong one
initially). If you could explain further about using the datakey property,
that would be great. Thanks.
"Shaw" wrote:
I think, the easy way is to refine your DB query and put your work hours and
ids at one record, and store multiple ids at data keys (you can store array
of key at 2.0 and I assume you use 2.0) and access them later.
Shaw
"Wannabe" wrote:
Thanks for the reply, but unless I don't understand the datalist enough, I do
not think that it will work. I need to be able to list a project once, and
then list all hours in a week associated with that project type (would be
multiple records on one line).
>
So the timecard would look like this:
>
Project Name Mon Tue Wed Thu Fri Sat Sun
Total Hours
Project One 1 3 8 8 8
28
Project Two 7 5
12
>
A record id would need to be associated with each hours entry so if the user
wanted to edit just those hours, they could. That is where the gridview breaks
down. I can have a gridview display records just as I want, but not with a
record id
associated with each hour entry.
>
Any suggestions?
>
"Eliyahu Goldin" wrote:
>
Use a DataList control. It is capable of rendering multiple items on a row.
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
"Wannabe" <Wa*****@discus sions.microsoft .comwrote in message
news:C5******** *************** ***********@mic rosoft.com...
Is there a way to use a gridview in a timecard application, and if so,
how? I
was looking at using a gridview to display a person's hours worked in a
week. To do this, many different data records would have to display on the
same row to make up a week (the database has a new row for each day
entered).
But, from what I can tell, this keeps you from being able to use a
gridview,
because the gridview relies on one datakey per row (and there are 7
database
records per one gridview row). Is there a way around this, or do I need to
look in a different direction on building my timecard application?
Thanks...that gives me a good starting point. I'll give that a try and repost
if I need any other information.
"Shaw" wrote:
I am not very sure your database table logic. One possible query is to use
function, such as GetWorkdayHours and GetWorkdayID. So here is a similar
query:
SELECT DISTINCT projected, GetWorkdayHours (‘Monday’, projected ,
weeksatrtday), GetWorkdayHours (‘Tuesday’, projected , weeksatrtday), …,
GetWorkdayID( Monday’, projected , weeksatrtday),
FROM HoursTable
WHERE daterecorded weeksatrtday AND daterecorded < weeksatrtday
To bind keys (VB):
gridView.DataSo urce = dataview_name
gridView.DataKe yNames = New String() {"MondayID", “TuesdayID” ,…}
gridView.DataBi nd()
The best way I think, is to modify your database table to fit your needs.
Hope it works (not sure).
Shaw
"Wannabe" wrote:
Shaw,
Yes, I am using 2.0. You may have hit on something that I can do, but can
you please explain it a little more.
Just to make sure, here is the hours table structure:
recordid int
projectid int
daterecorded datetime
hours decimal
I need to be able to take up to 7 records (could be less) and combine them
into one row, as shown in another post. For each hour, have it associated
with its own recordid. The projectid for each row would be the same for all
hours in that row (and could be changed, if the user picked the wrong one
initially). If you could explain further about using the datakey property,
that would be great. Thanks.
"Shaw" wrote:
I think, the easy way is to refine your DB query and put your work hours and
ids at one record, and store multiple ids at data keys (you can store array
of key at 2.0 and I assume you use 2.0) and access them later.
>
Shaw
>
>
"Wannabe" wrote:
>
Thanks for the reply, but unless I don't understand the datalist enough, I do
not think that it will work. I need to be able to list a project once, and
then list all hours in a week associated with that project type (would be
multiple records on one line).
So the timecard would look like this:
Project Name Mon Tue Wed Thu Fri Sat Sun
Total Hours
Project One 1 3 8 8 8
28
Project Two 7 5
12
A record id would need to be associated with each hours entry so if the user
wanted to edit just those hours, they could. That is where the gridview breaks
down. I can have a gridview display records just as I want, but not with a
record id
associated with each hour entry.
Any suggestions?
"Eliyahu Goldin" wrote:
Use a DataList control. It is capable of rendering multiple items on a row.
>
--
Eliyahu Goldin,
Software Developer
Microsoft MVP [ASP.NET] http://msmvps.com/blogs/egoldin http://usableasp.net
>
>
"Wannabe" <Wa*****@discus sions.microsoft .comwrote in message
news:C5******** *************** ***********@mic rosoft.com...
Is there a way to use a gridview in a timecard application, and if so,
how? I
was looking at using a gridview to display a person's hours worked in a
week. To do this, many different data records would have to display on the
same row to make up a week (the database has a new row for each day
entered).
But, from what I can tell, this keeps you from being able to use a
gridview,
because the gridview relies on one datakey per row (and there are 7
database
records per one gridview row). Is there a way around this, or do I need to
look in a different direction on building my timecard application?
>
>
>
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Kjetil Klaussen |
last post by:
Hi,
I’m having some troubles trying to bind my dataset to a GridView control
through an ObjectDataSource control. The binding works fine for regular
columns in my dataset, but I can’t seem to get my expression columns to show
up in my GridView. Anybody knows any neat tricks to make this work?
Here’s a “step-by-step” to reproduce...
|
by: Jim Katz |
last post by:
I have an application that updates a strongly typed data set at run time.
I'd like to dynamically create a table that connects to a run time data
table. For displaying the data, this works well. I just set the
GridView.DataSource once, and call DataBind();
I'd like to drive the application from the GridView control, by including
command...
|
by: sutphinwb |
last post by:
Hi - This could be a simple question. When I relate two tables in a
datasetet, how do I get that relation to show up in a GridView? The
only way I've done it, is to create a separate table in the dataset
with a join query for the GetData() select method. I use
ObjectDataStore to couple the GridView with the table adapter on the
dataset. ...
|
by: jmdolinger |
last post by:
Hi all,
I'm a newbie to Atlas (and recently ASP.NET) after coming from a long
Java background, also have done quite a bit with an Ajax.NET/ASP.NET
1.1 project, but it was basically all javascript, nothing really having
to do with ASP.NET...
I'm attempting to put together an application that consists of several
GridView controls each...
|
by: samridhi |
last post by:
Hi Do anybody have code example in .net of providing a url for posting or requesting cxml timecard data. I searched the net but didn't found any example.
| |
by: William Youngman |
last post by:
We are developing an application that presents data to the user in a gridview and we are using the dropdown extender to give the user a SharePoint 2007 type dropdown menu attached to the cells of a given column. We are also using another dropdown menu that the user can use to select data using another quesry using the SelectedIndex change method....
|
by: sheenaa |
last post by:
Hello Members,
I m creating my application forms in ASP.Net 2005 C# using the backend SQL Server 2005.
What i have used on forms :: ?
On my first form i have used some label,textboxs,dropdownlists,radiobutton and checkbox asp standard controls.
On the click event of the command button the data gets stored into the...
|
by: hyperpau |
last post by:
CAn anybody give me an advise on the best way to create a payroll or timecard ms access database?
This database should be on a recurring basis, meaning, it talks about all the days in a year.
I can't think of the best way to do this since i am imagining a table with a lot of columns representing the days of each month, which I am sure is not...
|
by: ollyb303 |
last post by:
Hi,
wasn't sure whether I should post this under .net, IIS or access, but I've plumped for .net!
I have a problem with an asp.net website which I am hosting on a windows server 2003 under IIS 6.0.
I am using an access database as the datasource for a gridview - this all works fine when I am running it on the development server in VWD...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in...
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
| |