Hello!
Please, I need help with the following.
Am I doing something wrong there?
Please, I need help with the following.
| <detailtables> |
| <telerik:GridTableView |
| runat="server" |
| Width="100%" |
| DataKeyNames="Field1" |
| PageSize="20" |
| ShowFooter="True" |
| > |
| protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) |
| { int i = (int)this.RadGrid1.MasterTableView.DataKeyValues[e.Item.OwnerTableView.ParentItem.ItemIndex]["MasterField"]); int j = (int)this.RadGrid1.MasterTableView.DetailTables[0].DataKeyValues[e.Item.ItemIndex]["Field1"]; |
| // The second expression will result in "index out of bound" exception - it doesn't find any DataKeyValue elements // WHEN I DEBUG AND LOOK AT |
| this.RadGrid1.MasterTableView.DataKeyValues; |
| // ITS COUNT IS WHAT IT'S SUPPOSED TO BE : |
| // BUT THIS: |
| this.RadGrid1.MasterTableView.DetailTables[0].DataKeyValues; |
| // IS ALWAYS ZERO. IT DOESN'T GIVE ANY ERROR WHEN IT BINDS (I.E. THE FIELD EXISTS AND IT'S NOT EMPTY FOR IT'S A PRIMARY KEY AND I CHECKED IN DEBUG) |
| // BOTH AT ITEM_COMMAND (WHEN THE COMMAND IS EXECUTED ON THE DETAIL TABLE IN QUESTION) AND EVEN IMIDEATELY AFTER BINDING IT WOULD BE ZERO; |
| } |
Am I doing something wrong there?