Click here to Skip to main content
15,893,588 members
Home / Discussions / ASP.NET
   

ASP.NET

 
QuestionOpen a grid view in edit mode? Pin
docsoft28-Mar-08 23:50
docsoft28-Mar-08 23:50 
GeneralRe: Open a grid view in edit mode? Pin
Rocky#29-Mar-08 1:24
Rocky#29-Mar-08 1:24 
GeneralRe: Open a grid view in edit mode? Pin
docsoft29-Mar-08 7:28
docsoft29-Mar-08 7:28 
GeneralRe: Open a grid view in edit mode? Pin
Rocky#30-Mar-08 20:43
Rocky#30-Mar-08 20:43 
GeneralRe: Open a grid view in edit mode? Pin
farazsk1129-Mar-08 2:11
farazsk1129-Mar-08 2:11 
GeneralRe: Open a grid view in edit mode? Pin
docsoft29-Mar-08 7:18
docsoft29-Mar-08 7:18 
GeneralRe: Open a grid view in edit mode? Pin
farazsk1129-Mar-08 8:04
farazsk1129-Mar-08 8:04 
GeneralRe: Open a grid view in edit mode? Pin
docsoft29-Mar-08 8:40
docsoft29-Mar-08 8:40 
If I use your code, I get an error message, can you tell me why?

Here is my code:

public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
GridView1.EditIndex = 0;
GridView1.DataSource = "SqlDataSource1";
GridView1.DataBind();
}

}
}


Here is the error message:

System.InvalidOperationException was unhandled by user code
Message="for GridView1 are DataSource and DataSourceID defined. Delete one of them (is translated by me German = English)”
Source="System.Web"
StackTrace:
bei System.Web.UI.WebControls.DataBoundControl.ConnectToDataSourceView()
bei System.Web.UI.WebControls.DataBoundControl.GetData()
bei System.Web.UI.WebControls.DataBoundControl.PerformSelect()
bei System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
bei System.Web.UI.WebControls.GridView.DataBind()
bei _Default.Page_Load(Object sender, EventArgs e) in
....
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
bei System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
bei System.Web.UI.Control.OnLoad(EventArgs e)
bei System.Web.UI.Control.LoadRecursive()
bei System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException:

Thanks!

Best regards
Klaus
GeneralRe: Open a grid view in edit mode? Pin
farazsk1129-Mar-08 9:54
farazsk1129-Mar-08 9:54 
Generalhelp Pin
V.Sen...28-Mar-08 23:43
V.Sen...28-Mar-08 23:43 
GeneralRe: help Pin
farazsk1129-Mar-08 2:48
farazsk1129-Mar-08 2:48 
Questionsession timeout Pin
Soumini Ramakrishnan28-Mar-08 19:58
Soumini Ramakrishnan28-Mar-08 19:58 
GeneralRe: session timeout Pin
N a v a n e e t h28-Mar-08 20:33
N a v a n e e t h28-Mar-08 20:33 
GeneralRe: session timeout Pin
farazsk1129-Mar-08 2:23
farazsk1129-Mar-08 2:23 
GeneralSlow FTP transfer on Production server Pin
Gus'O.28-Mar-08 10:28
Gus'O.28-Mar-08 10:28 
Generalerror on insert a new row in a custom gridview Pin
zio_pino28-Mar-08 8:40
zio_pino28-Mar-08 8:40 
GeneralRe: error on insert a new row in a custom gridview Pin
led mike28-Mar-08 9:07
led mike28-Mar-08 9:07 
GeneralRe: error on insert a new row in a custom gridview Pin
zio_pino31-Mar-08 5:32
zio_pino31-Mar-08 5:32 
QuestionDropDownList Creation Pin
kontax28-Mar-08 8:08
kontax28-Mar-08 8:08 
GeneralRe: DropDownList Creation Pin
Mark J. Miller28-Mar-08 9:25
Mark J. Miller28-Mar-08 9:25 
GeneralRe: DropDownList Creation Pin
kontax28-Mar-08 10:04
kontax28-Mar-08 10:04 
GeneralRe: DropDownList Creation Pin
Mark J. Miller31-Mar-08 6:26
Mark J. Miller31-Mar-08 6:26 
QuestionHow to read Texbox value in a grid Pin
lav naphade28-Mar-08 8:05
lav naphade28-Mar-08 8:05 
GeneralRe: How to read Texbox value in a grid Pin
Mark J. Miller28-Mar-08 9:39
Mark J. Miller28-Mar-08 9:39 
GeneralRe: How to read Texbox value in a grid Pin
lav naphade29-Mar-08 6:01
lav naphade29-Mar-08 6:01 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.