Click here to Skip to main content
15,891,629 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I need to replicate this using the behind code from the .aspx
XML
.ASPX

<obout:Grid ID="gridBranches" runat="server" FolderStyle="~/obout/grid/styles/style_6"
                AllowAddingRecords="False" AutoGenerateColumns="False" AllowColumnReordering="True"
                PageSize="10" ShowTotalNumberOfPages="True" AllowManualPaging="True" AllowFiltering="True"
                AllowMultiRecordSelection="false" FolderLocalization="../localization" Language="es"
                PageSizeOptions="10,20,30,40,50,100,500,999" OnDeleteCommand="DeleteBranchRecord">
                <ClientSideEvents OnBeforeClientDelete="OnBeforeDelete" />
                <Columns>
                    <obout:Column DataField="field1" Visible="false" />
                    <obout:Column DataField="field2" Visible="false" />
                    <obout:Column HeaderText="Edit" Width="60px" HeaderAlign="center" Align="center">
                        <TemplateSettings TemplateId="EditView"></TemplateSettings>
                    </obout:Column>
                </Columns>
                <Templates>
                    <obout:GridTemplate runat="server" ID=" EditView ">
                        <Template>
                            <a href="EditView.aspx?code=<%# Container.DataItem["field1"]%>&grid=y&Code2=<%# Container.DataItem["field2"] %>">
                                <asp:Image ID="btnEdit" runat="server" ImageUrl="../images/grid_Edit.png" />
                            </a>
                        </Template>
                    </obout:GridTemplate>
VB
.vb

Dim dataSource As New DataSet
            APP._sql = ("SQL instruction")
            APP._cmd.CommandText = APP._sql
            Dim dataAdapter As New OracleDataAdapter(APP._cmd)
            dataAdapter.Fill(dataSource)
            gridview.DataSource = dataSource
            Dim col1, col2 As New Obout.Grid.Column()
            col1.HeaderText = "Field1"
            col1.DataField = " Field1"
            gridview.Columns.Add(col1)
            col2.HeaderText = " Field2"
            col2.DataField = " Field2"
            gridview.Columns.Add(col2)
            gridview.DataBind()
            APP._dr.Close()

I already got the gridview to display everything I need, I just need to know how to add the template, this part:

ASP.NET
<Template>
                           <a href="EditView.aspx?code=<%# Container.DataItem["field1"]%>&grid=y&Code2=<%# Container.DataItem["field2"] %>">
                               <asp:Image ID="btnEdit" runat="server" ImageUrl="../images/grid_Edit.png" />
                           </a>
                       </Template>
                   </obout:GridTemplate>

I already opened a ticket on their website but im writing here in case someone has the answer or if i find the answer to post it here too.
Posted
Updated 18-Oct-12 6:03am
v4

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900