This is a migrated thread and some comments may be shown as answers.

show the values of textboxes in grid on button click

1 Answer 256 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Hadoop
Top achievements
Rank 1
Hadoop asked on 12 Sep 2015, 12:29 AM

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?

1 Answer, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 16 Sep 2015, 12:59 PM
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
Tags
Grid
Asked by
Hadoop
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Share this question
or