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

[Solved] RADGrid populating data to radtextbox

1 Answer 231 Views
Grid
This is a migrated thread and some comments may be shown as answers.
gstants
Top achievements
Rank 1
gstants asked on 15 Sep 2009, 08:31 PM
Hello,


I am trying to do a very simple thing and have found that i am totally lost..

I have a generic page that loads my RadGrid. I have all the proper code in place for this and it returns my data. I want to be able to select a row on RadGrid and then have it populate serveral different radtextboxes. for instance. I have 7 columns in my RadGrid (ticket id/request/research/etc) i want to be able to click on the row and have ticketid populate my ticketid text  box.. etc.. I already have the postback and the "click" working and can populate these textboxes with static data but i want to use the information in the grid... Any help? thanks so much..

Thanks,
Glenn

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Sep 2009, 05:25 AM
Hi Glenn,

I hope the RadTextBox you are trying to populate with the clicked row's data is outside the Grid. If so you can bind the TextBox with row data in the ItemCommand event of the Grid. Here is the sample code.

ASPX:
 
 
 <telerik:RadTextBox ID="RadTextBox1" runat="server"
            </telerik:RadTextBox><br /> 
           
                <telerik:RadGrid ID="RadGrid1" runat="server" Skin="WebBlue"   OnItemCommand="RadGrid1_ItemCommand"  > 
                    <MasterTableView > 
 
                    </MasterTableView> 
                    <ClientSettings EnablePostBackOnRowClick="true" > 
                    </ClientSettings> 
                </telerik:RadGrid> 


CS:
 
protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e) 
    { 
        if (e.CommandName == "RowClick"
        { 
            GridDataItem item = (GridDataItem)e.Item; 
            RadTextBox1.Text = item["columnUniqueName"].Text; 
        } 
    } 


Thanks
Shinu
Tags
Grid
Asked by
gstants
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or