dropdownlist inside a gridview with Edit,Update,Cancel

D

das

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>
<asp:DropDownList 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>
</asp:DropDownList>
</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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,818
Messages
2,569,736
Members
45,708
Latest member
RenaldoFor

Latest Threads

Top