J
jhaidon
Hi everybody,
I want to fill in a GridView with a dataset.
So I created the list of fields that I want to see in the gridview.
And I added a column (in first position in the gridview) as a
ButtonField column (ButtonType: button).
My records are loaded correctly.
During the RowDataBound event, I tried to change the Text of the button
for some records (depends of a check on others cells).
if (e.Row.Cells[12].Text == var.ToString())
e.Row.Cells[0].Text = "Cancel";
else
e.Row.Cells[0].Text = "Accept";
When I keep this check (and set), the text is changed, perfect.
But the type of my button is also changed.
That become a link type (ButtonType: link) and no more a "button" type.
Why ?
I don't understand what's happening :-{
If I don't perform my check (and set), the type of my ButtonField stays
"button".
Do you have a idea of what is wrong ?
Thanks in advance
Jerome
PS: I use the framework 2.0 (and VS2005).
I want to fill in a GridView with a dataset.
So I created the list of fields that I want to see in the gridview.
And I added a column (in first position in the gridview) as a
ButtonField column (ButtonType: button).
My records are loaded correctly.
During the RowDataBound event, I tried to change the Text of the button
for some records (depends of a check on others cells).
if (e.Row.Cells[12].Text == var.ToString())
e.Row.Cells[0].Text = "Cancel";
else
e.Row.Cells[0].Text = "Accept";
When I keep this check (and set), the text is changed, perfect.
But the type of my button is also changed.
That become a link type (ButtonType: link) and no more a "button" type.
Why ?
I don't understand what's happening :-{
If I don't perform my check (and set), the type of my ButtonField stays
"button".
Do you have a idea of what is wrong ?
Thanks in advance
Jerome
PS: I use the framework 2.0 (and VS2005).