Hi,
I have used the rad grid. In the ItemCommand i have checked for the rows as below. Also, if any of the existing rows in the available 10 are deleted, the user should be able to add one more item. I have used this code:
In the aspx, i have the "hdnRowsCount" set to 0. Once the item is deleted, the user should be able to add new rows again. Also, when the number of rows has reached, "Add new item" option should be hidden. Now It is not gettiong hidden.
How to fix this?
Thanks
I have used the rad grid. In the ItemCommand i have checked for the rows as below. Also, if any of the existing rows in the available 10 are deleted, the user should be able to add one more item. I have used this code:
protected
void
radgrid1_ItemCommand(
object
sender, GridCommandEventArgs e)
{
int
i =
int
.Parse(hdnRowsCount.Value);
if
(e.CommandName == RadGrid.InitInsertCommandName)
{
if
(i < 10)
{
i++;
hdnRowsCount.Value = Convert.ToString(i);
}
else
{
e.Canceled =
true
;
radgrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
}
}
if
(e.CommandName == RadGrid.DeleteCommandName)
{
i--;
}
}
In the aspx, i have the "hdnRowsCount" set to 0. Once the item is deleted, the user should be able to add new rows again. Also, when the number of rows has reached, "Add new item" option should be hidden. Now It is not gettiong hidden.
How to fix this?
Thanks