I have a RadGrid where after clicking "edit" I get the infamous "Object reference not set to an instance of an object" error.
I am using LinqDataSource that has EnableUpdate="true"
Here is the Grid source:
When I set a breakpoint in the EditCommand event, the one line of code there that is hiding the edit column works just fine, then the code never reaches the breakpoint I have in the ItemDataBound event. ANy ideas what could be happenning between these two events? I tried stepping through beyond the EditCommandEvent, but it was stepping through the LINQ designer code.
Thoughts?
Michael
I am using LinqDataSource that has EnableUpdate="true"
Here is the Grid source:
| <telerik:RadGrid ID="rgProducts" runat="server" | |
| AllowFilteringByColumn="True" DataSourceID="ldsProducts" | |
| AllowPaging="True" AllowSorting="True" Skin="Vista" PageSize="20" | |
| oncancelcommand="rgProducts_CancelCommand" Width="99%" | |
| oneditcommand="rgProducts_EditCommand" OnItemDataBound="rgProducts_ItemDataBound" | |
| onupdatecommand="rgProducts_UpdateCommand" AutoGenerateColumns="False" > | |
| <PagerStyle Height="28px" Mode="NextPrevAndNumeric" Position="Bottom"/> | |
| <mastertableview allowfilteringbycolumn="True" allowpaging="True" DataKeyNames="ProductId" | |
| allowsorting="True" TableLayout="Fixed" DataSourceID="ldsProducts"> | |
| <Columns> | |
| <telerik:GridEditCommandColumn> | |
| <HeaderStyle Width="5%" /> | |
| </telerik:GridEditCommandColumn> | |
| <telerik:GridBoundColumn DataField="ProductId" DataType="System.Int32" | |
| HeaderText="Id" ReadOnly="True" SortExpression="ProductId" | |
| UniqueName="ProductId"> | |
| <HeaderStyle Width="15%" /> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridTemplateColumn HeaderText="Type" SortExpression="ProductType.ProductTypeName" CurrentFilterFunction="Contains" AutoPostBackOnFilter="True" > | |
| <ItemTemplate> | |
| <%#Eval("ProductType.ProductTypeName")%> | |
| </ItemTemplate> | |
| <HeaderStyle Width="30%" /> | |
| <ItemStyle Wrap="false" /> | |
| </telerik:GridTemplateColumn> | |
| <telerik:GridBoundColumn DataField="ProComProductCode" | |
| HeaderText="Product Code" SortExpression="ProComProductCode" | |
| UniqueName="ProComProductCode" CurrentFilterFunction="Contains" AutoPostBackOnFilter="True"> | |
| <HeaderStyle Width="15%" /> | |
| <ItemStyle Wrap="false" /> | |
| </telerik:GridBoundColumn> | |
| <telerik:GridBoundColumn DataField="ProductName" HeaderText="Name" | |
| SortExpression="ProductName" UniqueName="ProductName" CurrentFilterFunction="Contains" AutoPostBackOnFilter="True"> | |
| <HeaderStyle Width="35%" /> | |
| <ItemStyle Wrap="false" /> | |
| </telerik:GridBoundColumn> | |
| </Columns> | |
| <editformsettings editformtype="Template"> | |
| <formtemplate> | |
| <!-- left this code out - very large --> | |
| </formtemplate> | |
| <popupsettings scrollbars="None" /> | |
| </editformsettings> | |
| </mastertableview> | |
| </telerik:RadGrid> |
When I set a breakpoint in the EditCommand event, the one line of code there that is hiding the edit column works just fine, then the code never reaches the breakpoint I have in the ItemDataBound event. ANy ideas what could be happenning between these two events? I tried stepping through beyond the EditCommandEvent, but it was stepping through the LINQ designer code.
Thoughts?
Michael