Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > Where are the Update/Cancel buttons?

Reply
Thread Tools

Where are the Update/Cancel buttons?

 
 
David Hallaran
Guest
Posts: n/a
 
      04-05-2005
Hi all!

I have a treeview. (Irrelevant).

In the target page I have a DataGrid populated with several data Items (a
SQL SP resultset as a DataTable.) and columns with Edit and Delete html
buttons.

There is a button outside of the grid labeled Add.

The Add button's purpose is to Clear() the DataTable which is the grid's
DataSource. After the clear() the Add function then adds a row to the
DataTable using DataTable.NewRow() followed by DataTable.InsertAt(). Then a
DataGrid.DataBind().

Sure enough the grid is cleared, the added DataGrid Item appears. The intent
is to allow the user fill in the new row and continue to add as necessary.

The problem: There is no Edit button, only Delete.

What am I doing wrong?

Thanks.


 
Reply With Quote
 
 
 
 
Uri
Guest
Posts: n/a
 
      04-06-2005
Hi David,

Maybe you need to set the grid's EditItemIndex to point to the Item to be
edited?

Regards,
urig

"David Hallaran" <> wrote in message
news5E4e.29491$. com...
> Hi all!
>
> I have a treeview. (Irrelevant).
>
> In the target page I have a DataGrid populated with several data Items (a
> SQL SP resultset as a DataTable.) and columns with Edit and Delete html
> buttons.
>
> There is a button outside of the grid labeled Add.
>
> The Add button's purpose is to Clear() the DataTable which is the grid's
> DataSource. After the clear() the Add function then adds a row to the
> DataTable using DataTable.NewRow() followed by DataTable.InsertAt(). Then

a
> DataGrid.DataBind().
>
> Sure enough the grid is cleared, the added DataGrid Item appears. The

intent
> is to allow the user fill in the new row and continue to add as necessary.
>
> The problem: There is no Edit button, only Delete.
>
> What am I doing wrong?
>
> Thanks.
>
>



 
Reply With Quote
 
 
 
 
David Hallaran
Guest
Posts: n/a
 
      04-06-2005
urig,

Thank you. I left that out of my post. I did. The record is added at the top
of the DataTable and EditemIndex was set. The grid would come up in Edit
mode. Just no Edit button in the EditCommndColumn.

But I fixed it today: new project, new DataGrid. Pasted in the relevant code
behind as described below. Voila!!!

I've heard of all sorts of 'bugs' with the DataGrid.

"Uri" <> wrote in message
news:4253ef4e$...
> Hi David,
>
> Maybe you need to set the grid's EditItemIndex to point to the Item to be
> edited?
>
> Regards,
> urig
>
> "David Hallaran" <> wrote in message
> news5E4e.29491$. com...
> > Hi all!
> >
> > I have a treeview. (Irrelevant).
> >
> > In the target page I have a DataGrid populated with several data Items

(a
> > SQL SP resultset as a DataTable.) and columns with Edit and Delete html
> > buttons.
> >
> > There is a button outside of the grid labeled Add.
> >
> > The Add button's purpose is to Clear() the DataTable which is the grid's
> > DataSource. After the clear() the Add function then adds a row to the
> > DataTable using DataTable.NewRow() followed by DataTable.InsertAt().

Then
> a
> > DataGrid.DataBind().
> >
> > Sure enough the grid is cleared, the added DataGrid Item appears. The

> intent
> > is to allow the user fill in the new row and continue to add as

necessary.
> >
> > The problem: There is no Edit button, only Delete.
> >
> > What am I doing wrong?
> >
> > Thanks.
> >
> >

>
>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off




Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57