Hello,
I wanted to set a few rows in my grid to readonly...I did not see the Readonly property for a row...
I got a piece of code which successfully disable my rows....but it's nt exactly what i wanted.
Code :
With this code...it disables the rows completely. The user can copy a cell etc.
what i want to achieve ios that...when the user is in the add mode...certain rows only are ReadOnly whereby he won't be able to enter values in that row. But he can copy data from the Readonly rows, can navigate etc.
Right now with this code, navigation and copying the data has been lost.
Can anyone please help...How can we make rows Readonly...without losing other features?
Regards
Shaimaa
I wanted to set a few rows in my grid to readonly...I did not see the Readonly property for a row...
I got a piece of code which successfully disable my rows....but it's nt exactly what i wanted.
Code :
public void MakeExistingRowsReadOnly()
{
if (this.Items.ItemCount != 0)
{
for (int i = 0; i < this.Items.Count; i++)
{
GridViewRow currentrow = (GridViewRow)this.ItemContainerGenerator.ContainerFromItem(this.Items[i]);
if (!currentrow.Equals(null))
{
currentrow.IsEnabled =
false;
}
}
}
}
With this code...it disables the rows completely. The user can copy a cell etc.
what i want to achieve ios that...when the user is in the add mode...certain rows only are ReadOnly whereby he won't be able to enter values in that row. But he can copy data from the Readonly rows, can navigate etc.
Right now with this code, navigation and copying the data has been lost.
Can anyone please help...How can we make rows Readonly...without losing other features?
Regards
Shaimaa