CANT see EDIT UPDATE CANCEL Buttons for DATAGRID

Discussion in 'ASP .Net' started by =?Utf-8?B?cG11ZA==?=, Dec 28, 2004.

  1. Hi,

    I have an ASP.NET application using C# code. I am using a datagrid to
    display records from a database based on a user input, i.e a user enters a
    compnay name in text box & when he clicks a "Submit" button, only those
    records are displayed where company name matches with user input.

    I need the datagrid to be editable. For this i used the walkthrough from
    ..NET "Using a datagrid for reading & writing data to database" or it was some
    similar name.
    This code works fine when the datagrid shows all records but for the data
    grid which shows only the records based on user input, this walkthrough
    doesnt work. I think its bcoz i fill the dataset on "Submit" button click
    rather than on page load. So when I hit the submit button after entering
    Company name, I get to view records of that company. But WHEN I HIT the EDIT
    LINK NEXT TO THE RECORD , I DONT SEE EDIT, UPDATE & CANCEL BUTTONS. I can
    ONLY see those buttons when I hit submit again!!!

    How to get over this?

    --
    pmud
     
    =?Utf-8?B?cG11ZA==?=, Dec 28, 2004
    #1
    1. Advertising

  2. Yes, your idea is likely. Move the code that fills the dataset to its own
    routine and call from the button click. Call again from the EDIT postback
    routine just prior to asking for a particular edit column. If not, you will
    get either a) nothing or b) whatever is "cached" in viewstate.


    ---

    Gregory A. Beamer
    MVP; MCP: +I, SE, SD, DBA

    ***************************
    Think Outside the Box!
    ***************************

    "pmud" wrote:

    > Hi,
    >
    > I have an ASP.NET application using C# code. I am using a datagrid to
    > display records from a database based on a user input, i.e a user enters a
    > compnay name in text box & when he clicks a "Submit" button, only those
    > records are displayed where company name matches with user input.
    >
    > I need the datagrid to be editable. For this i used the walkthrough from
    > .NET "Using a datagrid for reading & writing data to database" or it was some
    > similar name.
    > This code works fine when the datagrid shows all records but for the data
    > grid which shows only the records based on user input, this walkthrough
    > doesnt work. I think its bcoz i fill the dataset on "Submit" button click
    > rather than on page load. So when I hit the submit button after entering
    > Company name, I get to view records of that company. But WHEN I HIT the EDIT
    > LINK NEXT TO THE RECORD , I DONT SEE EDIT, UPDATE & CANCEL BUTTONS. I can
    > ONLY see those buttons when I hit submit again!!!
    >
    > How to get over this?
    >
    > --
    > pmud
     
    =?Utf-8?B?Q293Ym95IChHcmVnb3J5IEEuIEJlYW1lcikgLSBN, Dec 28, 2004
    #2
    1. Advertising

  3. i agree. however, if you need to update the datagrid on page_load, you need
    to do the following otherwise you will be running in circles.

    void Page_Load(){
    if(!Page.IsPostBack){
    //put your function here
    }
    }

    hope this helps.
    bg

    "Cowboy (Gregory A. Beamer) - MVP" wrote:

    > Yes, your idea is likely. Move the code that fills the dataset to its own
    > routine and call from the button click. Call again from the EDIT postback
    > routine just prior to asking for a particular edit column. If not, you will
    > get either a) nothing or b) whatever is "cached" in viewstate.
    >
    >
    > ---
    >
    > Gregory A. Beamer
    > MVP; MCP: +I, SE, SD, DBA
    >
    > ***************************
    > Think Outside the Box!
    > ***************************
    >
    > "pmud" wrote:
    >
    > > Hi,
    > >
    > > I have an ASP.NET application using C# code. I am using a datagrid to
    > > display records from a database based on a user input, i.e a user enters a
    > > compnay name in text box & when he clicks a "Submit" button, only those
    > > records are displayed where company name matches with user input.
    > >
    > > I need the datagrid to be editable. For this i used the walkthrough from
    > > .NET "Using a datagrid for reading & writing data to database" or it was some
    > > similar name.
    > > This code works fine when the datagrid shows all records but for the data
    > > grid which shows only the records based on user input, this walkthrough
    > > doesnt work. I think its bcoz i fill the dataset on "Submit" button click
    > > rather than on page load. So when I hit the submit button after entering
    > > Company name, I get to view records of that company. But WHEN I HIT the EDIT
    > > LINK NEXT TO THE RECORD , I DONT SEE EDIT, UPDATE & CANCEL BUTTONS. I can
    > > ONLY see those buttons when I hit submit again!!!
    > >
    > > How to get over this?
    > >
    > > --
    > > pmud
     
    =?Utf-8?B?Qkc=?=, Dec 28, 2004
    #3
  4. Hi Gregory,

    For updating the SQL database using data grid , is primary key required? I
    dont have a primary key in the SQl table. Is it possible to do the same
    thing if I dont want to make a primary key ???

    "Cowboy (Gregory A. Beamer) - MVP" wrote:

    > Yes, your idea is likely. Move the code that fills the dataset to its own
    > routine and call from the button click. Call again from the EDIT postback
    > routine just prior to asking for a particular edit column. If not, you will
    > get either a) nothing or b) whatever is "cached" in viewstate.
    >
    >
    > ---
    >
    > Gregory A. Beamer
    > MVP; MCP: +I, SE, SD, DBA
    >
    > ***************************
    > Think Outside the Box!
    > ***************************
    >
    > "pmud" wrote:
    >
    > > Hi,
    > >
    > > I have an ASP.NET application using C# code. I am using a datagrid to
    > > display records from a database based on a user input, i.e a user enters a
    > > compnay name in text box & when he clicks a "Submit" button, only those
    > > records are displayed where company name matches with user input.
    > >
    > > I need the datagrid to be editable. For this i used the walkthrough from
    > > .NET "Using a datagrid for reading & writing data to database" or it was some
    > > similar name.
    > > This code works fine when the datagrid shows all records but for the data
    > > grid which shows only the records based on user input, this walkthrough
    > > doesnt work. I think its bcoz i fill the dataset on "Submit" button click
    > > rather than on page load. So when I hit the submit button after entering
    > > Company name, I get to view records of that company. But WHEN I HIT the EDIT
    > > LINK NEXT TO THE RECORD , I DONT SEE EDIT, UPDATE & CANCEL BUTTONS. I can
    > > ONLY see those buttons when I hit submit again!!!
    > >
    > > How to get over this?
    > >
    > > --
    > > pmud
     
    =?Utf-8?B?cG11ZA==?=, Dec 28, 2004
    #4
    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:
    746
    =?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:
    519
    =?Utf-8?B?SmFjcXVlcyBMZWNsZXJj?=
    Jul 6, 2004
  3. Craig G
    Replies:
    2
    Views:
    695
    Patrick Olurotimi Ige
    Dec 14, 2004
  4. Nagaraj
    Replies:
    1
    Views:
    916
    Lionel B
    Mar 1, 2007
  5. Marco Liedekerken
    Replies:
    0
    Views:
    1,120
    Marco Liedekerken
    Nov 8, 2006
Loading...

Share This Page