Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Datagrid Control > dropdownlist inside a gridview with Edit,Update,Cancel

Reply
Thread Tools

dropdownlist inside a gridview with Edit,Update,Cancel

 
 
das
Guest
Posts: n/a
 
      09-18-2006
Hi,
I am having a dropdownlist & textbox inside a gridview control in
VS.NET 2005/ asp.net 2.0/C#

I wanna invoke edit. update,cancel operations on th record/row of
gridview when the user clicks the edit , cancel buttons.
i hav googled abt this but in vain since all the samples hav used
either sqldatasource/ object datasource. as per the reqmnt i shud not
use these 2 in built controls.
so i cant use datatextfield, datasourceid, datavaluefield properties
of dropddownlist
( if yes how can i use ??? or shud I ??)

1) shud the autopostback set to true?? in this case.since i hav to
accept the selected
text of drodpwon and passs i to SP to update the DBase.
2)if anybodyprovide me some code snipet what manipulations i hav to do
in the

gridvu1_rowupdating(s,e),
gridvu1_rowediting(s,e),
gridvu1_datarowbound(s,e) events in the code behind file..


I am using enterprise library 2.0 , with db.ExecuteDataset(SPName,
params[])
for fetching the dataset,.

can anybody help me to throw some light in by giving some sample code
snipet,regdng
this issue,

follow. is the code snipet of designer part of web page. under
<asp:gridview>

<asp:TemplateField HeaderText="Checked">
<EditItemTemplate>
<aspropDownList ID="ddlstChecked"
runat="server">
<asp:ListItem Text="Yes"
Value="1"></asp:ListItem>
<asp:ListItem Text="No"
Value="0"></asp:ListItem>
<asp:ListItem Text="NA"
Value="-1"></asp:ListItem>
</aspropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="lblstatus" runat="server"
Text='<%# Bind("status")%>'> </asp:Label>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="Remarks">
<ItemTemplate>
<asp:Label ID="lblRemarks" runat="server"
Text='<%# Bind("remarks")%>'></asp:Label>
</ItemTemplate>
<EditItemTemplate>
<asp:TextBox ID="txtRemarks" Enabled=true
runat="server" TextMode="MultiLine"></asp:TextBox>
</EditItemTemplate>
</asp:TemplateField>
<asp:CommandField HeaderText="EDITRECORDS"
ButtonType="Button" ShowEditButton="True" ShowHeader="True"
ShowDeleteButton=True />


any help is highly appreciated, thnx in advance

 
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


Similar Threads
Thread Thread Starter Forum Replies Last Post
DropDownList inside GridView won't fire any longer! aka - I moved a page to another web-site and now it's broke! mark4asp ASP .Net 1 03-26-2007 04:06 PM
DropDownList inside GridView: How to set SelectedIndex for the DropDownList? keithb ASP .Net 1 11-01-2006 05:24 AM
newbie DropDownList inside a GridView cell question keithb ASP .Net 1 03-29-2006 08:44 PM
GridView: Filter DropDownList for another DropDownList =?Utf-8?B?SnVhbmpv?= ASP .Net 0 12-29-2005 07:44 AM
GridView: Filtr DropDownList from another DropDownList =?Utf-8?B?SnVhbmpv?= ASP .Net 0 12-23-2005 01:31 PM



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