PC Review


Reply
Thread Tools Rate Thread

ASP.Net - Adding User Controls to DataGrid

 
 
=?Utf-8?B?UmljaGFyZA==?=
Guest
Posts: n/a
 
      20th Dec 2005
Instead of button columns, I need to add a column of dropdownlists to my
datagrid, with options such as ADD, EDIT, and DELETE to each row of data. How
can I do that?

Thanks,

Richard

 
Reply With Quote
 
 
 
 
W.G. Ryan - MVP
Guest
Posts: n/a
 
      20th Dec 2005
Use a template column...
http://www.dotnetjunkies.com/Tutoria...9F4C739BC.dcik

http://search.msn.com/results.aspx?q...Grid&FORM=QBHP
"Richard" <(E-Mail Removed)> wrote in message
news:50978E75-33D5-4BD2-8F13-(E-Mail Removed)...
> Instead of button columns, I need to add a column of dropdownlists to my
> datagrid, with options such as ADD, EDIT, and DELETE to each row of data.
> How
> can I do that?
>
> Thanks,
>
> Richard
>



 
Reply With Quote
 
=?Utf-8?B?UmljaGFyZA==?=
Guest
Posts: n/a
 
      20th Dec 2005
It works great!

Thanks.

"W.G. Ryan - MVP" wrote:

> Use a template column...
> http://www.dotnetjunkies.com/Tutoria...9F4C739BC.dcik
>
> http://search.msn.com/results.aspx?q...Grid&FORM=QBHP
> "Richard" <(E-Mail Removed)> wrote in message
> news:50978E75-33D5-4BD2-8F13-(E-Mail Removed)...
> > Instead of button columns, I need to add a column of dropdownlists to my
> > datagrid, with options such as ADD, EDIT, and DELETE to each row of data.
> > How
> > can I do that?
> >
> > Thanks,
> >
> > Richard
> >

>
>
>

 
Reply With Quote
 
=?Utf-8?B?UmljaGFyZA==?=
Guest
Posts: n/a
 
      20th Dec 2005
I have added a template column of dropdownlist to the datagrid, with 2
options ("No Change" and "Delete") on each dropdownlist. "No Change" is
selected by default during design time.

The user will mark the grid items to delete by selecting the "Delete"
option. The user can then click the DELETE button (not on the datagrid, but
on the form) to delete all marked grid items in one batch.

I am trying to loop thru grid items to build SQL DELETE query, by checking
the following:

Dim lcboAction As DropDownList
lcboAction =
CType(Me.gridDisplay.Items(lnIndex).Cells(0).Controls(0).FindControl("cboAction"), DropDownList)

However, lcboAction.SelectedValue always equals to "No Change" even for the
ones I have marked as "Delete". Why? Am I missing something here?

Thanks in advance,

Richard



"W.G. Ryan - MVP" wrote:

> Use a template column...
> http://www.dotnetjunkies.com/Tutoria...9F4C739BC.dcik
>
> http://search.msn.com/results.aspx?q...Grid&FORM=QBHP
> "Richard" <(E-Mail Removed)> wrote in message
> news:50978E75-33D5-4BD2-8F13-(E-Mail Removed)...
> > Instead of button columns, I need to add a column of dropdownlists to my
> > datagrid, with options such as ADD, EDIT, and DELETE to each row of data.
> > How
> > can I do that?
> >
> > Thanks,
> >
> > Richard
> >

>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding controls to a datagrid column? Milsnips Microsoft Dot NET Compact Framework 3 23rd Mar 2007 10:21 PM
Adding User Controls Jonathan Wood Microsoft ASP .NET 3 4th Dec 2006 08:44 PM
What is the best way of adding various user Controls? [Win #C] MikeY Microsoft C# .NET 3 19th May 2006 06:41 PM
Filling One DataGrid Based on Selection from Another DataGrid - Both in Separate User Controls thegame Microsoft ASP .NET 1 28th Feb 2005 04:23 PM
Access User Control DataGrid Controls from parent page =?Utf-8?B?UmFlZCBTYXdhbGhh?= Microsoft ASP .NET 1 16th Feb 2005 04:44 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:25 AM.