473,398 Members | 2,188 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

DataGrid and DetailsView...

Hi guys.

I have been thrown into the deep end. I don't know ASP, and with my
C#
development, I haven't used data aware controls.
I am swimming OK so far (Image uploaded completed, XML/XSL menu
created for the Master Page) but now now I have been asked to create
a
few screens that allow updating of small tables. Basically, you
select
the category you want to end, and you're presented with a list of
names in that category. You click one in the menu, and are presented
with a 'GridView', which has 'Select' enabled.
Click Select, and a 'DetailsView' is displayed with an 'Edit' and
'Delete' button. The correct data from the selected row in the grid
is
displayed.
Click 'Edit' and the fields become active. I edit. When I click
'Save', things go bad. It doesn't save. Now, my code is completely
wrong.. so it's not worth posting. But here it is anyway, to help you
underdtand how tangled I am:
Basically, the case tests for which 'category' is selected. The
'Select' works fine for all categories. The update fails. Actually,
the code below works, as I am hardcoding.
How do I get the UpdateParameter values from the DetailsView?
case "incidentcategory":
{
odsAdministrator.TypeName =
"DAL.Data.AdministratorDSTableAdapters.DTsortCateg oryTypeTableAdapter";
odsAdministrator.SelectMethod =
"getCategoryTypeData";

odsAdministrator.SelectParameters.Add("ServiceId",
"4");
odsDetails.DataBind();
if (DetailsView1.SelectedValue != null)
{
odsDetails.UpdateParameters.Clear();
odsDetails.UpdateParameters.Add("Id",
DetailsView1.SelectedValue.ToString());
odsDetails.UpdateParameters.Add("ModifierId",
"1");
odsDetails.UpdateParameters.Add("Name",
"TEST!");
odsDetails.TypeName =
odsAdministrator.TypeName;
odsDetails.Update();
}
odsAdministrator.DataBind();
GridView1.DataBind();
DetailsView1.DataBind();
break;
}
How should I be doing this?
Jun 27 '08 #1
0 1075

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Shawn Wildermuth | last post by:
I have a *single* SqlDataSource that loads up a single result set that I show in a GridView. In the GridView, i've added a "Select" button and handling the SelectedItem event. I also have a...
12
by: Jim Hammond | last post by:
I am passing the whole object instead or parameters in my select and update methods. I can get the updated object if I set UpdateMethod, let ASP.NET autogenerate an update button, and then press...
2
by: Dan | last post by:
I found an example of a A Master/Detail DataGrid Control in a MSDN magazine ( http://msdn.microsoft.com/msdnmag/issues/03/08/CuttingEdge/ ). The code is in c# so I converted it to vb.net and I am...
3
by: Antonio | last post by:
I am having a problem finding out how to page a datagrid. I have the procedure for moving from page to page as: private void changePage(object source,...
0
by: mike | last post by:
Hi, When I programatically Bind a DataSource to DetailsView it does not fire "ModeChanged" event. This is first time i am trying to use ASP.NET DetailsView control. I have played with some of the...
5
by: rcoco | last post by:
Hi, I'm working on a asp.net project with a datagrid. I want the user to be adding data into Sql database using the datagrid. So I'm using a ListBox to do this and edit update and delete. I placed...
4
by: rn5a | last post by:
Please have a look at this URL (it won't take even 5 seconds to download): http://rn5a.brinkster.net/Page1.html I want a DataGrid to render itself like the HTML table shown in the above URL....
1
by: Mufasa | last post by:
I've got a table with rows in it. I then have detail records that goes with that row. What I'd like ideally is to have a list of data on the left with a table/grid/view/... on the right with the...
5
by: =?Utf-8?B?bXBhaW5l?= | last post by:
Hello, I am completely lost as to why I can't update a DropDownList inside a DetailsView after I perform an insert into an object datasource. I tried to simply it down to the core demostration:...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
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,...
0
Oralloy
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,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.