J
JD
I cannot for the life of me figure out why my DataKeys collection won't
populate.
in the .aspx page I set DataKeyField="ID",
my datasource is a class which implementes IEnumerable. The items held by
my class do have an ID property.
I am attempting to use my DataKeys in a button event:
private void Received_Click(object sender, System.EventArgs e)
{
Response.Write( Grid.DataKeys.Count )
/*
string queryString="";
for(int i = 0 ; i < GridItems.Count; i++)
{
CheckBox blah= (CheckBox)Grid.Items.Controls[0].Controls[1];
if( blah.Checked )
queryString = queryString + Grid.DataKeys.Text() +",";
}
*/
}
The size of DataKeys is always 0. What really confuses me is that when I
assign the DataKeyField to a non-existent property, I never get an error
message. This makes me think that I have disabled DataKeys somehow.
Any insight into this...I'm totally stumped!
JD
populate.
in the .aspx page I set DataKeyField="ID",
my datasource is a class which implementes IEnumerable. The items held by
my class do have an ID property.
I am attempting to use my DataKeys in a button event:
private void Received_Click(object sender, System.EventArgs e)
{
Response.Write( Grid.DataKeys.Count )
/*
string queryString="";
for(int i = 0 ; i < GridItems.Count; i++)
{
CheckBox blah= (CheckBox)Grid.Items.Controls[0].Controls[1];
if( blah.Checked )
queryString = queryString + Grid.DataKeys.Text() +",";
}
*/
}
The size of DataKeys is always 0. What really confuses me is that when I
assign the DataKeyField to a non-existent property, I never get an error
message. This makes me think that I have disabled DataKeys somehow.
Any insight into this...I'm totally stumped!
JD