P
pittster
I'm trying to change the text that is displayed for the Select command
of a CommandField.
I'm figuring that it would have to occur during the RowDataBound event.
Here is the code I've started with (which doesn't work):
protected void GridView2_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
CommandField objComField =
(CommandField)e.Row.Cells[0].Controls[0];
objComField.SelectText = DataBinder.Eval(e.Row.DataItem,
"Name").ToString();
}
}
I guess what I really need to know is how to get at the Command field.
If this is impossible, could it be done with a button field, and how...
Thanks
of a CommandField.
I'm figuring that it would have to occur during the RowDataBound event.
Here is the code I've started with (which doesn't work):
protected void GridView2_RowDataBound(object sender,
GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
CommandField objComField =
(CommandField)e.Row.Cells[0].Controls[0];
objComField.SelectText = DataBinder.Eval(e.Row.DataItem,
"Name").ToString();
}
}
I guess what I really need to know is how to get at the Command field.
If this is impossible, could it be done with a button field, and how...
Thanks