Hi,
I have the below code in Itemcommand. I want to restrict users to enter only 2 rows. And also, if an existing row is deleted and number of rows is within 2, user should be able to add new item. This code is not working
Also, i am clicking on "ADD NEW ITEM" twice to make it disapper.
If the items inserted are 2 then automatically the "add new item" should not be displayed.
How to fix this?
I have the below code in Itemcommand. I want to restrict users to enter only 2 rows. And also, if an existing row is deleted and number of rows is within 2, user should be able to add new item. This code is not working
int count = radgrid1.MasterTableView.Items.Count;
if (count > 2)
{
e.Canceled = true;
radgrid1r.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.None;
}
else
{
radgrid1.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.TopAndBottom;
}
Also, i am clicking on "ADD NEW ITEM" twice to make it disapper.
If the items inserted are 2 then automatically the "add new item" should not be displayed.
How to fix this?