Newvalues in a gridview

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Garudzo
    New Member
    • May 2007
    • 20

    Newvalues in a gridview

    Hi Gurus

    I have created a small application to load data into a gridview from a dataset. Now I want to update the data set but when I try to use the keys() and the newvalues() arrays they all do not contain any data. I am biding the gridview in code. How do I enable my gridview to populate the keys() and the newvalues collections in a gridview that i set properties programmaticall y. I am using vb.net
  • Murugs
    New Member
    • Nov 2007
    • 18

    #2
    Can you put the sample code?

    Comment

    • Garudzo
      New Member
      • May 2007
      • 20

      #3
      Originally posted by Murugs
      Can you put the sample code?
      After filligng my datest called dsenrol I have the following code.

      Code:
      GridView1.DataSource = DsEnrol
                  GridView1.AutoGenerateColumns = "False"
                  GridView1.DataKeyNames = New String() {"Institution_id", "Year_id", "field1"}
                  GridView1.DataBind()
      I have edited the grid colums and specified the fields I want to show in the grid.

      Comment

      • Murugs
        New Member
        • Nov 2007
        • 18

        #4
        Hi,
        //GridView1.DataK eyNames = New String() {"Institution_i d", "Year_id", "field1"}
        what exactly u r trying to do in this line.
        Is all the three columns are primary columns?
        r u using the below code to get datakey values?
        //Gridview1.DataK eys
        can you post all the code so that we can sense the exact error?

        Thanks,
        Murugs.

        Comment

        Working...