![]() |
| ||
| C# .NET Gridview I am still pretty new to C# and .NET. I am using .NET 2005, and am attempting to use a Gridview. This GV displays data from two tables, one dependant on the other. I cannot, however, get the GV to Edit/Delete a specific column in any row. I was able to make a GV that displays data from only one table, and I got it to Edit/Delete data. Is there something special that must be done to get 'connected tables' data to be modifiable? Or are the GV's just designed for data modification for one table, but can display data for more than one table? |
| ||
| Re: C# .NET Gridview Are you using sqldatasource as you need to be doing for GridView to work properly, or are you trying this the "old" way with sqldataadapters, etc? |
| ||
| Re: C# .NET Gridview I am using sqldatasource. Quote:
|
| ||
| Re: C# .NET Gridview Okay, can you elaborate on this? "I cannot, however, get the GV to Edit/Delete a specific column in any row" What do you mean by "cannot"? Do you get an error? Does it just not update anything? does the edit button not push it into edit mode? Or ...? And what do you mean by specific column? |
| ||
| Re: C# .NET Gridview My current error is: 'Index was out of range. Must be non-negative and less than the size of the collection.' It blows up on the line of C# code: GridViewRow row = GridView.SelectedRow; I know that I need to supply an index number. What would I do with the index number if/when I get it? As far as 'specific column' goes.....actually, there is only one column that I am trying to update..... Quote:
|
| ||
| Re: C# .NET Gridview row = GridView.SelectedRow; SelectedRow? Where are you trying to put that? Unless you make someone first select a row before being able to edit it, it isn't the right thing to use. In general, GridView is very much out of the box as far as editing and whatnot. Here's a small example using Northwind. <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="_Default2" %> using System; |
| All times are GMT -4. The time now is 7:33 pm. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC