CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Dec 2004
    Posts
    8

    Talking Datakeys function as property??

    Hey there!
    I'm wondering if someone can help me - I'm trying to implement a checkbox in a datagrid and I've written the following code to locate which checkbox has been checked:

    gridSelections.AppendFormat("The checkbox for {0} was selected <br>", DataGrid1.DataKeys(DataGrid1Item.ItemIndex).ToString());
    The compiler keeps throwing the following the error:

    System.Web.UI.WebControls.BaseDataList.DataKeys' denotes a 'property' where a 'method' was expected

    I'm wondering if someone knows how to solve the above problem?
    Thanx

  2. #2
    Join Date
    Aug 2002
    Location
    Kerala
    Posts
    1,183

    Re: Datakeys function as property??

    You must have been coding in VB for too long

    use

    DataGrid1.DataKeys[DataGrid1Item.ItemIndex]

    instead of

    DataGrid1.DataKeys(DataGrid1Item.ItemIndex)
    Last edited by Sahir; December 15th, 2004 at 03:22 AM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured