2
Contributors
1
Reply
3
Views
6 Years
Discussion Span
Last Post by crishlay
0
div class="span-93 prepend-2 top">
                <strong>Enter  Number</strong><br />
                <asp:TextBox ID="PartNumber" runat="server" Width="100"></asp:TextBox>
                <asp:Button ID="CreateButton" runat="server" Width="85" Text="Locate" OnClick="CreateButton_Click" />
        </div>
<asp:Label ID="Select" runat="server" Font-Bold="true" Text="Select choice" Visible="false"></asp:Label><br />
                        <ajax:UpdatePanel ID="UpdatePanel" runat="server" UpdateMode="Conditional">
                                <ContentTemplate>
                                        <asp:GridView ID="GridView" Visible="false" runat="server"  HeaderStyle-Width="200" HeaderStyle-BackColor="#2B6292" HeaderStyle-ForeColor="White" 
                                        AllowSorting="true" AllowPaging="true" Width="600" AutoGenerateColumns="False" OnRowCreated="GridView_OnRowCreated" 
                                        DataKeyNames="Id" onsorting="GridView_OnSort">
                                                <Columns>
                                                        ...
                                                </Columns>
                                        </asp:GridView>
                                </ContentTemplate>
                                <Triggers>
                                        <ajax:AsyncPostBackTrigger ControlID="CreateButton"/>
                                </Triggers>
                        </ajax:UpdatePanel>




protected void Create_Click(object sender, EventArgs e)
            {
                    if (!String.IsNullOrEmpty(Number.Text))
                    {
                            BLL newbll = new BLL();
                            Database.DataTable tempTable = newbll.GetItemByPartNumber(Number.Text);

                            if (Table.Count != 0)
                            {
                                DataTable table = tempTable ;

                                string[] VID = { "Id" };
                                GridviewDiv.Visible = true;
                                GridView.DataSource = table;
                                GridView.DataKeyNames = VID;
                                GridView.DataBind();
                        }
                }
        }

Edited by Nick Evan: Fixed formatting

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.