show the values of textboxes in grid on button click

2 posts, 0 answers
  1. Hadoop
    Hadoop avatar
    8 posts
    Member since:
    Jun 2015

    Posted 11 Sep 2015 Link to this post

    I have some combo box whose values should be shown in gridview as the user clicks on submit button. Each time after filling the form, the data should be shown in grid view after pressing the submit button. How to write logic for this in code behind page

    <telerik:RadAjaxPanel ID="mainpanel" runat="server">
        <table border="0" width="100%">
            <tr>
                <td>
                    <telerik:RadTextBox ID="txtName" runat="server" Width="260px" TextMode="SingleLine" MaxLength="65" Style="text-transform: uppercase;"></telerik:RadTextBox>
                    <telerik:RadTextBox ID="txtName" runat="server" Width="260px" TextMode="SingleLine" MaxLength="65" Style="text-transform: uppercase;"></telerik:RadTextBox>
                    <telerik:RadTextBox ID="txtName" runat="server" Width="260px" TextMode="SingleLine" MaxLength="65" Style="text-transform: uppercase;"></telerik:RadTextBox>
                </td>
            </tr>
            <tr>
                <td>
                    <telerik:RadButton ID="submit" Text="Confirm" runat="server" OnClick="confirm_Click" />                           
                </td>
            </tr>
        </table>
     
    <telerik:RadGrid ID="gridConfirmSelection" runat="server" PageSize="100" AllowSorting="false" Width="100%"
    AllowPaging="True" ShowGroupPanel="false" AutoGenerateColumns="false" GridLines="None" >
        <MasterTableView AutoGenerateColumns="false" AllowFilteringByColumn="false" ShowFooter="false" TableLayout="Fixed">
            <Columns>
                <telerik:GridBoundColumn HeaderText="Name"></telerik:GridBoundColumn>
     
                <telerik:GridBoundColumn HeaderText="Address"></telerik:GridBoundColumn>
     
                <telerik:GridBoundColumn HeaderText="Contact No." ></telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>

    On pressing Confirm button the data should be shown in grid view. How to write logic for this in code behind page?
  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    2314 posts

    Posted 16 Sep 2015 Link to this post

    Hello Hadoop,

    Would you describe the behavior that you would like to implement in more detail?

    Are you trying to use the three input control to enter new information to the data source? That information would be displayed in the RadGrid control. If this is the case you would need to add custom logic. You should build the query to the datasource and pass the new information. Then you would need to rebind the grid.


    Or you would like to filter the data from the data source based in the input in the TextBox controls and display the result in RadGrid? In this scenario you can use an approach similar to the one in this example.



    Regards,
    Viktor Tachev
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top