GridView - Select Row

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • shapper

    #1

    GridView - Select Row

    Hello,

    I have a two elements on my page: a GridView and form that has various
    controls (textboxes, dropdownlists, etc)

    When I click a GridView row I need to fill the form controls.
    I will use visible and invisible columns in the gridview selected row.

    Then I when I click the button of the form I am submitting the form
    values but there are also a few values which I don't want to show in
    the form, like RecordId (GUID) but then I will need to submit.

    How should I do this?

    Thanks,
    Miguel

  • =?Utf-8?B?U3JpcmFtIFN1cmFwdXJlZGR5?=

    #2
    RE: GridView - Select Row

    one way to do this is using javascript.
    In itemdatabound event of grid view add the attribute like this

    if (e.Item.ItemTyp e != ListItemType.He ader && e.Item.ItemType !=
    ListItemType.Fo oter)
    {
    e.Item.Attribut es.Add("onclick ", "javascript:You rFunction('" +
    e.Item.Cells[0].Text + "','" + e.Item.Cells[1].Text + "','" +
    e.Item.Cells[2].Text + "','" + e.Item.Cells[3].Text + "','" +
    (e.Item.ItemInd ex + 1) + "')");
    }
    and in the javascript function YourFunction assign the values to the form
    controls using document.elemen tbyid function

    Hope this helps.

    "shapper" wrote:
    Hello,
    >
    I have a two elements on my page: a GridView and form that has various
    controls (textboxes, dropdownlists, etc)
    >
    When I click a GridView row I need to fill the form controls.
    I will use visible and invisible columns in the gridview selected row.
    >
    Then I when I click the button of the form I am submitting the form
    values but there are also a few values which I don't want to show in
    the form, like RecordId (GUID) but then I will need to submit.
    >
    How should I do this?
    >
    Thanks,
    Miguel
    >
    >

    Comment

    Working...