Hi all,
I developed my costum module that named Companies I listed companies data in DataGrid control and it listed successfully as I want but I have to problems please help me :
1- I want to invisible ComID in my datagrid so I wrote this code before binding datagrid
DataGrid1.Columns(0).Visible =
False
DataGrid1.DataBind()
BUT
Error: System.ArgumentOutOfRangeException: Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index at System.Collections.ArrayList.get_Item(Int32 index) at System.Web.UI.WebControls.DataGridColumnCollection.get_Item(Int32 index) at DataCircle.DNN.Modules.Companies.Companies.BindData() in C:\DNN3\DesktopModules\Companies\Companies.ascx.vb:line 204
2- Editing in datagrid I used this code
<Columns>
<asp:TemplateColumn>
<ItemTemplate>
<asp:HyperLink id="editLink" NavigateUrl='<%# EditURL("ComID",DataBinder.Eval(Container.DataItem,"ComID")) %>' Visible="<%# IsEditable %>" runat="server" >
<asp:Image id="editLinkImage" ImageUrl="~/images/edit.gif" AlternateText="Edit" Visible="<%# IsEditable %>" Runat="server" />
</asp:hyperlink>
</ItemTemplate>
</asp:TemplateColumn>
</Columns>
BUT
DataBinder.Eval: 'System.Data.Common.DbDataRecord' does not contain a property with the name ComID.
However ComID viewed in datagrid
I really Can't solve these 2 problems, please help me