dropdownlist inside a gridview with Edit,Update,Cancel

Discussion in 'ASP .Net Datagrid Control' started by das, Sep 18, 2006.

  1. das

    das Guest

    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
     
    das, Sep 18, 2006
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?U3RldmUgS2FsbGFs?=

    CssClass on DataGrid Edit, Update & Cancel buttons

    =?Utf-8?B?U3RldmUgS2FsbGFs?=, Jul 6, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    736
    =?Utf-8?B?U3RldmUgS2FsbGFs?=
    Jul 6, 2004
  2. =?Utf-8?B?SmFjcXVlcyBMZWNsZXJj?=

    RE: Setting CssClass on Edit, Update & Cancel buttons

    =?Utf-8?B?SmFjcXVlcyBMZWNsZXJj?=, Jul 6, 2004, in forum: ASP .Net
    Replies:
    0
    Views:
    510
    =?Utf-8?B?SmFjcXVlcyBMZWNsZXJj?=
    Jul 6, 2004
  3. Vincent
    Replies:
    2
    Views:
    689
    gustmg
    Feb 10, 2009
  4. Marco Liedekerken
    Replies:
    0
    Views:
    1,075
    Marco Liedekerken
    Nov 8, 2006
  5. Gerry Cook

    Gridview - Edit,Update,Cancel doesn't work

    Gerry Cook, Oct 3, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    465
    Gerry Cook
    Oct 3, 2006
Loading...

Share This Page