I am in love with the new RadGrid EditMode = Batch feature!
There is just two snags I have ran into. I am switching our grid from EditMode = InPlace to Batch. I have removed the GradEditCommandColumn that I had in place. Which helped a lot with my columns lining up since I also added in the Scrolling Feature. :)
If the date is older than a month, we need to lock down the grid so the users can not make any changes to it. In the past I just hid the Edit and delete button for this. Now, with Batch I am unsure how to turn off the edit mode?
Also, The grid is for our Time Management, so the headers say Sunday, Monday, etc with the corresponding dates underneath. (ie this week the headers read: Sunday 07/21/2013, Monday 07/22/2013, etc).
The code I have to do this blows up now. (It errors on the first time in the example below).
Error message:
Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.
Any help will be much appreciated!
There is just two snags I have ran into. I am switching our grid from EditMode = InPlace to Batch. I have removed the GradEditCommandColumn that I had in place. Which helped a lot with my columns lining up since I also added in the Scrolling Feature. :)
<
Telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"EditCommandColumn"
>
<
HeaderStyle
Width
=
"40px"
/>
<
ItemStyle
CssClass
=
"MyImageButton"
/>
</
Telerik:GridEditCommandColumn
>
If the date is older than a month, we need to lock down the grid so the users can not make any changes to it. In the past I just hid the Edit and delete button for this. Now, with Batch I am unsure how to turn off the edit mode?
GridTime.MasterTableView.GetColumn("EditCommandColumn").Visible = false;
Also, The grid is for our Time Management, so the headers say Sunday, Monday, etc with the corresponding dates underneath. (ie this week the headers read: Sunday 07/21/2013, Monday 07/22/2013, etc).
The code I have to do this blows up now. (It errors on the first time in the example below).
GridHeaderItem headerItem = GridTime.MasterTableView.GetItems(GridItemType.Header)[0] as GridHeaderItem;
headerItem["Sunday"].Text = reader.GetValue(0).ToString();
headerItem["Monday"].Text = reader.GetValue(1).ToString();
headerItem["Tuesday"].Text = reader.GetValue(2).ToString();
headerItem["Wednesday"].Text = reader.GetValue(3).ToString();
headerItem["Thursday"].Text = reader.GetValue(4).ToString();
headerItem["Friday"].Text = reader.GetValue(5).ToString();
headerItem["Saturday"].Text = reader.GetValue(6).ToString();
Error message:
Index was outside the bounds of the array.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details: System.IndexOutOfRangeException: Index was outside the bounds of the array.
Any help will be much appreciated!